<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<NEON parameters: mailer: transport: sendmail services: - Project\\Mailer(%mailer.transport%) - Project\\NewsletterManager() NEON ); dump($container->getByType(\Project\NewsletterManager::class));
<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<'NEON' parameters: mailer: transport: sendmail services: mailer: class: Project\Mailer arguments: [%mailer.transport%] newsletter_manager: class: Project\NewsletterManager NEON ); dump($container->getService('newsletter_manager'));
<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<NEON php: \tdate.timezone: Europe/Prague \tdisplay_errors: 0 NEON ); $container->initialize();
<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<NEON parameters: \tmailer: \t\ttransport: sendmail services: \t- \t\timplement: Project\\IMailerFactory \t\tfactory: Project\\Mailer(%mailer.transport%) NEON ); $factory = $container->getByType(\Project\IMailerFactory::class); dump($factory); dump($factory->create()); dump($factory->create());
<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<'NEON' parameters: mailer: transport: sendmail services: - Project\Mailer(%mailer.transport%) - class: Project\NewsletterManagerSetter setup: - $mailer(@Project\Mailer) NEON ); dump($container->getByType(\Project\NewsletterManagerSetter::class));
<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<NEON decorator: \tProject\\ConsoleCommand: \t\tsetup: \t\t\t- setFoo() \t\ttags: \t\t\t- console.command services: \t- Project\\Foo \t- Project\\ConsoleFirstCommand \t- Project\\ConsoleSecondCommand NEON ); dump($container->getByType(\Project\ConsoleFirstCommand::class)); dump($container->getByType(\Project\ConsoleSecondCommand::class)); dump($container->findByTag('console.command')); dump($container->findByType(\Project\ConsoleCommand::class));
<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<NEON decorator: \tProject\\IPresenter: \t\tinject: on services: \t- Project\\HomepagePresenter() \t- Project\\NewsletterManager() \t- Project\\Foo() \t- Project\\Mailer(sendmail) NEON ); dump($container->getByType(\Project\HomepagePresenter::class));
<?php require_once __DIR__ . '/bootstrap.php'; $container = netteFromConfig(<<<NEON parameters: \tmailer: \t\ttransport: sendmail services: \t- Project\\Mailer(%mailer.transport%) \t- \t\tclass: Project\\NewsletterManagerSetter \t\tsetup: \t\t\t- setMailer() NEON ); dump($container->getByType(\Project\NewsletterManagerSetter::class));