dinel / metadiscourse-annotator

0 stars 0 forks source link

[Insight] Object parameters should be type hinted - in src/…/Controller/DefaultController.php, line 90 #56

Open dinel opened 6 years ago

dinel commented 6 years ago

in src/AppBundle/Controller/DefaultController.php, line 90

The parameter value, which is an object, should be typehinted.

                    $category = $cats[0];
                    if($category->getParent()) {
                        $categories = $this->getDoctrine()
                                           ->getRepository("AppBundle:Category")
                                           ->findBy(array('parent' => $category->getParent()->getId()));
                        $a_categories  = array_map(function($value) {
                                return array($value->getId(), $value->getName());
                        }, $categories);

                        $selected_leaf = $category->getId();
                        $selected_parent = $category->getParent()->getId();

Posted from SensioLabsInsight