| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Devmachine\Bundle\ServicesInjectorBundle\Tests\Functional; |
||||
| 4 | |||||
| 5 | use Devmachine\Bundle\ServicesInjectorBundle\Configuration\Service; |
||||
| 6 | use Devmachine\Bundle\ServicesInjectorBundle\Request\Services; |
||||
| 7 | use Symfony\Component\HttpFoundation\Response; |
||||
| 8 | |||||
| 9 | /** |
||||
| 10 | * Inject to all actions. |
||||
| 11 | * |
||||
| 12 | * @Service(twig="twig") |
||||
| 13 | */ |
||||
| 14 | class TestController |
||||
| 15 | { |
||||
| 16 | /** |
||||
| 17 | * @Service("translator") |
||||
| 18 | * |
||||
| 19 | * @param Services $services |
||||
| 20 | * |
||||
| 21 | * @return Response |
||||
| 22 | */ |
||||
| 23 | public function firstAction(Services $services) |
||||
| 24 | { |
||||
| 25 | $services->getTwig(); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 26 | $services->getTranslator(); |
||||
|
0 ignored issues
–
show
The method
getTranslator() does not exist on Devmachine\Bundle\Servic...Bundle\Request\Services. Since you implemented __call, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 27 | |||||
| 28 | return Response::create(); |
||||
| 29 | } |
||||
| 30 | |||||
| 31 | /** |
||||
| 32 | * @Service({"ff"="form.factory", "url_generator"="router", "translator"}) |
||||
| 33 | * |
||||
| 34 | * @param Services $services |
||||
| 35 | * |
||||
| 36 | * @return Response |
||||
| 37 | */ |
||||
| 38 | public function secondAction(Services $services) |
||||
| 39 | { |
||||
| 40 | $services->get('twig'); |
||||
| 41 | $services->get('ff'); |
||||
| 42 | $services->getUrlGenerator(); |
||||
|
0 ignored issues
–
show
The method
getUrlGenerator() does not exist on Devmachine\Bundle\Servic...Bundle\Request\Services. Since you implemented __call, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 43 | $services->getTranslator(); |
||||
| 44 | |||||
| 45 | return Response::create(); |
||||
| 46 | } |
||||
| 47 | |||||
| 48 | public function thirdAction(Services $services) |
||||
| 49 | { |
||||
| 50 | $services->get('translator'); |
||||
| 51 | } |
||||
| 52 | } |
||||
| 53 |