public function extract(array $scopes, array $claims)
    {
        $claimData  = [];
        $keys       = array_keys($claims);

        foreach ($scopes as $scope) {
            $scopeName = ($scope instanceof ScopeEntityInterface) ? $scope->getIdentifier() : $scope;

            $claimSet = $this->getClaimSet($scopeName);
            if (null === $claimSet) {
                continue;
            }

            $intersected = array_intersect($claimSet->getClaims(), $keys);

            if (empty($intersected)) {
                continue;
            }

            $data = array_filter($claims,
                function($key) use ($intersected) {
                    return in_array($key, $intersected);
                },
                ARRAY_FILTER_USE_KEY
            );

            $claimData = array_merge($claimData, $data);
        }

        return $claimData;
    }
public function extract(array $scopes, array $claims)
    {
        $claimData  = [];
        $keys       = array_keys($claims);

        foreach ($scopes as $scope) {
            $scopeName = ($scope instanceof ScopeEntityInterface) ? $scope->getIdentifier() : $scope;

            $claimSet = $this->getClaimSet($scopeName);
            if (null === $claimSet) {
                continue;
            }

            $intersected = array_intersect($claimSet->getClaims(), $keys);

            if (empty($intersected)) {
                continue;
            }

            $data = array_filter($claims,
                function($key) use ($intersected) {
                    return in_array($key, $intersected);
                },
                ARRAY_FILTER_USE_KEY
            );

            $claimData = array_merge($claimData, $data);
        }

        return $claimData;
    }
public function extract ( array $ scopes , array $ claims ) { $ claimData = [ ] ; $ keys = array_keys ( $ claims ) ; foreach ( $ scopes as $ scope ) { $ scopeName = ( $ scope instanceof ScopeEntityInterface ) ? $ scope -> getIdentifier ( ) : $ scope ; $ claimSet = $ this -> getClaimSet ( $ scopeName ) ; if ( null === $ claimSet ) { continue ; } $ intersected = array_intersect ( $ claimSet -> getClaims ( ) , $ keys ) ; if ( empty ( $ intersected ) ) { continue ; } $ data = array_filter ( $ claims , function ( $ key ) use ( $ intersected ) { return in_array ( $ key , $ intersected ) ; } , ARRAY_FILTER_USE_KEY ) ; $ claimData = array_merge ( $ claimData , $ data ) ; } return $ claimData ; }
For given scopes and aggregated claims get all claims that have been configured on the extractor.

@param array $scopes
@param array $claims
@return array
For given scopes and aggregated claims get all claims that have been configured on the extractor .