Issues

ZF-11023: Zend_Service_Twitter constructor could not use Zend_Config

Issue Type: Bug Created: 2011-02-02T22:49:52.000+0000 Last Updated: 2011-02-17T06:40:51.000+0000 Status: Resolved Fix version(s): - 1.11.4 (03/Mar/11)

Reporter: Shinya Ohyanagi (heavenshell) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Service_Twitter

Related issues: Attachments:

Description

Hi.

Could Zend_Service_Twitter's constructor use Zend_Config? If $options is Zend_Config instance, it's seems to cast to an array.

<pre class="highlight">
public function __construct($options = null, Zend_Oauth_Consumer $consumer = null)
{
    $this->setUri('<a href="http://api.twitter.com">http://api.twitter.com</a>');
    if (!is_array($options)) $options = array();
    $options['siteUrl'] = self::OAUTH_BASE_URI;
    if ($options instanceof Zend_Config) {
        $options = $options->toArray();
    }
    $this->_options = $options;

If it's ok to use Zend_Config, constructor should be like this.

<pre class="highlight">
public function __construct($options = null, Zend_Oauth_Consumer $consumer = null)
{
    $this->setUri('<a href="http://api.twitter.com">http://api.twitter.com</a>');
-   if (!is_array($options)) $options = array();
-   $options['siteUrl'] = self::OAUTH_BASE_URI;
    if ($options instanceof Zend_Config) {
        $options = $options->toArray();
    }
+   if (!is_array($options)) $options = array();
+   $options['siteUrl'] = self::OAUTH_BASE_URI;

Regards.

Comments

Posted by Ramon Henrique Ornelas (ramon) on 2011-02-03T02:25:16.000+0000

This is bug and not a improvement.

Posted by Ramon Henrique Ornelas (ramon) on 2011-02-17T06:40:50.000+0000

Fixed in trunk r23698 merged to branch release 1.11 r23699.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts