Creates signature method instance from its configuration.
@param array $signatureMethodConfig signature method configuration.
@return signature\BaseMethod signature method instance.
177222
protected function createSignatureMethod(array $signatureMethodConfig)
    {
        if (!array_key_exists('class', $signatureMethodConfig)) {
            $signatureMethodConfig['class'] = signature\HmacSha1::className();
        }
        return Yii::createObject($signatureMethodConfig);
    }
752014
public function createFakeRow(array $fieldConfiguration, array $defaultValues = array()) {
        // TODO For now, filter primary keys, assuming they will be auto-generated by the database.
        $exclude = f\either(f\prop('primary'), f\prop_equals('origin', 'relation'));
        $configWithoutPks = f\filter(f\not($exclude), $fieldConfiguration);
        $self = $this;
        return f\reduce(
            function ($out, $field) use ($self) {
                $fieldName = $field['name'];
                if (array_key_exists($fieldName, $out)) {
                    return $out;
                }
                $out[$fieldName] = $self->getFakeValueForField($field);
                return $out;
            },
            $defaultValues,
            $configWithoutPks
        );
    }
309260
public function selectSignature($signature) {

        if ( !is_integer($signature) || !isset($this->signatures[$signature]) ) {

            throw new InvalidArgumentException("Invalid RpcMethod signature reference");

        }

        $this->current_signature = $signature;

        return $this;

    }
428828
public static function factory($config = array())
    {
        $defaults = array();

        $required = array(
            'base_url',
            'login',
            'password'
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $client = new self($config['base_url'], $config);

        return $client;
    }
40831
def _get_signature_method(self, request):
        """"""
        signature_method = request.get('oauth_signature_method')
        if signature_method is None:
            signature_method = SIGNATURE_METHOD

        try:
            # Get the signature method object.
            return self.signature_methods[signature_method]
        except KeyError:
            signature_method_names = ', '.join(self.signature_methods.keys())
            raise Error('Signature method %s not supported try one of the '
                        'following: %s'
                            % (signature_method, signature_method_names))
1279964
private function getSignatureMethod(&$request)
    {
        $signatureMethod = @$request->getParameter("oauth_signature_method");
        if (!$signatureMethod) {
            $signatureMethod = "PLAINTEXT";
        }
        if (!in_array(
            $signatureMethod,
            array_keys($this->signatureMethods)
        )
        ) {
            throw new Exception(
                "Signature method '$signatureMethod' not supported " .
                "try one of the following: " .
                implode(", ", array_keys($this->signatureMethods))
            );
        }
        return $this->signatureMethods[$signatureMethod];
    }
1110868
public function create(ClassReflection $classReflection, \ReflectionMethod $methodReflection, string $methodWrapper = null): MethodReflection
    {
        $phpDocParameterTypes = [];
        $phpDocReturnType = null;
        if ($methodReflection->getDocComment() !== false) {
            $phpDocBlock = PhpDocBlock::resolvePhpDocBlockForMethod(
                Broker::getInstance(),
                $methodReflection->getDocComment(),
                $methodReflection->getDeclaringClass()->getName(),
                $methodReflection->getName(),
                $methodReflection->getFileName()
            );

            $resolvedPhpDoc = $this->fileTypeMapper->getResolvedPhpDoc(
                $phpDocBlock->getFile(),
                $phpDocBlock->getClass(),
                $phpDocBlock->getDocComment()
            );
            $phpDocParameterTypes = array_map(function (ParamTag $tag): Type {
                return $tag->getType();
            }, $resolvedPhpDoc->getParamTags());
            $phpDocReturnType = $resolvedPhpDoc->getReturnTag() !== null ? $resolvedPhpDoc->getReturnTag()->getType() : null;
        }

        if ($methodWrapper) {
            $methodReflection = new $methodWrapper($methodReflection);
        }

        return $this->methodReflectionFactory->create(
            $classReflection,
            $methodReflection,
            $phpDocParameterTypes,
            $phpDocReturnType
        );
    }
490947
private function getSignatureMethod($request)
    {
        $signature_method = $request instanceof Request
            ? $request->getParameter("oauth_signature_method")
            : null;

        if (!$signature_method) {
            // According to chapter 7 ("Accessing Protected Ressources") the signature-method
            // parameter is required, and we can't just fallback to PLAINTEXT
            throw new Exception('No signature method parameter. This parameter is required');
        }

        if (!in_array(
            $signature_method,
            array_keys($this->signature_methods)
        )) {
            throw new Exception(
                "Signature method '$signature_method' not supported " .
                "try one of the following: " .
                implode(", ", array_keys($this->signature_methods))
            );
        }
        return $this->signature_methods[$signature_method];
    }
94896
public function setSignatureMethod($signatureMethod)
    {
        if (!is_object($signatureMethod) && !is_array($signatureMethod)) {
            throw new InvalidParamException('"' . get_class($this) . '::signatureMethod" should be instance of "\yii\autclient\signature\BaseMethod" or its array configuration. "' . gettype($signatureMethod) . '" has been given.');
        }
        $this->_signatureMethod = $signatureMethod;
    }
457142
protected function buildMethod(ReflectionMethod $reflectionMethod) : Node\Stmt\ClassMethod
    {
        $methodBuilder = new Method($reflectionMethod->getName());

        if ($reflectionMethod->isPublic()) {
            $methodBuilder->makePublic();
        }

        if ($reflectionMethod->isProtected()) {
            $methodBuilder->makeProtected();
        }

        if ($reflectionMethod->isPrivate()) {
            $methodBuilder->makePrivate();
        }

        if ($reflectionMethod->isStatic()) {
            $methodBuilder->makeStatic();
        }

        if ($reflectionMethod->isAbstract()) {
            $methodBuilder->makeAbstract();
        }

        if ($reflectionMethod->isFinal()) {
            $methodBuilder->makeFinal();
        }

        if ($reflectionMethod->returnsReference()) {
            $methodBuilder->makeReturnByRef();
        }

        foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
            $methodBuilder->addParam($this->buildParameter($reflectionParameter));
        }

        // @todo should parse method body if possible (skipped for now)

        return $methodBuilder->getNode();
    }
1035638
protected function getORMCompilerPass(array $config)
    {
        $nameSpace = 'Gesdinet\JWTRefreshTokenBundle\Entity';
        $mappings = array(
            realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-orm') => $nameSpace,
        );

        if (isset($config['refresh_token_class']) || isset($config['refresh_token_entity'])) {
            $mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-superclass')] = $nameSpace;
        } else {
            $mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-entity')] = $nameSpace;
        }

        return DoctrineOrmMappingsPass::createYamlMappingDriver($mappings);
    }
712529
public function getSignatureByReflectionClass(\ReflectionClass $reflectionClass, $methodName)
    {
        $className = $reflectionClass->getName();
        return $this->getMethodSignature($className, $methodName, $reflectionClass);
    }
269447
public function generate($method, $url, array $data = [], array $headers = [], $basicAuthCredentials = '')
    {
        $signatureParts = [$method, $url];
        $signatureParts[] = http_build_query($data);
        $signatureParts[] = http_build_query($headers);
        $signatureParts[] = $basicAuthCredentials;

        return implode('|', $signatureParts);
    }
943560
public function loadDependenciesByReflectionMethod(ReflectionMethod $reflectionMethod)
    {

        // initialize the array for the dependencies
        $dependencies = array();

        // load the object manager instance
        /** @var \AppserverIo\Psr\Di\ObjectManagerInterface $objectManager */
        $objectManager = $this->getNamingDirectory()->search(
            sprintf('php:global/%s/%s', $this->getApplication()->getUniqueName(), ObjectManagerInterface::IDENTIFIER)
        );

        // iterate over the constructor parameters
        /** @var \AppserverIo\Lang\Reflection\ParameterInterface $reflectionParameter */
        foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
            $dependencies[] = $this->get($objectManager->getPreference($reflectionParameter->getType()));
        }

        // return the initialized dependencies
        return $dependencies;
    }
80699
static function ByCreationMethod($name)
    {
        $enumClass = new \ReflectionClass(get_class());
        $calledClass = get_called_class();
        $reflectionClass = new \ReflectionClass($calledClass);
        $methods = $reflectionClass->getMethods(\ReflectionMethod::IS_STATIC);
        foreach ($methods as $method)
        {
            if ($method->name != $name)
                continue;
            
            if ($method->isPublic() && $method->getNumberOfParameters() == 0)
            {
                if (!$enumClass->hasMethod($method->name))
                {
                    $result = $method->invoke(null);
                    if (get_class($result) == $calledClass)
                        return $result;
                }
            }
        }
        throw new \InvalidArgumentException("'Creation method '$name' not found");
    }
44317
protected function getSignatureMethod(&$request)
    {
        $signature_method =
            @$request->getParameter("oauth_signature_method");
        
        if (!$signature_method) {
            // According to chapter 7 ("Accessing Protected Ressources") the signature-method
            // parameter is required, and we can't just fallback to PLAINTEXT
            throw new OAuthException('No signature method parameter. This parameter is required');
        }
        
        if (!in_array($signature_method,
            array_keys($this->signature_methods))
        ) {
            throw new OAuthException(
                "Signature method '$signature_method' not supported " .
                "try one of the following: " .
                implode(", ", array_keys($this->signature_methods))
            );
        }
        
        return $this->signature_methods[ $signature_method ];
    }
400159
protected function buildMethod(ReflectionMethod $method)
    {
        $argString = "";
        $paramString = "";
        foreach ($method->getParameters() as $value) {
            $argString .= "\${$value->getName()}, ";
            $paramString .= $this->getParamString($value);
        }

        $argString = trim($argString, ", ");
        $paramString = trim($paramString, ", ");
        $replaces = array(
            $method->getDocComment(),
            $method->getName(),
            $paramString,
            $argString
        );
        return str_replace(self::$methodTplSearches, $replaces, $this->template->getMethodTemplate());
    }