These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the Sylius package. |
||
5 | * |
||
6 | * (c) Paweł Jędrzejewski |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | declare(strict_types=1); |
||
13 | |||
14 | use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; |
||
15 | use Symfony\Component\Config\Loader\LoaderInterface; |
||
16 | use Symfony\Component\HttpKernel\Kernel; |
||
17 | |||
18 | class AppKernel extends Kernel |
||
0 ignored issues
–
show
|
|||
19 | { |
||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | public function registerBundles(): array |
||
24 | { |
||
25 | return [ |
||
26 | new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
||
27 | new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), |
||
28 | new FOS\RestBundle\FOSRestBundle(), |
||
29 | new JMS\SerializerBundle\JMSSerializerBundle($this), |
||
30 | new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), |
||
31 | new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), |
||
32 | new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(), |
||
33 | new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(), |
||
34 | new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
||
35 | new Symfony\Bundle\TwigBundle\TwigBundle(), |
||
36 | ]; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function registerContainerConfiguration(LoaderInterface $loader): void |
||
43 | { |
||
44 | $loader->load(__DIR__ . '/config/config.yml'); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | protected function getContainerBaseClass(): string |
||
51 | { |
||
52 | if ('test' === $this->environment) { |
||
53 | return MockerContainer::class; |
||
54 | } |
||
55 | |||
56 | return parent::getContainerBaseClass(); |
||
57 | } |
||
58 | } |
||
59 |
This check looks for classes that have been defined more than once.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.