dinel / metadiscourse-annotator

0 stars 0 forks source link

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

Open dinel opened 6 years ago

dinel commented 6 years ago

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

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

     */
    public function getSubcategory(Request $request, $parent) {
        if($request->isXmlHttpRequest()) {
            $repository = $this->getDoctrine()->getRepository("\AppBundle\Entity\Category");
            $categories = $repository->findBy(array('parent' => $parent));
            $a_categories  = array_map(function($value) {
                    return array($value->getId(), $value->getName());
            }, $categories);

            return new JsonResponse(array(
                        'sub_categories' => $a_categories,

Posted from SensioLabsInsight