Magento2SampleModule icon indicating copy to clipboard operation
Magento2SampleModule copied to clipboard

setup:di:compile error

Open sergei-sss opened this issue 9 years ago • 7 comments

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

sergei-sss avatar Dec 24 '15 07:12 sergei-sss

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

ryanicle avatar Apr 05 '16 09:04 ryanicle

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

tzyganu avatar Jun 29 '16 10:06 tzyganu

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.

deepanshu27193 avatar Jul 16 '16 12:07 deepanshu27193

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

tzyganu avatar Jul 21 '16 20:07 tzyganu

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

grasdaggel avatar Aug 31 '16 15:08 grasdaggel

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}

deepanshu27193 avatar Sep 01 '16 10:09 deepanshu27193

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

tzyganu avatar Sep 07 '16 07:09 tzyganu