57 lines
1.3 KiB
PHP
57 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App;
|
|
|
|
/**
|
|
* The configuration provider for the App module
|
|
*
|
|
* @see https://docs.laminas.dev/laminas-component-installer/
|
|
*/
|
|
class ConfigProvider
|
|
{
|
|
/**
|
|
* Returns the configuration array
|
|
*
|
|
* To add a bit of a structure, each section is defined in a separate
|
|
* method which returns an array with its configuration.
|
|
*/
|
|
public function __invoke(): array
|
|
{
|
|
return [
|
|
'dependencies' => $this->getDependencies(),
|
|
'templates' => $this->getTemplates(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Returns the container dependencies
|
|
*/
|
|
public function getDependencies(): array
|
|
{
|
|
return [
|
|
'invokables' => [
|
|
Handler\PingHandler::class => Handler\PingHandler::class,
|
|
],
|
|
'factories' => [
|
|
Handler\HomePageHandler::class => Handler\HomePageHandlerFactory::class,
|
|
],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Returns the templates configuration
|
|
*/
|
|
public function getTemplates(): array
|
|
{
|
|
return [
|
|
'paths' => [
|
|
'app' => [__DIR__ . '/../templates/app'],
|
|
'error' => [__DIR__ . '/../templates/error'],
|
|
'layout' => [__DIR__ . '/../templates/layout'],
|
|
],
|
|
];
|
|
}
|
|
}
|