Issues

ZF-10243: Zend_Gdata_App, using $this when not in object context

Issue Type: Bug Created: 2010-07-28T15:57:39.000+0000 Last Updated: 2013-02-13T17:38:15.000+0000 Status: Resolved Fix version(s): - 1.12.2 (25/Feb/13)

Reporter: Alexander Steshenko (lcf) Assignee: Frank Brückner (frosch) Tags: - Zend_Gdata

Related issues: Attachments: - App.php.patch

Description

Zend_Gdata_App, line 728

<pre class="highlight">
    public static function import($uri, $client = null,
        $className='Zend_Gdata_App_Feed')
    {
        $app = new Zend_Gdata_App($client);
        $requestData = $app->prepareRequest('GET', $uri);
        $response = $app->performHttpRequest(
            $requestData['method'], $requestData['url']);

        $feedContent = $response->getBody();
        if (!$this->_useObjectMapping) {
            return $feedContent;
        }
        $feed = self::importString($feedContent, $className);
        if ($client != null) {
            $feed->setHttpClient($client);
        }
        return $feed;
    }

This static function has $this inside.

Actually it's my IDE which highlighted the file as containing errors and I don't know when exactly this function is called and if it's really needed, but it just looks so wrong.

Perhaps it works with 5.2 php version, with > 5.3 such a function will cause fatal error.

Comments

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-07-28T18:39:56.000+0000

By the way, please someone unittest this...

Posted by Frank Brückner (frosch) on 2013-01-18T08:08:47.000+0000

Patch and unit test added.

Posted by Frank Brückner (frosch) on 2013-02-13T17:38:15.000+0000

Fixed on trunk (25258) and release-1.12 (25259)

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