MyPackageTest.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Test\Michel\Framework\Core\Package;
  3. use Michel\Framework\Core\Command\CacheClearCommand;
  4. use Michel\Framework\Core\Command\MakeCommandCommand;
  5. use Michel\Package\PackageInterface;
  6. use Michel\Route;
  7. use Michel\RouterInterface;
  8. use Psr\Container\ContainerInterface;
  9. class MyPackageTest implements PackageInterface
  10. {
  11. public function getDefinitions(): array
  12. {
  13. return [
  14. RouterInterface::class => static function (ContainerInterface $container) {
  15. return new \stdClass();
  16. },
  17. 'render' => static function (ContainerInterface $container) {
  18. return new \stdClass();
  19. },
  20. ];
  21. }
  22. public function getParameters(): array
  23. {
  24. return [
  25. 'app.url' => 'https://example.com',
  26. 'app.locale' => 'en',
  27. 'app.template_dir' => '/path/to/templates',
  28. ];
  29. }
  30. public function getRoutes(): array
  31. {
  32. return [
  33. new Route('example', '/example', function () {}),
  34. new Route('another', '/another', function () {}),
  35. ];
  36. }
  37. public function getListeners(): array
  38. {
  39. return [
  40. 'App\\Event\\ExampleEvent' => \stdClass::class,
  41. 'App\\Event\\AnotherEvent' => \stdClass::class,
  42. ];
  43. }
  44. public function getCommandSources(): array
  45. {
  46. return [
  47. CacheClearCommand::class,
  48. MakeCommandCommand::class,
  49. ];
  50. }
  51. public function getControllerSources(): array
  52. {
  53. return [];
  54. }
  55. }