Returns an array of parameters customized for the argumented methodname
@param string $method
@return array
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;
    }
1064466
protected function getApiUrl($method) {
    static $READ_ONLY_CALLS =
      array('admin.getallocation' => 1,
            'admin.getappproperties' => 1,
            'admin.getbannedusers' => 1,
            'admin.getlivestreamvialink' => 1,
            'admin.getmetrics' => 1,
            'admin.getrestrictioninfo' => 1,
            'application.getpublicinfo' => 1,
            'auth.getapppublickey' => 1,
            'auth.getsession' => 1,
            'auth.getsignedpublicsessiondata' => 1,
            'comments.get' => 1,
            'connect.getunconnectedfriendscount' => 1,
            'dashboard.getactivity' => 1,
            'dashboard.getcount' => 1,
            'dashboard.getglobalnews' => 1,
            'dashboard.getnews' => 1,
            'dashboard.multigetcount' => 1,
            'dashboard.multigetnews' => 1,
            'data.getcookies' => 1,
            'events.get' => 1,
            'events.getmembers' => 1,
            'fbml.getcustomtags' => 1,
            'feed.getappfriendstories' => 1,
            'feed.getregisteredtemplatebundlebyid' => 1,
            'feed.getregisteredtemplatebundles' => 1,
            'fql.multiquery' => 1,
            'fql.query' => 1,
            'friends.arefriends' => 1,
            'friends.get' => 1,
            'friends.getappusers' => 1,
            'friends.getlists' => 1,
            'friends.getmutualfriends' => 1,
            'gifts.get' => 1,
            'groups.get' => 1,
            'groups.getmembers' => 1,
            'intl.gettranslations' => 1,
            'links.get' => 1,
            'notes.get' => 1,
            'notifications.get' => 1,
            'pages.getinfo' => 1,
            'pages.isadmin' => 1,
            'pages.isappadded' => 1,
            'pages.isfan' => 1,
            'permissions.checkavailableapiaccess' => 1,
            'permissions.checkgrantedapiaccess' => 1,
            'photos.get' => 1,
            'photos.getalbums' => 1,
            'photos.gettags' => 1,
            'profile.getinfo' => 1,
            'profile.getinfooptions' => 1,
            'stream.get' => 1,
            'stream.getcomments' => 1,
            'stream.getfilters' => 1,
            'users.getinfo' => 1,
            'users.getloggedinuser' => 1,
            'users.getstandardinfo' => 1,
            'users.hasapppermission' => 1,
            'users.isappuser' => 1,
            'users.isverified' => 1,
            'video.getuploadlimits' => 1);
    $name = 'api';
    if (isset($READ_ONLY_CALLS[strtolower($method)])) {
      $name = 'api_read';
    } else if (strtolower($method) == 'video.upload') {
      $name = 'api_video';
    }
    return self::getUrl($name, 'restserver.php');
  }
1301907
public function getParameterTypes(\ReflectionParameter $parameter) : array
    {
        $name = $parameter->getName();
        $function = $parameter->getDeclaringFunction();
        $types = $this->getFunctionParameterTypes($function);

        return isset($types[$name]) ? $types[$name] : [];
    }
778530
public function parameterize($method)
    {
        $parameterArray = array();
        switch ($method) {
            case 'create':
                if (!is_null($this->getClient())) {
                    $parameterArray['client'] = $this->getClient();
                }
                if (!is_null($this->getOffer())) {
                    $parameterArray['offer'] = $this->getOffer();
                }
                $parameterArray['payment'] = $this->getPayment();

                if (!is_null($this->getAmount())) {
                    $parameterArray['amount'] = $this->getAmount();
                }
                if (!is_null($this->getCurrency())) {
                    $parameterArray['currency'] = $this->getCurrency();
                }
                if (!is_null($this->getInterval())) {
                    $parameterArray['interval'] = $this->getInterval();
                }
                if (!is_null($this->getName())) {
                    $parameterArray['name'] = $this->getName();
                }
                if (!is_null($this->getPeriodOfValidity())) {
                    $parameterArray['period_of_validity'] = $this->getPeriodOfValidity();
                }
                if (!is_null($this->getTrialEnd())) {
                    $parameterArray['trial_end']  = $this->getTrialEnd();
                }
                if (!is_null($this->getStartAt())) {
                    $parameterArray['start_at']  = $this->getStartAt();
                }
                if (!is_null($this->getMandateReference())) {
                    $parameterArray['mandate_reference'] = $this->getMandateReference();
                }
                break;
            case 'update':
                if (!is_null($this->getOffer())) {
                    $parameterArray['offer'] = $this->getOffer();
                }
                if (!is_null($this->getPayment())) {
                    $parameterArray['payment'] = $this->getPayment();
                } else {
                    $parameterArray['token'] = $this->getToken();
                }
                if (!is_null($this->getAmount())) {
                    $parameterArray['amount'] = $this->getAmount();
                }
                if (!is_null($this->getCurrency())) {
                    $parameterArray['currency'] = $this->getCurrency();
                }
                if (!is_null($this->getInterval())) {
                    $parameterArray['interval'] = $this->getInterval();
                }
                if (!is_null($this->getName())) {
                    $parameterArray['name'] = $this->getName();
                }
                if (!is_null($this->getPause())) {
                    $parameterArray['pause'] = $this->getPause();
                }
                if (!is_null($this->getPeriodOfValidity())) {
                    $parameterArray['period_of_validity'] = $this->getPeriodOfValidity();
                }
                if (!is_null($this->getTrialEnd())) {
                    $parameterArray['trial_end']  = $this->getTrialEnd();
                }
                if (!is_null($this->getAmountChangeType())) {
                    $parameterArray['amount_change_type'] = $this->getAmountChangeType();
                }
                if (!is_null($this->getOfferChangeType())) {
                    $parameterArray['offer_change_type'] = $this->getOfferChangeType();
                }
                if (!is_null($this->getMandateReference())) {
                    $parameterArray['mandate_reference'] = $this->getMandateReference();
                }
                break;
            case 'getOne':
                $parameterArray['count'] = 1;
                $parameterArray['offset'] = 0;
                break;
            case 'getAll':
                $parameterArray = $this->getFilter();
                break;
            case 'delete':
                if (!is_null($this->getRemove())){
                    $parameterArray['remove'] = $this->getRemove();
                }
                break;
        }

        return $parameterArray;
    }
1023282
public static function getClassMethodArgs($class, string $method)
    {
        static $cache = null;

        if (null !== $cache && isset($cache[$class][$method])) {
            return $cache[$class][$method];
        }

        $reflector = new \ReflectionMethod($class, $method);
        $params = $reflector->getParameters();
        if (empty($params)) {
            $cache[$class][$method] = [];
            return [];
        }
        $args = [];
        foreach ($params as $param) {
            $args[$param->name] = [
                'optional' => $param->isOptional(),
                'variadic' => $param->isVariadic(),
            ];
            if ($param->isOptional() && $param->isDefaultValueAvailable()) {
                $args[$param->name]['default'] = $param->getDefaultValue();
            }
            if ($param->hasType()) {
                $args[$param->name]['type'] = (string)$param->getType();
            }
        }
        $cache[$class][$method] = $args;
        return $args;
    }
649802
public function parameterize($method)
    {
        $parameterArray = array();
        switch ($method) {
            case 'create':
                $parameterArray['token'] = $this->getToken();
                $parameterArray['client'] = $this->getClient();
                break;
            case 'delete':
                break;
            case 'getOne':
                $parameterArray['count'] = 1;
                $parameterArray['offset'] = 0;
                break;
            case 'getAll':
                $parameterArray = $this->getFilter();
                break;
        }

        return $parameterArray;
    }
611996
protected function getMethodArguments($methodName)
    {
        if (!empty($this->_magicMethodArgumentNames)) {
            return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
        }
        try {
            $reflectionClass = new \ReflectionClass($this);
            $comment = $reflectionClass->getDocComment();
            $lines = preg_split('/[\r\n]/', $comment);
            $regexp = '#\s*\*\s*@method ((?:.*) )?([a-zA-Z_]+)\(((?:[\\a-zA-Z]+\s+)?\$(?:[a-zA-Z_]+),?\s*)*\)#';

            foreach ($lines as $line) {
                $matches = [];
                if (preg_match($regexp, $line, $matches)) {
                    @list($null, $returnType, $method, $argumentString) = $matches;
                    if (is_null($argumentString)) {
                        $arguments = [];
                    } else {
                        $arguments = array_map('trim', explode(',', $argumentString));

                        foreach ($arguments as $k => $argument) {
                            if (empty($argument)) {
                                continue;
                            }
                            if (strpos($argument, ' ') !== false) {
                                $tmp = explode(' ', $argument);
                                $arguments[$k] = ['name' => ltrim($tmp[1], '$'), 'type' => $tmp[0]];
                            } else {
                                $arguments[$k] = ['name' => ltrim($argument, '$'), 'type' => 'mixed'];
                            }
                        }
                    }

                    $this->_magicMethodArgumentNames[$method] = $arguments;
                }
            }
        } catch (\ReflectionException $e) {

        }

        return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
    }
141139
public function getMappedMethod($method)
    {
        // Check if the method called is provided in the mapping.
        if (!array_key_exists($method, self::$validatorMapping)) {
            throw new Exception(sprintf(
                'Mapping for method "%s" not found, make sure it exists in the mapping file.',
                $method
            ));
        }

        return self::$validatorMapping[$method];
    }
1061566
public function getInMethod(string $method): array
    {
        if (isset($this->methodIndex[$method])) {
            return $this->methodIndex[$method];
        }

        return [];
    }
53445
private function getMethods($methods)
    {
        $methods = $methods ?? $this->methods;

        if (is_string($methods))
            $methods = (array) $methods;

        return is_array($methods) ? array_map('strtoupper', $methods) : [];
    }
443476
public function toArray($method)
    {
        $vars = get_object_vars($this);
        $className = explode('\\', get_called_class());
        return $vars + array('model' => end($className));
    }
99609
private function getMethodArguments(\ReflectionMethod $method)
    {
        // ignore all query params
        $params = $this->paramReader->getParamsFromMethod($method);

        // check if a parameter is coming from the request body
        $ignoreParameters = [];
        if (class_exists(ParamConverter::class)) {
            $ignoreParameters = array_map(function ($annotation) {
                return
                    $annotation instanceof ParamConverter &&
                    'fos_rest.request_body' === $annotation->getConverter()
                        ? $annotation->getName() : null;
            }, $this->annotationReader->getMethodAnnotations($method));
        }

        // ignore several type hinted arguments
        $ignoreClasses = [
            Request::class,
            ParamFetcherInterface::class,
            ConstraintViolationListInterface::class,
            ParamConverter::class,
            MessageInterface::class,
        ];

        $arguments = [];
        foreach ($method->getParameters() as $argument) {
            if (isset($params[$argument->getName()])) {
                continue;
            }

            $argumentClass = $argument->getClass();
            if ($argumentClass) {
                $className = $argumentClass->getName();
                foreach ($ignoreClasses as $class) {
                    if ($className === $class || is_subclass_of($className, $class)) {
                        continue 2;
                    }
                }
            }

            if (in_array($argument->getName(), $ignoreParameters, true)) {
                continue;
            }

            $arguments[] = $argument;
        }

        return $arguments;
    }
157582
public function parameterize($method)
    {
        $parameterArray = array();
        switch ($method) {
            case 'create':
                $parameterArray['amount'] = $this->getAmount();
                $parameterArray['currency'] = $this->getCurrency();
                $parameterArray['interval'] = $this->getInterval();
                $parameterArray['name'] = $this->getName();
                $parameterArray['trial_period_days'] = $this->getTrialPeriodDays();
                break;
            case 'update':
                if (!is_null($this->getUpdateSubscriptions())) {
                    $parameterArray['update_subscriptions'] = $this->getUpdateSubscriptions();
                }
                $parameterArray['name'] = $this->getName();
                $parameterArray['amount'] = $this->getAmount();
                $parameterArray['currency'] = $this->getCurrency();
                $parameterArray['interval'] = $this->getInterval();
                $parameterArray['trial_period_days'] = $this->getTrialPeriodDays();
                break;
            case 'getOne':
                $parameterArray['count'] = 1;
                $parameterArray['offset'] = 0;
                break;
            case 'getAll':
                $parameterArray = $this->getFilter();
                break;
            case 'delete':
                if (!is_null($this->getRemoveWithSubscriptions())) {
                    $parameterArray['remove_with_subscriptions'] = $this->getRemoveWithSubscriptions();
                }
                break;
        }

        return $parameterArray;
    }
940115
public function parameterize($method)
    {
        $parameterArray = parent::parameterize($method);

        if ('create' == $method) {
            if ($this->getCountry()) {
                $parametersArray['country'] = $this->getCountry();
            }

            if ($this->getClientEmail()) {
                $parametersArray['client_email'] = $this->getClientEmail();
            }

            if ($this->getBillingAddress()) {
                $parametersArray['billing_address'] = $this->getBillingAddress();
            }
        }

        return $parameterArray;
    }
92986
private static function guessArgs(\ReflectionMethod $method)
    {
        $arguments = [];
        foreach ($method->getParameters() as $index => $parameter) {
            if (!$parameter->hasType()) {
                throw new InvalidArgumentException(\sprintf('Argument n°%s "$%s" on method "%s" cannot be auto-guessed as there is not type hint.', $index + 1, $parameter->getName(), $method->getName()));
            }

            try {
                $gqlType = self::resolveGraphqlTypeFromReflectionType($parameter->getType(), self::$validInputTypes, $parameter->isDefaultValueAvailable());
            } catch (\Exception $e) {
                throw new InvalidArgumentException(\sprintf('Argument n°%s "$%s" on method "%s" cannot be auto-guessed : %s".', $index + 1, $parameter->getName(), $method->getName(), $e->getMessage()));
            }

            $argumentConfig = [];
            if ($parameter->isDefaultValueAvailable()) {
                $argumentConfig['defaultValue'] = $parameter->getDefaultValue();
            }

            $argumentConfig['type'] = $gqlType;

            $arguments[$parameter->getName()] = $argumentConfig;
        }

        return $arguments;
    }
58789
protected function renderMethodParameters($method)
    {
        $parameters = [];

        foreach ($method->getParameters() as $parameter) {
            if ($parameter->isPassedByReference()) {
                throw new InvalidArgumentException(sprintf(
                    'Parameter [%s] in %s->%s cannot declared as a reference.',
                    $parameter->getName(), $method->getDeclaringClass(), $method->getName()
                ));
            }

            $definition = $this->renderParameterTypeHint($parameter);
            $definition .= $parameter->isVariadic() ? '...' : '';
            $definition .= '$'.$parameter->getName();

            if (! $parameter->isVariadic()) {
                if ($parameter->isDefaultValueAvailable()) {
                    $definition .= ' = '.var_export($parameter->getDefaultValue(), true);
                } elseif ($parameter->isOptional()) {
                    $definition .= ' = null';
                }
            }

            $parameters[] = $definition;
        }

        return '('.implode(', ', $parameters).')';
    }
254210
public function getMethodPrefix($method)
    {
        $method = strtolower($method);

        return isset($this->methodPrefix[$method]) ? $this->methodPrefix[$method] : null;
    }