Flatten messages into a single collection
based on an accessor method.

@param $method

@return array
199638
private function mergeMessages(string $method): array
    {
        $messages = [];
        foreach ($this->readers as $reader) {
            $messages = array_merge($messages, $reader->{$method}());
        }

        return $messages;
    }
92834
protected function addMessages($method, array $messages)
    {
        // If there was exactly 1 message, it wasn't put in an array of messages.
        if (array_key_exists('code', $messages)) {
            $messages = array($messages);
        }
        foreach ($messages as $message) {
            call_user_func(array($this, $method), $message);
        }
        return $this;
    }
692154
protected function getResults($method)
    {
        if ($this->schema) {
            // set root constraints
            if (isset($this->constraints[$this->root])) {
                $this->constraints[$this->root]($this->eloquentQuery);
            }

            // set eager load constraints
            $this->eloquentQuery->setEagerLoads($this->parseRelationsFromSchema($this->schema, ''));

            // execute query
            $results = $this->eloquentQuery->$method();

            // transform to data transfer objects
            if ($results) {
                $dtos = $results->toDataTransferObject($this->root, $this->schema, $this->transformations);
                
                return [$this->root => $dtos];
            }
        }

        return null;
    }
135343
protected function getCurlMethod($method)
    {
        $result = ['method' => CURLOPT_HTTPGET, 'value' => true];
        if (self::METHOD_POST == $method) {
            $result['method'] = CURLOPT_POST;
        }elseif (self::METHOD_UPLOAD == $method) {
            $result['method'] = CURLOPT_UPLOAD;
        }

        return $result;
    }
1112847
protected function denormaliseMessages($messages)
    {
        // Sort prior to denormalisation
        ksort($messages);
        $entities = [];
        foreach ($messages as $entity => $value) {
            // Skip un-namespaced keys
            $value = $this->denormaliseValue($value);

            // Non-nested key
            if (strstr($entity, '.') === false) {
                $entities[$entity] = $value;
                continue;
            }

            // Get key nested within class
            list($class, $key) = $this->getClassKey($entity);
            if (!isset($entities[$class])) {
                $entities[$class] = [];
            }

            $entities[$class][$key] = $value;
        }
        return $entities;
    }
246971
public function invocations(string $method): Invocations
    {
        if (empty($method)) {
            throw new \InvalidArgumentException(
                    'Please provide a method name to retrieve invocations for.'
            );
        }

        if (!isset($this->_allowedMethods[$method])) {
            throw new \InvalidArgumentException(
                    $this->canNot('retrieve invocations for', $method)
            );
        }

        if (!isset($this->invocations[$method])) {
            $this->invocations[$method] = new Invocations(
                    $this->completeNameOf($method),
                    $this->_methodParams[$method]
            );
        }

        return $this->invocations[$method];
    }
1332743
public static function caseConvertArrayKeysRecursively(
        array $array,
        string $method = self::PASCALCASE,
        string $separator = '_'
    ): array {
        $return = [];
        foreach ($array as $key => $value) {
            if (!preg_match('/^\d+$/', $key)) {
                $key = self::$method(preg_replace('/\-/', '_', $key), true, $separator);
            }
            if (is_array($value)) {
                $value = self::caseConvertArrayKeysRecursively($value, $method);
            }
            $return[$key] = $value;
        }
        return $return;
    }
1056504
public function parameterize($method)
    {
        $parameterArray = array();
        switch ($method) {
            case 'create':
                if(!is_null($this->getUrl())){
                    $parameterArray['url'] = $this->getUrl();
                }else{
                    $parameterArray['email'] = $this->getEmail();
                }
                $parameterArray['event_types'] = $this->getEventTypes();
                if (!is_null($this->getActive())) {
                    $parameterArray['active'] = $this->getActive();
                }
                break;
            case 'update':
                if(!is_null($this->getUrl())){
                    $parameterArray['url'] = $this->getUrl();
                }else{
                    $parameterArray['email'] = $this->getEmail();
                }
                $parameterArray['event_types'] = $this->getEventTypes();
                if (!is_null($this->getActive())) {
                    $parameterArray['active'] = $this->getActive();
                }
                break;
            case 'delete':
                break;
            case 'getOne':
                $parameterArray['count'] = 1;
                $parameterArray['offset'] = 0;
                break;
            case 'getAll':
                $parameterArray = $this->getFilter();
                break;
        }

        return $parameterArray;
    }
680939
public function methodSignatures( $method )
    {
        return array_key_exists( $method, $this->FunctionList ) ? $this->FunctionList[$method] : false;
    }
379249
protected function typeRoutes(?string $method): array
    {
        $routes = Arr::getArray($this->routes, $method);

        if ($method) {
            $routes = array_merge(Arr::getArray($this->routes, ''), $routes);
        }

        return $routes;
    }
94795
private function getNormalizedArgs($method, $args): array
    {
        $normalizer = resolve(RouteNormalizer::class);
        $method = str_replace('whenYou', '', $method);
        if ($method == 'CallAction') {
            return $normalizer->normalizeAction($args);
        }
        if ($method == 'HitRouteName') {
            return $args;
        }

        $method = str_replace('VisitUrl', 'SendGet', $method);
        $method = str_replace('Send', '', $method);

        return $normalizer->normalizeUrl($args, strtoupper($method));
    }
690892
public static function parseParameters(Method $method) : array
	{
		$taskName = NULL;
		if ($method->hasAnnotation(Parameters::TASK)) {
			$className = $method->getDeclaringClass()->getName();
			$methodName = $method->getName();
			$taskName = $className . ' - ' . $methodName;
		}

		$taskAnnotation = $method->getAnnotation(Parameters::TASK);

		$parameters = [
			static::TASK => is_string($taskAnnotation)
				? Parser::parseName($taskAnnotation)
				: $taskName,
			static::PERIOD => $method->hasAnnotation(Parameters::PERIOD)
				? Parser::parsePeriod((string) $method->getAnnotation(Parameters::PERIOD))
				: NULL,
			static::DAYS => $method->hasAnnotation(Parameters::DAYS)
				? Parser::parseDays((string) $method->getAnnotation(Parameters::DAYS))
				: NULL,
			static::TIME => $method->hasAnnotation(Parameters::TIME)
				? Parser::parseTimes((string) $method->getAnnotation(Parameters::TIME))
				: NULL,
		];

		return $parameters;
	}
1150016
public function setMethod($method = '')
    {
        if (mb_strlen($method) == 0) {
            $this->debug->debug(__FUNCTION__, 'Set Default Method = GET if $method is does not exist');
            $method = 'GET';
        } else {
            $method       = strtoupper($method);
            $validMethods = [
                'GET',
                'HEAD',
                'PUT',
                'POST',
                'DELETE'
            ];
            if (!in_array($method, $validMethods)) {
                $message = "Error: " . __CLASS__ . ": The requested method (${method}) is not valid here";
                $this->debug->error(__FUNCTION__, $message);

                return $message;
            }
        }
        $this->method = $method;

        return $this;
    }
1070663
protected function transform($messages, $format)
        {
            $messages = (array) $messages;

            foreach ($messages as $key => &$message) {
                $message = repl(':message', $message, $format);
            }

            return $messages;
        }
986518
public static function getCommments( $method ){

		//split para el nombre de la clase y m�todo.
		$clazzAndMethod = explode("::", $method);
		
		$reflectionMethod = new \ReflectionMethod( $clazzAndMethod[0] , $clazzAndMethod[1]);
		
		$comments = $reflectionMethod->getDocComment();
			
		return $comments;
	}
493077
public function parameterize($method)
    {
        $parameterArray = array();
        switch ($method) {
            case 'create':
                $parameterArray['Identifier'] = $this->getIdentifier();
                break;
            case 'update':
                $parameterArray['Identifier'] = $this->getIdentifier();
                break;
            case 'delete':
                break;
            case 'getOne':
                $parameterArray['count'] = 1;
                $parameterArray['offset'] = 0;
                break;
            case 'getAll':
                $parameterArray = $this->getFilter();
                break;
        }

        return $parameterArray;
    }
833936
public function getMethodAnnotations(\ReflectionMethod $method)
    {
        return array_merge(
            $this->reader->getMethodAnnotations($method),
            $this->converter->getMethodAnnotations($method)
        );
    }