pestle icon indicating copy to clipboard operation
pestle copied to clipboard

magento2:generate:class-child should resolve types on constructor or pull in use statements

Open astorm opened this issue 7 years ago • 1 comments

astorm avatar Jun 13 '17 21:06 astorm

<?php
namespace Pulsestorm\Helloworld\Block;

class Template extends \Magento\Framework\View\Element\Template
{
    function __construct(Template\Context $context, array $data = [])
    {
        parent::__construct($context,$data);
    }
}

See Template\Context? That's not going to work in this class unless a fully qualified name is used, or we pull in the same use statements as the parent constructor.

astorm avatar Jun 13 '17 21:06 astorm