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);
    }