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();
in src/AppBundle/Utils/UserUtils.php, line 35
Posted from SensioLabsInsight