alexdebril / rss-atom-bundle

RSS and Atom Bundle for Symfony
MIT License
139 stars 49 forks source link

Unable to inherit Debril\RssAtomBundle\Protocol\FeedOut::getItems() #27

Closed juuga closed 11 years ago

juuga commented 11 years ago

I've updated to the dev-master version (today on Oct 14). On my local machine I'm able to run my service which reads an RSS feed and loops through the items.

// $reader is the debril.reader service
$feed_content = $reader->getFeedContent($url, $date);

// the $content object contains as many Item instances as you have fresh articles in the feed
$items = $feed_content->getItems();

When I run my service on my local machine running php 5.4.10 everything is fine. When I run this code on my production server with php 5.3.3, I get a Fatal Error:

php app/console publisher:rss
PHP Fatal error:  Can't inherit abstract function Debril\RssAtomBundle\Protocol\FeedOut::getItems() (previously declared abstract in Debril\RssAtomBundle\Protocol\FeedIn) in /var/www/html/opp/vendor/debril/rss-atom-bundle/Debril/RssAtomBundle/Protocol/Parser/FeedContent.php on line 42

Fatal error: Can't inherit abstract function Debril\RssAtomBundle\Protocol\FeedOut::getItems() (previously declared abstract in Debril\RssAtomBundle\Protocol\FeedIn) in /var/www/html/opp/vendor/debril/rss-atom-bundle/Debril/RssAtomBundle/Protocol/Parser/FeedContent.php on line 42

Is there anything I can do to resolve this issue?

juuga commented 11 years ago

I currently have a hotfix in place. I commented out the FeedOut interface implementation. The class declaration looks like this for now:

class FeedContent implements FeedIn//, FeedOut
alexdebril commented 11 years ago

I think this is because getItems() is declared in both interfaces (which is not really good by the way). It is not a problem with PHP > 5.4 and some 5.3 versions but it is clearly an issue with PHP 5.3.3. I will install a Debian Squeeze to fix this.

Thank you for your bug report.

alexdebril commented 11 years ago

this should solve the problem : https://github.com/alexdebril/rss-atom-bundle/compare/issue-27

I will test the fix in a Debian Squeeze VM and come back to you after that.

alexdebril commented 11 years ago

I just tested the fix inside a Debian Squeeze, the last 1.2.12 release solves the issue

juuga commented 11 years ago

Thanks!