PHP code example of looglecz / phpstan-magento2-extension

1. Go to this page and download the library: Download looglecz/phpstan-magento2-extension library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

looglecz / phpstan-magento2-extension example snippets




declare(strict_types=1);

namespace Vendor\Module\Model\ResourceModel\Element;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

/**
 * @extends AbstractCollection<\Vendor\Module\Model\Element>
 */
class Collection extends AbstractCollection
{
    protected function _construct()
    {
        $this->_init(
            \Vendor\Module\Model\Element::class,
            \Vendor\Module\Model\ResourceModel\Element::class
        );
    }
}