dinel / metadiscourse-annotator

0 stars 0 forks source link

[Insight] Object parameters should be type hinted - in src/AppBundle/Utils/UserUtils.php, line 35 #68

Open dinel opened 6 years ago

dinel commented 6 years ago

in src/AppBundle/Utils/UserUtils.php, line 35

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


    /**
     * Returns the current user
     * @return User an object which represents the current user
     */
    public static function getCurrentUser($context) {
        return $context->get("security.context")->getToken()->getUser();
    }

    public static function getCurrentUserName($context) {
        return self::getCurrentUser($context)->getUsername();

Posted from SensioLabsInsight