Identity/IdentityUtils.php
public static function merge(array $sids, array $newSids)
    {
        $existingSids = [];

        foreach ($sids as $sid) {
            $existingSids[] = $sid->getType().'::'.$sid->getIdentifier();
        }

        foreach ($newSids as $sid) {
            $key = $sid->getType().'::'.$sid->getIdentifier();

            if (!\in_array($key, $existingSids, true)) {
                $sids[] = $sid;
                $existingSids[] = $key;
            }
        }

        return $sids;
    }
public static function merge(array $sids, array $newSids)
    {
        $existingSids = [];

        foreach ($sids as $sid) {
            $existingSids[] = $sid->getType().'::'.$sid->getIdentifier();
        }

        foreach ($newSids as $sid) {
            $key = $sid->getType().'::'.$sid->getIdentifier();

            if (!\in_array($key, $existingSids, true)) {
                $sids[] = $sid;
                $existingSids[] = $key;
            }
        }

        return $sids;
    }
public static function merge ( array $ sids , array $ newSids ) { $ existingSids = [ ] ; foreach ( $ sids as $ sid ) { $ existingSids [ ] = $ sid -> getType ( ) . '::' . $ sid -> getIdentifier ( ) ; } foreach ( $ newSids as $ sid ) { $ key = $ sid -> getType ( ) . '::' . $ sid -> getIdentifier ( ) ; if ( ! \ in_array ( $ key , $ existingSids , true ) ) { $ sids [ ] = $ sid ; $ existingSids [ ] = $ key ; } } return $ sids ; }
Merge the security identities.

@param SecurityIdentityInterface[] $sids    The security identities
@param SecurityIdentityInterface[] $newSids The new security identities

@return SecurityIdentityInterface[]
Merge the security identities .