@param string $method
@param bool $min

@return array
181340
private function getMinMax(string $method, bool $min) : array
    {
        $isMethod = null;
        $returnValue = null;
        $returnItem = null;

        foreach ($this->elements as $item) {
            $value = $this->elementMethodCall($method, $item, $isMethod);

            $ok = is_null($returnValue) ||
                ($min && $value < $returnValue) ||
                (!$min && $value > $returnValue);

            if ($ok) {
                $returnValue = $value;
                $returnItem = $item;
            }
        }

        return [$returnValue, $returnItem];
    }
111988
protected function getRequired($scope = 'Index', $method = Doozr_Http::REQUEST_METHOD_GET)
    {
        // prepare storage on method/verb level
        if (!isset($this->required[$method])) {
            return [];
        }

        // prepare storage on scope level
        if (!isset($this->required[$method][$scope])) {
            return [];
        }

        return $this->required[$method][$scope];
    }
554090
private function getParams($method, array $server, array $post) : array
    {
        // post data exists
        if ($method === 'post' && ! empty($post)) {
            return $post;
        }

        if (\in_array($method, ['post', 'put', 'patch', 'delete'], true)) {
            return $this->phpInput($server);
        }

        return $post;
    }
806832
public function getMethodMetadata($method, $index)
    {
        if ($this->hasMethodMetadata($method, $index)) {
            return $this->methodMetadata[$method][$index];
        }

        return false;
    }
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;
    }
239601
public static function bound($number, $min = 0, $max = PHP_INT_MAX)
    {
        $number = (int)$number;
        $min = (int)$min;
        $max = (int)$max;

        return min(max($number, $min), $max);
    }
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;
    }
984383
static function getAnnotations($class, $method = NULL)
	{
		$result = [];
		foreach (Arr::merge(self::getClassAnnotations($class), NULL !== $method
			? self::getMethodAnnotations($method, $class) : []) as $obj) {
			$result[get_class($obj)] = $obj;
		};

		return $result;
	}
1174676
protected function getMethodParameters($method, $docBlock = null): array
    {
        $result = [];

        /** @var \ReflectionParameter $param */
        foreach ($method->getParameters() as $param) {
            $parameter = new SmdParameter();
            $parameter->name = $param->getName();
            if (PHP_VERSION_ID > 70000) {
                $parameter->types = [(string)$param->getType()];
            }
            $parameter->optional = $param->isOptional();
            if ($parameter->optional) {
                $parameter->default = $param->getDefaultValue();
            }

            $result[$param->getName()] = $parameter;
        }

        if ($docBlock === null) {
            return array_values($result);
        }

        $params = $docBlock->getTagsByName(self::API_METHOD_DEFAULT_PARAMS);

        /** @var DocBlock\Tags\Param $param */
        foreach ($params as $param) {
            $name = (string)$param->getVariableName();

            $parameter = $result[$name] ?? new SmdParameter();
            $parameter->name = $name;

            if (!empty((string)$param->getDescription())) {
                $parameter->description = (string)$param->getDescription();
            }
            if (!empty((string)$param->getType())) {
                $parameter->types = explode('|', (string)$param->getType());
            }

            $result[$name] = $parameter;
        }

        /** @var ApiParam[] $params */
        $params = $docBlock->getTagsByName(self::API_METHOD_PARAMS);

        foreach ($params as $param) {
            $result = $this->getExtendedParameters($param, $result);
        }

        return array_values($result);
    }
1031067
private static function getCalledMethod($method)
    {
        if (strpos($method, '::') !== false) {
            $methodChunks = explode('::', $method);
            $method = $methodChunks[1];
        }

        return $method;
    }
914499
protected function makeJson(string $method, $params = []) : array
    {
        return [
            'json' => [
                'method' => $this->config['preserve_case'] ?
                    $method : strtolower($method),
                'params' => (array) $params,
                'id'     => $this->rpcId++,
            ],
        ];
    }
1260489
public function getRules($method = '')
    {
        if ('' === $method) {
            return $this->rules;
        }

        return isset($this->rules[strtolower($method)]) ? $this->rules[strtolower($method)] : [];
    }
1341681
protected function get($method = null)
	{
		if (is_null($method)) return $this->getRoutes();

		return array_get($this->routes, $method, array());
	}
680939
public function methodSignatures( $method )
    {
        return array_key_exists( $method, $this->FunctionList ) ? $this->FunctionList[$method] : false;
    }
649799
public function getUnusedVars( $method = NULL )
	{
		$list	= array();
		if( !strlen( $method = trim( $method ) ) )
		{
			foreach( $this->methods as $method => $data )
				if( ( $vars = $this->getUnusedVars( $method ) ) )
					$list[$method]	= $vars;
			return $list;
		}
		if( !array_key_exists( $method, $this->methods ) )
			throw new InvalidArgumentException( 'Method "'.$method.'" not found' );
		foreach( $this->getVariables( $method ) as $var => $data )
			$data ? NULL : $list[]	= $var;
		return $list;
	}
743210
public function getMethodAnnotations($method)
    {
        if (!$this->hasMethod($method)) {
            $name = $this->_getReflection()->getName();
            throw new Exception\InvalidArgumentException(
                "The class {$name} doesn't have a property called {$method}"
            );
        }

        if (empty($this->_annotations['methods'][$method])) {
            $comment = $this->_getReflection()
                ->getMethod($method)
                ->getDocComment();
            $data = AnnotationParser::getAnnotations($comment);
            $methodAnnotations = new AnnotationsList();
            foreach ($data as $property => $parsedData) {
                $methodAnnotations->append(
                    $this->_createAnnotation($property, $parsedData)
                );
            }
            $this->_annotations['methods'][$method] = $methodAnnotations;
        }
        return $this->_annotations['methods'][$method];
    }
77053
function $min(params) {
    if (Array.isArray(params) && params.every(p => typeof p === 'number')) {
        return Math.min(...params);
    }
    throw new Error('$min expects an array of number');
}