dinel / metadiscourse-annotator

0 stars 0 forks source link

[Insight] Object parameters should be type hinted - in src/AppBundle/Utils/SharedFunctions.php, line 38 #59

Open dinel opened 6 years ago

dinel commented 6 years ago

in src/AppBundle/Utils/SharedFunctions.php, line 38

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

     * like structure
     * @param object $doctrine an instance of Doctrine
     * @return array the categories organised in a tree like structure ordered
     * alphabetically, both the parents and the leaves
     */
    public static function getCategoryTree($doctrine) {
        $categories = $doctrine->getRepository("AppBundle:Category")->findBy([], ['name' => 'ASC']);
        $cat_tree = array();       

        foreach($categories as $category) {
            if($category->getName() === "No parent category") {

Posted from SensioLabsInsight