PersonServiceProvider.php 532 B

12345678910111213141516171819202122
  1. <?php
  2. declare(strict_types=1);
  3. namespace TestApp\ServiceProvider;
  4. use Cake\Core\ContainerInterface;
  5. use Cake\Core\ServiceProvider;
  6. class PersonServiceProvider extends ServiceProvider
  7. {
  8. protected array $provides = ['boot', 'sally'];
  9. public function bootstrap(ContainerInterface $container): void
  10. {
  11. $container->add('boot', json_decode('{"name":"boot"}'));
  12. }
  13. public function services(ContainerInterface $container): void
  14. {
  15. $container->add('sally', json_decode('{"name":"sally"}'));
  16. }
  17. }