Issues

ZF-10182: Zend_Oauth_Client in your constructor should accepts array and object config.

Description

Big problem only the type hinting in constructor already that your code internal is prepared for this behavior.

See Zend_Oauth_Client line 82 the 84.


if ($oauthOptions instanceof Zend_Config) {
    $oauthOptions = $oauthOptions->toArray();
}

Comments

Fixed with r22650.

This is not fixed.

1) Update the docblock for the first parameter.

2) The third parameter supposedly supports both too, but when {{Zend_Config}} is supplied, it errors because it tries to access the config using array notation.


    /**
     * Constructor; creates a new HTTP Client instance which itself is
     * just a typical Zend_Http_Client subclass with some OAuth icing to
     * assist in automating OAuth parameter generation, addition and
     * cryptographioc signing of requests.
     *
     * @param  array $oauthOptions
     * @param  string $uri
     * @param  array|Zend_Config $config
     * @return void
     */
    public function __construct($oauthOptions, $uri = null, $config = null)
    {
        if (!isset($config['rfc3986_strict'])) {
            $config['rfc3986_strict'] = true;
        }

Here's a patch for you:


Index: Client.php
===================================================================
--- Client.php  (revision 8)
+++ Client.php  (working copy)
@@ -76,8 +76,13 @@
      */
     public function __construct($oauthOptions, $uri = null, $config = null)
     {
-        if (!isset($config['rfc3986_strict'])) {
-            $config['rfc3986_strict'] = true;
+        if ($config !== null) {
+            if ($config instanceof Zend_Config) {
+                $config = $config->toArray();
+            }
+            if (!isset($config['rfc3986_strict'])) {
+                $config['rfc3986_strict'] = true;
+            }
         }
         parent::__construct($uri, $config);
         $this->_config = new Zend_Oauth_Config;

Fix config http client how Zend_Config r24311.