src/Knp/Rad/ResourceResolver/RoutingNormalizer.php
public function normalizeDeclaration($declaration)
    {
        if (is_string($declaration)) {
            return $this->normalizeString($declaration);
        }

        // Normalize numerically indexed array
        if (array_keys($declaration) === array_keys(array_values($declaration))) {
            return $this->normalizeArray($declaration);
        }

        if (isset($declaration['arguments']) && !is_array($declaration['arguments'])) {
            throw new \InvalidArgumentException('The "arguments" parameter should be an array of arguments.');
        }

        // Adds default value to associative array
        return array_merge(['method' => null, 'required' => true, 'arguments' => []], $declaration);
    }
public function normalizeDeclaration($declaration)
    {
        if (is_string($declaration)) {
            return $this->normalizeString($declaration);
        }

        // Normalize numerically indexed array
        if (array_keys($declaration) === array_keys(array_values($declaration))) {
            return $this->normalizeArray($declaration);
        }

        if (isset($declaration['arguments']) && !is_array($declaration['arguments'])) {
            throw new \InvalidArgumentException('The "arguments" parameter should be an array of arguments.');
        }

        // Adds default value to associative array
        return array_merge(['method' => null, 'required' => true, 'arguments' => []], $declaration);
    }
public function normalizeDeclaration ( $ declaration ) { if ( is_string ( $ declaration ) ) { return $ this -> normalizeString ( $ declaration ) ; } // Normalize numerically indexed array if ( array_keys ( $ declaration ) === array_keys ( array_values ( $ declaration ) ) ) { return $ this -> normalizeArray ( $ declaration ) ; } if ( isset ( $ declaration [ 'arguments' ] ) && ! is_array ( $ declaration [ 'arguments' ] ) ) { throw new \ InvalidArgumentException ( 'The "arguments" parameter should be an array of arguments.' ) ; } // Adds default value to associative array return array_merge ( [ 'method' => null , 'required' => true , 'arguments' => [ ] ] , $ declaration ) ; }
Normalizes string and array declarations into associative array.

@param string|array $declaration

@return array
Normalizes string and array declarations into associative array .