protected function mergePolicyConfiguration(array $firstConfigurationArray, array $secondConfigurationArray): array
    {
        $result = Arrays::arrayMergeRecursiveOverrule($firstConfigurationArray, $secondConfigurationArray);
        if (!isset($result['roles'])) {
            return $result;
        }
        foreach ($result['roles'] as $roleIdentifier => $roleConfiguration) {
            if (!isset($firstConfigurationArray['roles'][$roleIdentifier]['privileges']) || !isset($secondConfigurationArray['roles'][$roleIdentifier]['privileges'])) {
                continue;
            }
            $result['roles'][$roleIdentifier]['privileges'] = array_merge($firstConfigurationArray['roles'][$roleIdentifier]['privileges'], $secondConfigurationArray['roles'][$roleIdentifier]['privileges']);
        }
        return $result;
    }
protected function mergePolicyConfiguration(array $firstConfigurationArray, array $secondConfigurationArray): array
    {
        $result = Arrays::arrayMergeRecursiveOverrule($firstConfigurationArray, $secondConfigurationArray);
        if (!isset($result['roles'])) {
            return $result;
        }
        foreach ($result['roles'] as $roleIdentifier => $roleConfiguration) {
            if (!isset($firstConfigurationArray['roles'][$roleIdentifier]['privileges']) || !isset($secondConfigurationArray['roles'][$roleIdentifier]['privileges'])) {
                continue;
            }
            $result['roles'][$roleIdentifier]['privileges'] = array_merge($firstConfigurationArray['roles'][$roleIdentifier]['privileges'], $secondConfigurationArray['roles'][$roleIdentifier]['privileges']);
        }
        return $result;
    }
protected function mergePolicyConfiguration ( array $ firstConfigurationArray , array $ secondConfigurationArray ) : array { $ result = Arrays :: arrayMergeRecursiveOverrule ( $ firstConfigurationArray , $ secondConfigurationArray ) ; if ( ! isset ( $ result [ 'roles' ] ) ) { return $ result ; } foreach ( $ result [ 'roles' ] as $ roleIdentifier => $ roleConfiguration ) { if ( ! isset ( $ firstConfigurationArray [ 'roles' ] [ $ roleIdentifier ] [ 'privileges' ] ) || ! isset ( $ secondConfigurationArray [ 'roles' ] [ $ roleIdentifier ] [ 'privileges' ] ) ) { continue ; } $ result [ 'roles' ] [ $ roleIdentifier ] [ 'privileges' ] = array_merge ( $ firstConfigurationArray [ 'roles' ] [ $ roleIdentifier ] [ 'privileges' ] , $ secondConfigurationArray [ 'roles' ] [ $ roleIdentifier ] [ 'privileges' ] ) ; } return $ result ; }
Merges two policy configuration arrays.

@param array $firstConfigurationArray
@param array $secondConfigurationArray
@return array
Merges two policy configuration arrays .