Skip to content
Permalink
Browse files

Merge branch 'next-4467/introduce-psalm' into 'master'

NEXT-4467 - Introduce psalm static code analysis

See merge request shopware/6/product/platform!118
  • Loading branch information...
janbuecker committed Sep 3, 2019
2 parents c6355d6 + 712458c commit e88907c752352f625c3d29434e54450c3c2e9719
Showing with 373 additions and 325 deletions.
  1. +5 −4 .gitlab-ci.yml
  2. +0 −84 bin/generate-composer.php
  3. BIN bin/php-cs-fixer.phar
  4. BIN bin/phpstan.phar
  5. +0 −102 bin/pre-commit
  6. +6 −1 composer.json
  7. +11 −6 phpstan.neon
  8. +168 −0 psalm.xml
  9. +1 −2 src/Core/Checkout/Cart/Event/CheckoutOrderPlacedEvent.php
  10. +1 −2 src/Core/Checkout/Customer/Event/CustomerRegisterEvent.php
  11. +2 −1 src/Core/Checkout/Test/Cart/Order/RecalculationServiceTest.php
  12. +12 −6 src/Core/Content/MailTemplate/Subscriber/MailSendSubscriber.php
  13. +1 −1 src/Core/Content/Media/Exception/StrategyNotFoundException.php
  14. +1 −1 src/Core/Content/Media/MediaType/MediaType.php
  15. +1 −2 src/Core/Content/Newsletter/Event/NewsletterConfirmEvent.php
  16. +1 −2 src/Core/Content/Newsletter/Event/NewsletterRegisterEvent.php
  17. +1 −2 src/Core/Content/Newsletter/Event/NewsletterUpdateEvent.php
  18. +3 −3 src/Core/Framework/DataAbstractionLayer/DefinitionValidator.php
  19. +1 −1 src/Core/Framework/DataAbstractionLayer/Field/Field.php
  20. +8 −4 src/Core/Framework/DataAbstractionLayer/FieldSerializer/ListFieldSerializer.php
  21. +1 −1 src/Core/Framework/DataAbstractionLayer/Search/Parser/AggregationParser.php
  22. +15 −23 src/Core/Framework/DataAbstractionLayer/Write/Command/WriteCommandQueue.php
  23. +22 −10 src/Core/Framework/DataAbstractionLayer/Write/EntityWriter.php
  24. +1 −1 src/Core/Framework/Event/MailActionInterface.php
  25. +9 −0 src/Core/Framework/Plugin/Exception/ExceptionCollection.php
  26. +3 −3 src/Core/Framework/Plugin/PluginService.php
  27. +33 −0 src/Core/Framework/Test/Update/Checkers/MysqlVersionCheckTest.php
  28. +2 −2 src/Core/Framework/Update/Checkers/CheckerInterface.php
  29. +1 −2 src/Core/Framework/Update/Checkers/MysqlVersionCheck.php
  30. +1 −2 src/Core/Framework/Update/Checkers/PhpVersionCheck.php
  31. +2 −2 src/Core/Framework/Update/Struct/ValidationResult.php
  32. +1 −33 src/Core/Kernel.php
  33. +17 −17 src/Core/Profiling/Twig/DoctrineExtension.php
  34. +0 −1 src/Core/composer.json
  35. +37 −0 src/Docs/Resources/platform-updates/2019-09-04-tool-refactoring.md
  36. +3 −4 src/Storefront/Framework/Seo/SeoUrlPersister.php
  37. +2 −0 src/Storefront/composer.json
@@ -62,12 +62,13 @@ Javascript analyze:

PHP analyze:
stage: Static analyzes
before_script: []
script:
- composer install --no-interaction --optimize-autoloader --no-suggest --no-scripts
- php bin/phpstan.phar analyze --level 5 --configuration phpstan.neon src
- php bin/php-cs-fixer.phar fix --dry-run -v --allow-risky=yes --format=junit src | tee php-cs-fixer.xml
- php bin/generate-composer.php
- composer install --no-interaction --optimize-autoloader --no-suggest --working-dir=dev-ops/analyze
- php dev-ops/analyze/generate-composer.php
- php dev-ops/analyze/vendor/bin/php-cs-fixer fix --config=vendor/shopware/platform/.php_cs.dist --dry-run --format=junit | tee php-cs-fixer.xml
- php dev-ops/analyze/vendor/bin/phpstan analyze --configuration vendor/shopware/platform/phpstan.neon
- php dev-ops/analyze/vendor/bin/psalm --config=vendor/shopware/platform/psalm.xml --threads=2 --show-info=false
artifacts:
reports:
junit: php-cs-fixer.xml

This file was deleted.

BIN -1.67 MB bin/php-cs-fixer.phar
Binary file not shown.
BIN -4.55 MB bin/phpstan.phar
Binary file not shown.

This file was deleted.

@@ -101,7 +101,6 @@
"bheller/images-generator": "1.0.1",
"fzaninotto/faker": "1.8.0",
"johnkary/phpunit-speedtrap": "3.1.0",
"kubawerlos/php-cs-fixer-custom-fixers": "1.15.1",
"league/flysystem-memory": "1.0.2",
"mbezhanov/faker-provider-collection": "1.2.1",
"phpunit/phpunit": "8.3.4",
@@ -124,6 +123,12 @@
"Shopware\\Core\\": "src/Core/",
"Shopware\\Elasticsearch\\": "src/Elasticsearch/"
},
"files": [
"src/Core/Flag/feature_next733.php",
"src/Core/Flag/feature_next741.php",
"src/Core/Flag/feature_next1797.php",
"src/Core/Flag/feature_next3722.php"
],
"exclude-from-classmap": [
"src/**/Test/"
]
@@ -1,15 +1,20 @@
parameters:
level: 5
paths:
- %currentWorkingDirectory%/vendor/shopware/platform/src
inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: false
excludes_analyse:
- %rootDir%/../src/**/*Test.php
- %rootDir%/../src/**/Test/**/_fixture/feature_*.php
- %rootDir%/../src/Core/TestBootstrap.php
- %rootDir%/../src/Core/Flag/feature_*.php
- %rootDir%/../src/Docs/Resources/current/2-internals/1-core/50-checkout-process/_examples/10-cart-example.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/Core/Flag/feature_*.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/Docs/Resources/current/2-internals/1-core/50-checkout-process/_examples/10-cart-example.php
# Tests
- %currentWorkingDirectory%/vendor/shopware/platform/src/**/*Test.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/**/Test/**/_fixture/feature_*.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/Core/TestBootstrap.php
ignoreErrors:
# https://github.com/phpstan/phpstan/issues/1060
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface::(variableNode|scalarNode|end|integerNode|booleanNode)\(\)\.#'
- '#Shopware\\Core\\Framework\\DataAbstractionLayer\\CompiledFieldCollection::__construct\(\) does not call parent constructor from Shopware\\Core\\Framework\\Struct\\Collection.#'
- '#[F,f]unction Flag\\.* not found\.$#'
- '#Access to an undefined property Faker\\Generator::\$[^.]+\.#'
# For BC with Symfony 4
- '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required\.#'

0 comments on commit e88907c

Please sign in to comment.
You can’t perform that action at this time.