public function getCurrentUserPrincipals()
    {
        $currentUser = $this->getCurrentUserPrincipal();

        if (is_null($currentUser)) {
            return [];
        }

        return array_merge(
            [$currentUser],
            $this->getPrincipalMembership($currentUser)
        );
    }
public function getCurrentUserPrincipals()
    {
        $currentUser = $this->getCurrentUserPrincipal();

        if (is_null($currentUser)) {
            return [];
        }

        return array_merge(
            [$currentUser],
            $this->getPrincipalMembership($currentUser)
        );
    }
public function getCurrentUserPrincipals ( ) { $ currentUser = $ this -> getCurrentUserPrincipal ( ) ; if ( is_null ( $ currentUser ) ) { return [ ] ; } return array_merge ( [ $ currentUser ] , $ this -> getPrincipalMembership ( $ currentUser ) ) ; }
Returns a list of principals that's associated to the current
user, either directly or through group membership.

@return array
Returns a list of principals that s associated to the current user either directly or through group membership .