Skip to content

Commit

Permalink
Phpstan level 1
Browse files Browse the repository at this point in the history
  • Loading branch information
convenient committed Nov 7, 2022
1 parent 701b71a commit a018fee
Show file tree
Hide file tree
Showing 12 changed files with 4,213 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dev/instances/magento*
dev/vendor/
dev/phpunit/functional/.phpunit.result.cache
dev/phpunit/unit/.phpunit.result.cache
dev/phpstan/vendor
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ install:
- composer install
# Run static analysis tests before trying to install the modules in magento
- composer test:static
- composer test:phpstan
# Run unit tests before trying to install magento
- composer test:unit
- if [[ $TEST_GROUP = m22 ]]; then rm -rf composer.lock ./vendor/ ; fi # todo ensure all 22 test cases are covered in 24
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"scripts": {
"test:static:fix": " vendor/bin/phpcbf --standard=dev/phpcs.xml && vendor/bin/php-cs-fixer fix --diff",
"test:static": "vendor/bin/phpcs --standard=dev/phpcs.xml -s && vendor/bin/php-cs-fixer fix --diff --dry-run",
"test:phpstan": "dev/phpstan/run.sh",
"test:unit": "vendor/bin/phpunit -c dev/phpunit/unit/phpunit.xml --verbose"
}
}
4 changes: 0 additions & 4 deletions dev/phpstan.neon

This file was deleted.

5 changes: 5 additions & 0 deletions dev/phpstan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
We cannot require dev `magento/framework` into the main tools vendor directory.

This is because it affects the composer autoloading, and this affects the running of the phpunit functional tests.

Because we're only bundling this in for phpstan, silo it off to keep the tool running as-is.
25 changes: 25 additions & 0 deletions dev/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "ampersand/magento2-upgrade-patch-helper-phpstan-dev-deps",
"description": "Phpstan dev dependencies, so they do not mess with the autoloader of the actual tooling which is very important",
"repositories": [
{
"type": "composer",
"url": "https://repo-magento-mirror.fooman.co.nz/"
}
],
"authors": [
{
"name": "Luke Rodgers",
"email": "[email protected]"
}
],
"require-dev": {
"magento/framework": "*",
"phpstan/phpstan": "^1.9"
},
"config": {
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": false
}
}
}
Loading

0 comments on commit a018fee

Please sign in to comment.