Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: composer install --prefer-dist --no-progress --no-suggest

- name: Coding Guideline
run: vendor/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./
run: ./.build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./

code-quality:
runs-on: ubuntu-latest
Expand All @@ -74,12 +74,14 @@ jobs:
- name: Install dependencies with expected TYPO3 version
run: |-
composer remove --dev ssch/typo3-rector \
&& composer require typo3/cms-install "*" \
&& composer install --no-progress --no-ansi --no-interaction

- name: Code Quality (by PHPStan)
run: vendor/bin/phpstan analyse -c Build/phpstan.neon
- name: Build codeception tester
run: .build/bin/codecept build

- name: Code Quality (by PHPStan)
run: ./.build/bin/phpstan analyse -c Build/phpstan.neon

test-unit-and-functional:
runs-on: ubuntu-latest
needs:
Expand All @@ -90,7 +92,7 @@ jobs:

- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
nix_path: nixpkgs=channel:nixos-26.05

- name: Run Unit Tests PHP8.2
run: nix-shell --arg phpVersion \"php82\" --pure --run project-test-unit
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.build
composer.lock
var

.php-cs-fixer.cache
.phplint.cache
Expand All @@ -10,8 +11,5 @@ Documentation/_make
.DS_Store
.idea

var/
vendor/

phpunit.coverage.xml
phpunit.report.xml
5 changes: 5 additions & 0 deletions Build/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
(new PhpCsFixer\Finder())
->ignoreVCSIgnored(true)
->in(__DIR__ . '/../')
->exclude(
[
'var/',
]
)
)
->setRiskyAllowed(true)
->setRules([
Expand Down
30 changes: 0 additions & 30 deletions Build/UnitTests.xml

This file was deleted.

40 changes: 0 additions & 40 deletions Build/phpmd-ruleset.xml

This file was deleted.

199 changes: 199 additions & 0 deletions Build/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
parameters:
ignoreErrors:
-
message: '#^Method Extcode\\CartBooks\\Domain\\Model\\Book\:\:getBestSpecialPrice\(\) has parameter \$frontendUserGroupIds with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../Classes/Domain/Model/Book.php

-
message: '#^Method Extcode\\CartBooks\\Domain\\Model\\Book\:\:getSpecialPrices\(\) return type with generic class TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage does not specify its types\: TEntity$#'
identifier: missingType.generics
count: 1
path: ../Classes/Domain/Model/Book.php

-
message: '#^Method Extcode\\CartBooks\\Domain\\Model\\Book\:\:setSpecialPrices\(\) has parameter \$specialPrices with generic class TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage but does not specify its types\: TEntity$#'
identifier: missingType.generics
count: 1
path: ../Classes/Domain/Model/Book.php

-
message: '#^Binary operation "\+\=" between mixed and int results in an error\.$#'
identifier: assignOp.invalid
count: 1
path: ../Classes/EventListener/CheckProductAvailability.php

-
message: '#^Cannot cast mixed to int\.$#'
identifier: cast.int
count: 4
path: ../Classes/EventListener/RetrieveProductsFromRequest.php

-
message: '#^Method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:checkRequestArguments\(\) has parameter \$requestArguments with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../Classes/EventListener/RetrieveProductsFromRequest.php

-
message: '#^Method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:checkRequestArguments\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../Classes/EventListener/RetrieveProductsFromRequest.php

-
message: '#^Method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:getCartProductFromBook\(\) has parameter \$taxClasses with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../Classes/EventListener/RetrieveProductsFromRequest.php

-
message: '#^Parameter \#1 \$book of method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:getCartProductFromBook\(\) expects Extcode\\CartBooks\\Domain\\Model\\Book, TYPO3\\CMS\\Extbase\\DomainObject\\DomainObjectInterface\|null given\.$#'
identifier: argument.type
count: 1
path: ../Classes/EventListener/RetrieveProductsFromRequest.php

-
message: '#^Parameter \#2 \$productId of class Extcode\\Cart\\Domain\\Model\\Cart\\Product constructor expects int, int\<1, max\>\|null given\.$#'
identifier: argument.type
count: 1
path: ../Classes/EventListener/RetrieveProductsFromRequest.php

-
message: '#^Parameter \#6 \$taxClass of class Extcode\\Cart\\Domain\\Model\\Cart\\Product constructor expects Extcode\\Cart\\Domain\\Model\\Cart\\TaxClass, mixed given\.$#'
identifier: argument.type
count: 1
path: ../Classes/EventListener/RetrieveProductsFromRequest.php

-
message: '#^Cannot access offset ''cart'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 2
path: ../Classes/EventListener/View/ModifyView.php

-
message: '#^Cannot access offset ''pid'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 2
path: ../Classes/EventListener/View/ModifyView.php

-
message: '#^Parameter \#1 \$key of method Extcode\\Cart\\Service\\SessionHandler\:\:restoreCart\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: ../Classes/EventListener/View/ModifyView.php

-
message: '#^Parameter \#1 \$key of method Extcode\\Cart\\Service\\SessionHandler\:\:writeCart\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: ../Classes/EventListener/View/ModifyView.php

-
message: '#^Property Extcode\\CartBooks\\EventListener\\View\\ModifyView\:\:\$cartConfiguration type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../Classes/EventListener/View/ModifyView.php

-
message: '#^Cannot call method getAuthor\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: ../Classes/ViewHelpers/SchemaViewHelper.php

-
message: '#^Cannot call method getPrice\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: ../Classes/ViewHelpers/SchemaViewHelper.php

-
message: '#^Cannot call method getTitle\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: ../Classes/ViewHelpers/SchemaViewHelper.php

-
message: '#^Method Extcode\\CartBooks\\ViewHelpers\\SchemaViewHelper\:\:render\(\) should return string but returns string\|false\.$#'
identifier: return.type
count: 1
path: ../Classes/ViewHelpers/SchemaViewHelper.php

-
message: '#^Cannot access an offset on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php

-
message: '#^Cannot access offset ''columns'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php

-
message: '#^Cannot access offset ''config'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php

-
message: '#^Cannot access offset ''items'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php

-
message: '#^Cannot access offset ''product_type'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php

-
message: '#^Cannot access offset ''tx_cart_domain_model_order_product'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php

-
message: '#^Parameter \#1 \$dataSet of method Codappix\\Typo3PhpDatasets\\PhpDataSet\:\:import\(\) expects array\<string, array\<array\<string, string\>\>\>, mixed given\.$#'
identifier: argument.type
count: 1
path: ../Tests/Acceptance/Support/Environment.php

-
message: '#^Property Extcode\\CartBooks\\Tests\\Acceptance\\Support\\Environment\:\:\$localConfig type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../Tests/Acceptance/Support/Environment.php

-
message: '#^Cannot access an offset on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../ext_localconf.php

-
message: '#^Cannot access offset ''SYS'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../ext_localconf.php

-
message: '#^Cannot access offset ''cartbooks'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../ext_localconf.php

-
message: '#^Cannot access offset ''fluid'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../ext_localconf.php

-
message: '#^Cannot access offset ''namespaces'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../ext_localconf.php
33 changes: 30 additions & 3 deletions Build/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
includes:
- 'phpstan-baseline.neon'

parameters:
level: 4
level: 'max'

paths:
- ../Classes
- ../Configuration
- ../Tests
- ../ext_emconf.php
- ../ext_localconf.php
excludePaths:
- ../Tests/Acceptance
- '../Tests/Acceptance/Support/_generated/TesterActions.php'

disallowedFunctionCalls:
-
function:
- 'var_dump()'
- 'xdebug_break()'
message: 'Do not add debugging'
-
function: 'header()'
message: 'Use API instead'

disallowedStaticCalls:
-
method: 'TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()'
message: 'Do not add debugging'

disallowedSuperglobals:
-
superglobal:
- '$_GET'
- '$_POST'
- '$_FILES'
- '$_SERVER'
message: 'Use API instead'
Loading
Loading