public static function create(array $config, $signer = null)
    {
        if (null === $signer) {
            $signer = new HmacSha1Signer();
        }

        if (! $signer instanceof SignerInterface) {
            throw new InvalidArgumentException('The signer must implement the \Risan\OAuth1\Signature\SignerInterface.');
        }

        $configFactory = new ConfigFactory();

        $protocolParameter = new ProtocolParameter(
            $configFactory->createFromArray($config),
            $signer,
            new NonceGenerator()
        );

        $authorizationHeader = new AuthorizationHeader($protocolParameter);

        $requestFactory = new RequestFactory($authorizationHeader, new UriParser());

        return new OAuth1(new HttpClient(), $requestFactory, new CredentialsFactory());
    }
public static function create(array $config, $signer = null)
    {
        if (null === $signer) {
            $signer = new HmacSha1Signer();
        }

        if (! $signer instanceof SignerInterface) {
            throw new InvalidArgumentException('The signer must implement the \Risan\OAuth1\Signature\SignerInterface.');
        }

        $configFactory = new ConfigFactory();

        $protocolParameter = new ProtocolParameter(
            $configFactory->createFromArray($config),
            $signer,
            new NonceGenerator()
        );

        $authorizationHeader = new AuthorizationHeader($protocolParameter);

        $requestFactory = new RequestFactory($authorizationHeader, new UriParser());

        return new OAuth1(new HttpClient(), $requestFactory, new CredentialsFactory());
    }
public static function create ( array $ config , $ signer = null ) { if ( null === $ signer ) { $ signer = new HmacSha1Signer ( ) ; } if ( ! $ signer instanceof SignerInterface ) { throw new InvalidArgumentException ( 'The signer must implement the \Risan\OAuth1\Signature\SignerInterface.' ) ; } $ configFactory = new ConfigFactory ( ) ; $ protocolParameter = new ProtocolParameter ( $ configFactory -> createFromArray ( $ config ) , $ signer , new NonceGenerator ( ) ) ; $ authorizationHeader = new AuthorizationHeader ( $ protocolParameter ) ; $ requestFactory = new RequestFactory ( $ authorizationHeader , new UriParser ( ) ) ; return new OAuth1 ( new HttpClient ( ) , $ requestFactory , new CredentialsFactory ( ) ) ; }
Create the new OAuth1Interface instance.

@param array                                        $config
@param \Risan\OAuth1\Signature\SignerInterface|null $signer

@return \Risan\OAuth1\OAuth1Interface
Create the new OAuth1Interface instance .