Question

I found that, "Magento 2, At its core is PSR-4 compliant".

Then I got into this: https://www.php-fig.org/psr/psr-4/

and the table at the bottom:

FULLY QUALIFIED CLASS NAME -> \Acme\Log\Writer\File_Writer

So I see from the most of Magento2 Code cases, that it uses:

use Magento\Catalog\Helper\Data;

shouldn't it be like :

use \Magento\Catalog\Helper\Data;

when it points to a class ?

and then when it comes to Constructors in Magento2 I can clearly see that this kind of syntax is used:

    \Magento\Catalog\Helper\Data;

Is used

mb I'm missing some core fundamentals but I'm curious about it :D

Was it helpful?

Solution

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top