dinel / metadiscourse-annotator

0 stars 0 forks source link

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

Open dinel opened 6 years ago

dinel commented 6 years ago

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

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

     * Returns the tokens from a document as an iterator
     * @param integer $doc_id the ID of the document
     * @param Doctrine $doctrine object which gives access to Doctrine
     * @return an iterator which gives access to the tokens
     */
    public static function getTokensFromCorpus($corpus_id, $doctrine) {
        $tokens = $doctrine->getRepository('AppBundle:Token')
                           ->createQueryBuilder('t')
                           ->where('t.document IN (:ids)')
                           ->setParameter('ids', explode(",", SharedFunctions::getListIdTextFromCorpus($corpus_id, $doctrine)))
                           ->getQuery()

Posted from SensioLabsInsight