Identity/SubjectUtils.php
public static function getSubjectIdentity($subject)
    {
        if ($subject instanceof SubjectIdentityInterface) {
            return $subject;
        }

        if (\is_string($subject)) {
            return SubjectIdentity::fromClassname($subject);
        }

        if (\is_object($subject)) {
            return SubjectIdentity::fromObject($subject);
        }

        throw new UnexpectedTypeException($subject, SubjectIdentityInterface::class.'|object|string');
    }
public static function getSubjectIdentity($subject)
    {
        if ($subject instanceof SubjectIdentityInterface) {
            return $subject;
        }

        if (\is_string($subject)) {
            return SubjectIdentity::fromClassname($subject);
        }

        if (\is_object($subject)) {
            return SubjectIdentity::fromObject($subject);
        }

        throw new UnexpectedTypeException($subject, SubjectIdentityInterface::class.'|object|string');
    }
public static function getSubjectIdentity ( $ subject ) { if ( $ subject instanceof SubjectIdentityInterface ) { return $ subject ; } if ( \ is_string ( $ subject ) ) { return SubjectIdentity :: fromClassname ( $ subject ) ; } if ( \ is_object ( $ subject ) ) { return SubjectIdentity :: fromObject ( $ subject ) ; } throw new UnexpectedTypeException ( $ subject , SubjectIdentityInterface :: class . '|object|string' ) ; }
Get the subject identity.

@param object|string|SubjectIdentityInterface $subject The subject instance or classname

@return SubjectIdentityInterface
Get the subject identity .