private function validateAuthenticationType(array $expected, array $actual, $authName)
    {
        unset($actual['type']);
        // Empty array is always provided, even if the config is not filled.
        if (empty($actual['params'])) {
            unset($actual['params']);
        }
        $actual = array_keys($actual);
        sort($actual);
        sort($expected);

        if ($expected === $actual) {
            return;
        }

        throw new InvalidConfigurationException(sprintf(
            'Authentication "%s" requires %s but got %s',
            $authName,
            implode(', ', $expected),
            implode(', ', $actual)
        ));
    }
private function validateAuthenticationType(array $expected, array $actual, $authName)
    {
        unset($actual['type']);
        // Empty array is always provided, even if the config is not filled.
        if (empty($actual['params'])) {
            unset($actual['params']);
        }
        $actual = array_keys($actual);
        sort($actual);
        sort($expected);

        if ($expected === $actual) {
            return;
        }

        throw new InvalidConfigurationException(sprintf(
            'Authentication "%s" requires %s but got %s',
            $authName,
            implode(', ', $expected),
            implode(', ', $actual)
        ));
    }
private function validateAuthenticationType ( array $ expected , array $ actual , $ authName ) { unset ( $ actual [ 'type' ] ) ; // Empty array is always provided, even if the config is not filled. if ( empty ( $ actual [ 'params' ] ) ) { unset ( $ actual [ 'params' ] ) ; } $ actual = array_keys ( $ actual ) ; sort ( $ actual ) ; sort ( $ expected ) ; if ( $ expected === $ actual ) { return ; } throw new InvalidConfigurationException ( sprintf ( 'Authentication "%s" requires %s but got %s' , $ authName , implode ( ', ' , $ expected ) , implode ( ', ' , $ actual ) ) ) ; }
Validate that the configuration fragment has the specified keys and none other.

@param array  $expected Fields that must exist
@param array  $actual   Actual configuration hashmap
@param string $authName Name of authentication method for error messages

@throws InvalidConfigurationException If $actual does not have exactly the keys specified in $expected (plus 'type')
Validate that the configuration fragment has the specified keys and none other .