tzyganu / Magento2SampleModule

This is where I would put a Magento 2.0 Sample CRUD module if I had one.
MIT License
158 stars 65 forks source link

setup:di:compile error #7

Open sergei-sss opened 8 years ago

sergei-sss commented 8 years ago

Hi Marius. If I run "bin/magento setup:di:compile", I get error: Fatal error: Cannot use Magento\Rss\Controller\Feed\Index as Index because the name is already in use in /var/www/mage203/app/code/Sample/News/Controller/Author/Rss.php on line 4

ryanicle commented 8 years ago

Try removing this line at line 4 in /var/www/mage203/app/code/Sample/News/Controller/Author/Rss.php: use Magento\Rss\Controller\Feed\Index;

Then replace the following: class Rss extends Index

with

class Rss extends \Magento\Rss\Controller\Feed\Index

tzyganu commented 8 years ago

@sergei-sss This issue should not exist in the new version.

deepanshu27193 commented 8 years ago

Issue still present in the latest code during compiling with latest Magento 2.1. As far as i came to know, @ryanicle suggestion is right and after that code is successfully complied also.

tzyganu commented 8 years ago

I wasn't able to reproduce the error. And I don't want to do that fix. I don't want to use fully qualified class names

grasdaggel commented 8 years ago

Could you elaborate why using short class names is better then use fully qualified class names?

deepanshu27193 commented 8 years ago

As far as i am getting with this, there may be a issue of php version also. Mine PHP 5.6 {Xdebug 2.4 Enabled}

tzyganu commented 8 years ago

@grasdaggel I don't think it's better to use short class names. But I believe in consistency.