for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace BEAR\Package\Module;
use BEAR\AppMeta\AbstractAppMeta;
use BEAR\Resource\Annotation\AppName;
use BEAR\Sunday\Extension\Application\AppInterface;
use Ray\Di\AbstractModule;
use Ray\Di\Scope;
class AppMetaModule extends AbstractModule
{
/** @var AbstractAppMeta */
private $appMeta;
public function __construct(AbstractAppMeta $appMeta, ?AbstractModule $module = null)
$this->appMeta = $appMeta;
parent::__construct($module);
}
/**
* {@inheritdoc}
*/
protected function configure(): void
$this->bind(AbstractAppMeta::class)->toInstance($this->appMeta);
$this->bind(AppInterface::class)->to($this->appMeta->name . '\Module\App')->in(Scope::SINGLETON);
$this->bind()->annotatedWith(AppName::class)->toInstance($this->appMeta->name);