Skip to content

Commit

Permalink
Add PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentBean committed Feb 9, 2024
1 parent c791fc8 commit dfa9a0d
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 79 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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: Install dependencies
run: composer install --no-interaction

- name: Analyse
run: vendor/bin/phpstan analyse
52 changes: 2 additions & 50 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
70 changes: 43 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]"
}
],
"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": "[email protected]"
}
],
"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.justbetter.nl/mirror/magento"
}
},
"config": {
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": true
}
},
"require-dev": {
"bitexpert/phpstan-magento": "^0.11.0",
"phpstan/phpstan": "^1.10"
}
}
}
12 changes: 12 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -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#'
2 changes: 0 additions & 2 deletions src/Ui/DataProvider/CustomerPricing/Listing/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit dfa9a0d

Please sign in to comment.