These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Onurb\Bundle\YumlBundle\Controller; |
||
4 | |||
5 | use Onurb\Bundle\YumlBundle\Yuml\YumlClient; |
||
6 | use Onurb\Bundle\YumlBundle\Yuml\YumlClientInterface; |
||
7 | use Symfony\Bridge\Doctrine\RegistryInterface; |
||
8 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
||
9 | |||
10 | /** |
||
11 | * Utility to generate Yuml compatible strings from metadata graphs |
||
12 | * Adaptation of DoctrineORMModule\Yuml\YumlController for ZendFramework-Zend-Developer-Tools |
||
13 | * |
||
14 | * @license MIT |
||
15 | * @link http://www.doctrine-project.org/ |
||
16 | * @author Bruno Heron <[email protected]> |
||
17 | * @author Marco Pivetta <[email protected]> |
||
18 | */ |
||
19 | class YumlController extends Controller |
||
20 | { |
||
21 | /** |
||
22 | * @param YumlClientInterface|null $yumlClient |
||
23 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
||
24 | */ |
||
25 | 1 | public function indexAction(YumlClientInterface $yumlClient = null) |
|
26 | { |
||
27 | 1 | $yumlClient = $yumlClient ? $yumlClient : new YumlClient($this->getDoctrine()->getManager()); |
|
0 ignored issues
–
show
|
|||
28 | |||
29 | 1 | $showDetailParam = $this->container->getParameter('onurb_yuml.show_fields_description'); |
|
30 | 1 | $colorsParam = $this->container->getParameter('onurb_yuml.colors'); |
|
31 | 1 | $notesParam = $this->container->getParameter('onurb_yuml.notes'); |
|
32 | |||
33 | 1 | return $this->redirect( |
|
34 | 1 | $yumlClient->getGraphUrl( |
|
35 | 1 | $yumlClient->makeDslText($showDetailParam, $colorsParam, $notesParam) |
|
36 | ) |
||
37 | ); |
||
38 | } |
||
39 | } |
||
40 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.