diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml new file mode 100644 index 0000000..1e9dcbe --- /dev/null +++ b/.github/workflows/analyse.yml @@ -0,0 +1,28 @@ +name: analyse + +on: ['push', 'pull_request'] + +jobs: + test: + runs-on: ubuntu-latest + name: PHPStan + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + coverage: none + + - name: Repository Credentials + run: composer config http-basic.repo.magento.com ${{ secrets.MAGENTO_REPO_USERNAME }} ${{ secrets.MAGENTO_REPO_PASSWORD }} + + - name: Install dependencies + run: composer install --no-interaction + + - name: Analyse + run: vendor/bin/phpstan analyse diff --git a/.gitignore b/.gitignore index b24d71e..7579f74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,50 +1,2 @@ -# These are some examples of commonly ignored file patterns. -# You should customize this list as applicable to your project. -# Learn more about .gitignore: -# https://www.atlassian.com/git/tutorials/saving-changes/gitignore - -# Node artifact files -node_modules/ -dist/ - -# Compiled Java class files -*.class - -# Compiled Python bytecode -*.py[cod] - -# Log files -*.log - -# Package files -*.jar - -# Maven -target/ -dist/ - -# JetBrains IDE -.idea/ - -# Unit test reports -TEST*.xml - -# Generated by MacOS -.DS_Store - -# Generated by Windows -Thumbs.db - -# Applications -*.app -*.exe -*.war - -# Large media files -*.mp4 -*.tiff -*.avi -*.flv -*.mov -*.wmv - +vendor +composer.lock diff --git a/composer.json b/composer.json index b62e185..d69903b 100644 --- a/composer.json +++ b/composer.json @@ -1,31 +1,47 @@ { - "name": "justbetter/magento2-customer-pricing", - "description": "Customer specific pricing module for Magento 2", - "keywords": [ - "magento", - "magento2", - "pricing" - ], - "type": "magento2-module", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Vincent Boon", - "email": "vincent@justbetter.nl" - } - ], - "require": { - "ext-json": "*", - "magento/module-catalog": "*" - }, - "autoload": { - "files": [ - "registration.php" + "name": "justbetter/magento2-customer-pricing", + "description": "Customer specific pricing module for Magento 2", + "keywords": [ + "magento", + "magento2", + "pricing" + ], + "type": "magento2-module", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Vincent Boon", + "email": "vincent@justbetter.nl" + } ], - "psr-4": { - "JustBetter\\CustomerPricing\\": "src" + "require": { + "ext-json": "*", + "magento/module-catalog": "*", + "magento/module-eav": "*" + }, + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "JustBetter\\CustomerPricing\\": "src" + } + }, + "repositories": { + "magento": { + "type": "composer", + "url": "https://repo.magento.com" + } + }, + "config": { + "allow-plugins": { + "magento/composer-dependency-version-audit-plugin": true + } + }, + "require-dev": { + "bitexpert/phpstan-magento": "^0.11.0", + "phpstan/phpstan": "^1.10" } - } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..9a78d5b --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,12 @@ +includes: + - vendor/bitexpert/phpstan-magento/extension.neon + +parameters: + paths: + - src + level: 1 + ignoreErrors: + - '#JustBetter\\CustomerPricing\\Model\\ResourceModel\\CustomerPricing\\CollectionFactory#' + - '#JustBetter\\CustomerPricing\\Model\\ResourceModel\\CustomerPricingFactory#' + - '#JustBetter\\CustomerPricing\\Model\\CustomerPricingFactory#' + - '#Magento\\Eav\\Setup\\EavSetupFactory#' diff --git a/src/Ui/DataProvider/CustomerPricing/Listing/Collection.php b/src/Ui/DataProvider/CustomerPricing/Listing/Collection.php index e4d3c59..31fc1b1 100644 --- a/src/Ui/DataProvider/CustomerPricing/Listing/Collection.php +++ b/src/Ui/DataProvider/CustomerPricing/Listing/Collection.php @@ -2,7 +2,6 @@ namespace JustBetter\CustomerPricing\Ui\DataProvider\CustomerPricing\Listing; -use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\Data\Collection\EntityFactoryInterface; use Magento\Framework\Event\ManagerInterface; @@ -20,7 +19,6 @@ public function __construct( $resourceModel, $identifierName = null, $connectionName = null, - AbstractDb $resource = null ) { parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel, $identifierName, $connectionName); }