gggeek /
db-3v4l
| 1 | <?php |
||
| 2 | |||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 3 | namespace Db3v4l; |
||
| 4 | |||
| 5 | use Db3v4l\DependencyInjection\AddDBConsoleCommandPass; |
||
| 6 | use Db3v4l\DependencyInjection\Extension; |
||
| 7 | use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
||
|
0 ignored issues
–
show
The type
Symfony\Bundle\Framework...Kernel\MicroKernelTrait was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 8 | use Symfony\Component\Config\Loader\LoaderInterface; |
||
|
0 ignored issues
–
show
The type
Symfony\Component\Config\Loader\LoaderInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 9 | use Symfony\Component\Config\Resource\FileResource; |
||
|
0 ignored issues
–
show
The type
Symfony\Component\Config\Resource\FileResource was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 10 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
|
0 ignored issues
–
show
The type
Symfony\Component\Depend...ection\ContainerBuilder was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 11 | use Symfony\Component\HttpKernel\Kernel as BaseKernel; |
||
|
0 ignored issues
–
show
The type
Symfony\Component\HttpKernel\Kernel was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 12 | use Symfony\Component\Routing\RouteCollectionBuilder; |
||
|
0 ignored issues
–
show
The type
Symfony\Component\Routing\RouteCollectionBuilder was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 13 | |||
| 14 | class Kernel extends BaseKernel |
||
|
0 ignored issues
–
show
|
|||
| 15 | { |
||
| 16 | use MicroKernelTrait; |
||
| 17 | |||
| 18 | private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; |
||
| 19 | |||
| 20 | public function registerBundles(): iterable |
||
|
0 ignored issues
–
show
|
|||
| 21 | { |
||
| 22 | $contents = require $this->getProjectDir().'/config/bundles.php'; |
||
|
0 ignored issues
–
show
|
|||
| 23 | foreach ($contents as $class => $envs) { |
||
| 24 | if ($envs[$this->environment] ?? $envs['all'] ?? false) { |
||
| 25 | yield new $class(); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getProjectDir(): string |
||
|
0 ignored issues
–
show
|
|||
| 31 | { |
||
| 32 | return \dirname(__DIR__); |
||
| 33 | } |
||
| 34 | |||
| 35 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void |
||
|
0 ignored issues
–
show
|
|||
| 36 | { |
||
| 37 | $container->registerExtension(new Extension()); |
||
| 38 | |||
| 39 | $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); |
||
| 40 | $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || !ini_get('opcache.preload')); |
||
| 41 | $container->setParameter('container.dumper.inline_factories', true); |
||
| 42 | $confDir = $this->getProjectDir().'/config'; |
||
| 43 | |||
| 44 | $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); |
||
| 45 | $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob'); |
||
| 46 | $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); |
||
| 47 | $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); |
||
| 48 | } |
||
| 49 | |||
| 50 | protected function configureRoutes(RouteCollectionBuilder $routes): void |
||
|
0 ignored issues
–
show
|
|||
| 51 | { |
||
| 52 | $confDir = $this->getProjectDir().'/config'; |
||
| 53 | |||
| 54 | $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob'); |
||
| 55 | $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); |
||
| 56 | $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
|
0 ignored issues
–
show
|
|||
| 60 | * @param ContainerBuilder $container |
||
|
0 ignored issues
–
show
|
|||
| 61 | * Use this method to register compiler passes and manipulate the container during the building process. |
||
| 62 | */ |
||
|
0 ignored issues
–
show
|
|||
| 63 | protected function build(ContainerBuilder $container) |
||
| 64 | { |
||
| 65 | $container->addCompilerPass(new AddDBConsoleCommandPass()); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |