diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e5a5c860..5c2a3fd9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -87,9 +87,11 @@ jobs: matrix: include: - php-version: '8.2' - typo3-version: '^13.2' + typo3-version: '^13.4' - php-version: '8.3' - typo3-version: '^13.2' + typo3-version: '^13.4' + - php-version: '8.4' + typo3-version: '^13.4' steps: - uses: actions/checkout@v4 @@ -126,9 +128,15 @@ jobs: - name: Run Unit Tests PHP8.3 run: nix-shell --arg phpVersion \"php83\" --pure --run project-test-unit + - name: Run Unit Tests PHP8.4 + run: nix-shell --arg phpVersion \"php84\" --pure --run project-test-unit + - name: Run Functional Tests PHP8.2 run: nix-shell --arg phpVersion \"php82\" --pure --run project-test-functional - name: Run Functional Tests PHP8.3 run: nix-shell --arg phpVersion \"php83\" --pure --run project-test-functional + - name: Run Functional Tests PHP8.4 + run: nix-shell --arg phpVersion \"php84\" --pure --run project-test-functional + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86b46709..50fc0431 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -65,6 +65,11 @@ lint:php83: variables: CONTAINER_IMAGE: php:8.3-alpine +lint:php84: + <<: *lint_php + variables: + CONTAINER_IMAGE: php:8.4-alpine + phpstan:analyse: image: $CI_REGISTRY/containers/phpunit-with-php-8.2:main stage: lint @@ -94,19 +99,26 @@ phpstan:analyse: - .build/bin/phpunit -c Build/UnitTests.xml - typo3DatabaseDriver=pdo_sqlite .build/bin/phpunit -c Build/FunctionalTests.xml -# Build in PHP 8.2 and TYPO3 13.3 +# Build in PHP 8.2 and TYPO3 13.4 test:php82:typo3_13: <<: *test_php variables: CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.2:main - TYPO3_VERSION: ^13.3 + TYPO3_VERSION: ^13.4 -# Build in PHP 8.3 and TYPO3 13.2 +# Build in PHP 8.3 and TYPO3 13.4 test:php83:typo3_13: <<: *test_php variables: CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.3:main - TYPO3_VERSION: ^13.3 + TYPO3_VERSION: ^13.4 + +# Build in PHP 8.4 and TYPO3 13.4 +test:php84:typo3_13: + <<: *test_php + variables: + CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.4:main + TYPO3_VERSION: ^13.4 documentation: stage: documentation diff --git a/Classes/Controller/Cart/CartController.php b/Classes/Controller/Cart/CartController.php index 5c9699e7..68281c0d 100755 --- a/Classes/Controller/Cart/CartController.php +++ b/Classes/Controller/Cart/CartController.php @@ -23,9 +23,9 @@ class CartController extends ActionController { public function showAction( - Item $orderItem = null, - BillingAddress $billingAddress = null, - ShippingAddress $shippingAddress = null + ?Item $orderItem = null, + ?BillingAddress $billingAddress = null, + ?ShippingAddress $shippingAddress = null ): ResponseInterface { $this->restoreSession(); diff --git a/Classes/Controller/Cart/OrderController.php b/Classes/Controller/Cart/OrderController.php index bf2226c3..fb01571d 100644 --- a/Classes/Controller/Cart/OrderController.php +++ b/Classes/Controller/Cart/OrderController.php @@ -57,9 +57,9 @@ public function initializeCreateAction(): void #[IgnoreValidation(['value' => 'shippingAddress'])] public function createAction( - Item $orderItem = null, - BillingAddress $billingAddress = null, - ShippingAddress $shippingAddress = null + ?Item $orderItem = null, + ?BillingAddress $billingAddress = null, + ?ShippingAddress $shippingAddress = null ): ResponseInterface { $this->restoreSession(); diff --git a/Classes/Controller/Cart/ProductController.php b/Classes/Controller/Cart/ProductController.php index f3eca424..2950a1d6 100644 --- a/Classes/Controller/Cart/ProductController.php +++ b/Classes/Controller/Cart/ProductController.php @@ -14,7 +14,6 @@ use Extcode\Cart\Domain\Model\Cart\Product; use Extcode\Cart\Event\CheckProductAvailabilityEvent; use Extcode\Cart\Event\RetrieveProductsFromRequestEvent; -use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Messaging\AbstractMessage; use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; @@ -24,14 +23,6 @@ class ProductController extends ActionController { public const AJAX_CART_TYPE_NUM = '2278001'; - public function __construct( - EventDispatcherInterface $eventDispatcher = null - ) { - if ($eventDispatcher !== null) { - $this->eventDispatcher = $eventDispatcher; - } - } - public function addAction(): ResponseInterface { if (!$this->request->hasArgument('productType')) { diff --git a/Classes/Domain/Model/Cart/BeVariant.php b/Classes/Domain/Model/Cart/BeVariant.php index 43fd6300..0fff53a3 100644 --- a/Classes/Domain/Model/Cart/BeVariant.php +++ b/Classes/Domain/Model/Cart/BeVariant.php @@ -13,10 +13,6 @@ class BeVariant { - protected ?Product $product = null; - - protected ?BeVariant $parentBeVariant = null; - protected string $titleDelimiter = ' - '; protected string $skuDelimiter = '-'; @@ -45,30 +41,13 @@ class BeVariant public function __construct( protected string $id, - Product $product = null, - self $beVariant = null, + protected self|Product $parent, protected string $title, protected string $sku, protected int $priceCalcMethod, protected float $price, protected int $quantity = 0 ) { - if ($product === null && $beVariant === null) { - throw new \InvalidArgumentException(); - } - - if ($product != null && $beVariant != null) { - throw new \InvalidArgumentException(); - } - - if ($product !== null) { - $this->product = $product; - } - - if ($beVariant !== null) { - $this->parentBeVariant = $beVariant; - } - $this->reCalc(); } @@ -102,36 +81,28 @@ public function toArray(): array return $variantArr; } - public function getProduct(): ?Product + public function getParent(): self|Product { - return $this->product; + return $this->parent; } - public function setProduct(Product $product): void + public function setParent(self|Product $parent): void { - $this->product = $product; + $this->parent = $parent; } - public function getParentBeVariant(): ?self + public function getProduct(): Product { - return $this->parentBeVariant; - } + if ($this->parent instanceof Product) { + return $this->parent; + } - public function setParentBeVariant(self $parentBeVariant): void - { - $this->parentBeVariant = $parentBeVariant; + return $this->parent->getProduct(); } public function isNetPrice(): bool { - if ($this->getParentBeVariant()) { - return $this->getParentBeVariant()->isNetPrice(); - } - if ($this->getProduct()) { - return $this->getProduct()->isNetPrice(); - } - - return false; + return $this->parent->isNetPrice(); } public function getId(): string @@ -158,10 +129,10 @@ public function getCompleteTitle(): string { $title = ''; - if ($this->getParentBeVariant()) { - $title = $this->getParentBeVariant()->getCompleteTitle(); - } elseif ($this->getProduct()) { - $title = $this->getProduct()->getTitle(); + if ($this->parent instanceof self) { + $title = $this->parent->getCompleteTitle(); + } elseif ($this->parent instanceof Product) { + $title = $this->parent->getTitle(); } if ($this->isFeVariant) { @@ -178,8 +149,8 @@ public function getCompleteTitleWithoutProduct(): string $title = ''; $titleDelimiter = ''; - if ($this->getParentBeVariant()) { - $title = $this->getParentBeVariant()->getCompleteTitleWithoutProduct(); + if ($this->parent instanceof self) { + $title = $this->parent->getCompleteTitleWithoutProduct(); $titleDelimiter = $this->titleDelimiter; } @@ -244,12 +215,12 @@ public function getPriceCalculated(): float { $price = $this->getBestPrice(); - if ($this->getParentBeVariant()) { - $parentPrice = $this->getParentBeVariant()->getBestPrice(); - } elseif ($this->getProduct()) { - $parentPrice = $this->getProduct()->getBestPrice($this->getQuantity()); + if ($this->parent instanceof self) { + $parentPrice = $this->parent->getBestPrice(); + } elseif ($this->parent instanceof Product) { + $parentPrice = $this->parent->getBestPrice($this->getQuantity()); } else { - $parentPrice = 0; + $parentPrice = 0.0; } if ($this->priceCalcMethod === 0) { @@ -285,15 +256,11 @@ public function getParentPrice(): float return 0.0; } - if ($this->getParentBeVariant()) { - return $this->getParentBeVariant()->getBestPrice(); + if ($this->parent instanceof self) { + return $this->parent->getBestPrice(); } - if ($this->getProduct()) { - return $this->getProduct()->getBestPrice($this->getQuantity()); - } - - return 0.0; + return $this->parent->getBestPrice($this->getQuantity()); } public function setPrice(float $price): void @@ -332,10 +299,10 @@ public function getCompleteSku(): string { $sku = ''; - if ($this->getParentBeVariant()) { - $sku = $this->getParentBeVariant()->getCompleteSku(); - } elseif ($this->getProduct()) { - $sku = $this->getProduct()->getSku(); + if ($this->parent instanceof self) { + $sku = $this->parent->getCompleteSku(); + } elseif ($this->parent instanceof Product) { + $sku = $this->parent->getSku(); } if ($this->isFeVariant) { @@ -353,8 +320,8 @@ public function getCompleteSkuWithoutProduct(): string $skuDelimiter = ''; - if ($this->getParentBeVariant()) { - $sku = $this->getParentBeVariant()->getCompleteSkuWithoutProduct(); + if ($this->parent instanceof self) { + $sku = $this->parent->getCompleteSkuWithoutProduct(); $skuDelimiter = $this->titleDelimiter; } @@ -416,14 +383,7 @@ public function getTax(): float public function getTaxClass(): ?TaxClass { - if ($this->getParentBeVariant()) { - return $this->getParentBeVariant()->getTaxClass(); - } - if ($this->getProduct()) { - return $this->getProduct()->getTaxClass(); - } - - return null; + return $this->parent->getTaxClass(); } public function setQuantity(int $newQuantity): void diff --git a/Classes/Domain/Model/Cart/Cart.php b/Classes/Domain/Model/Cart/Cart.php index 915929ab..3fe4589f 100644 --- a/Classes/Domain/Model/Cart/Cart.php +++ b/Classes/Domain/Model/Cart/Cart.php @@ -1111,7 +1111,7 @@ public function setCurrencySign(string $currencySign): void $this->currencySign = $currencySign; } - public function translatePrice(float $price = null): ?float + public function translatePrice(?float $price = null): ?float { if ($price !== null) { $price /= $this->getCurrencyTranslation(); diff --git a/Classes/Domain/Model/Cart/Extra.php b/Classes/Domain/Model/Cart/Extra.php index 25756c12..7fd67f37 100644 --- a/Classes/Domain/Model/Cart/Extra.php +++ b/Classes/Domain/Model/Cart/Extra.php @@ -31,7 +31,7 @@ public function __construct( protected TaxClass $taxClass, protected bool $isNetPrice = false, protected string $extraType = '', - Service $service = null + ?Service $service = null ) { $this->service = $service; diff --git a/Classes/Domain/Model/Cart/Product.php b/Classes/Domain/Model/Cart/Product.php index 5095ac41..36a29a89 100644 --- a/Classes/Domain/Model/Cart/Product.php +++ b/Classes/Domain/Model/Cart/Product.php @@ -69,7 +69,7 @@ public function __construct( protected TaxClass $taxClass, protected int $quantity, protected bool $isNetPrice = false, - FeVariant $feVariant = null + ?FeVariant $feVariant = null ) { if ($feVariant) { $this->feVariant = $feVariant; @@ -130,7 +130,7 @@ public function addBeVariant(BeVariant $newVariant): void $variant->setQuantity($newQuantity); } } else { - $newVariant->setProduct($this); + $newVariant->setParent($this); $this->beVariants[$newVariantsId] = $newVariant; } @@ -275,7 +275,7 @@ public function getQuantityDiscounts(): array return $this->quantityDiscounts; } - public function getQuantityDiscountPrice(int $quantity = null): float + public function getQuantityDiscountPrice(?int $quantity = null): float { $price = $this->getTranslatedPrice(); @@ -300,7 +300,7 @@ public function setQuantityDiscounts(array $quantityDiscounts): void /** * Returns Best Price (min of Price and Special Price) */ - public function getBestPrice(int $quantity = null): ?float + public function getBestPrice(?int $quantity = null): ?float { $bestPrice = $this->getQuantityDiscountPrice($quantity); diff --git a/Classes/EventListener/Order/Create/PersistOrder/Products.php b/Classes/EventListener/Order/Create/PersistOrder/Products.php index cbd3536b..b23992ff 100644 --- a/Classes/EventListener/Order/Create/PersistOrder/Products.php +++ b/Classes/EventListener/Order/Create/PersistOrder/Products.php @@ -95,7 +95,7 @@ protected function addProductVariants(Product $product): void protected function addFeVariants( \Extcode\Cart\Domain\Model\Order\Product $product, - FeVariant $feVariant = null + ?FeVariant $feVariant = null ): void { if ($feVariant) { $feVariantsData = $feVariant->getVariantData(); @@ -141,20 +141,7 @@ protected function addVariantsOfVariant(BeVariant $variant, int $level): void protected function addBeVariant(BeVariant $variant, int $level): void { - $variantInner = $variant; - for ($count = $level; $count > 0; $count--) { - if ($count > 1) { - $variantInner = $variantInner->getParentBeVariant(); - } else { - $cartProduct = $variantInner->getProduct(); - } - } - unset($variantInner); - - if (!isset($cartProduct)) { - // ToDo Add Error Message - return; - } + $cartProduct = $variant->getProduct(); $orderProduct = GeneralUtility::makeInstance( \Extcode\Cart\Domain\Model\Order\Product::class @@ -193,11 +180,7 @@ protected function addBeVariant(BeVariant $variant, int $level): void $orderProduct->addProductAdditional($orderProductAdditional); - if ($count > 1) { - $variantInner = $variantInner->getParentBeVariant(); - } else { - $cartProduct = $variantInner->getProduct(); - } + $variantInner = $variantInner->getParent(); } unset($variantInner); diff --git a/Classes/Service/TaxClassService.php b/Classes/Service/TaxClassService.php index 3a54beac..d44279d4 100644 --- a/Classes/Service/TaxClassService.php +++ b/Classes/Service/TaxClassService.php @@ -33,7 +33,7 @@ public function __construct( /** * @return TaxClass[] */ - public function getTaxClasses(string $countryCode = null): array + public function getTaxClasses(?string $countryCode = null): array { $taxClasses = []; $taxClassSettings = $this->settings['taxClasses']; diff --git a/Classes/Service/TaxClassServiceInterface.php b/Classes/Service/TaxClassServiceInterface.php index e1c20143..beb280c6 100644 --- a/Classes/Service/TaxClassServiceInterface.php +++ b/Classes/Service/TaxClassServiceInterface.php @@ -18,5 +18,5 @@ interface TaxClassServiceInterface /** * @return TaxClass[] */ - public function getTaxClasses(string $countryCode = null): array; + public function getTaxClasses(?string $countryCode = null): array; } diff --git a/Classes/ViewHelpers/FieldNameViewHelper.php b/Classes/ViewHelpers/FieldNameViewHelper.php index 6e2475bd..b4593272 100644 --- a/Classes/ViewHelpers/FieldNameViewHelper.php +++ b/Classes/ViewHelpers/FieldNameViewHelper.php @@ -55,11 +55,12 @@ protected function getVariantFieldName(BeVariant $variant): string { $fieldName = ''; - if ($variant->getParentBeVariant()) { - $fieldName .= $this->getVariantFieldName($variant->getParentBeVariant()); + if ($variant->getParent() instanceof BeVariant) { + $fieldName .= $this->getVariantFieldName($variant->getParent()); } - if ($variant->getProduct()) { - $fieldName .= '[' . $variant->getProduct()->getId() . ']'; + + if ($variant->getParent() instanceof Product) { + $fieldName .= '[' . $variant->getParent()->getId() . ']'; } $fieldName .= '[' . $variant->getId() . ']'; diff --git a/Documentation/Changelog/10.0/Breaking-611-ChangePhpDependency.rst b/Documentation/Changelog/10.0/Breaking-611-ChangePhpDependency.rst new file mode 100644 index 00000000..eea1c0db --- /dev/null +++ b/Documentation/Changelog/10.0/Breaking-611-ChangePhpDependency.rst @@ -0,0 +1,33 @@ +.. include:: ../../Includes.rst.txt + +================================================= +Breaking: #611 - Change BeVariant Parent Handling +================================================= + +See `Issue 611 `__ + +Description +=========== + +Previously, a `BeVariant` had either another `BeVariant` or a `Product` as its parent element. These were passed in the +constructor method. + +Thanks to PHP's union types, this can now be resolved. A `BeVariant` now has a `$parent` that is either of type +`BeVariant` or of type `Product`. + +The individual methods have been adapted accordingly and it is checked of which class `$parent` is an instance. In some +cases, the case differentiation could be omitted completely. + +Affected Installations +====================== + +All product extensions that use their own `BeVariant` in the products are affected. The provided extensions +extcode/cart-products and extcode/cart-events will be adapted accordingly. + +Migration +========= + +If a custom product extension is used, the constructor must be adapted accordingly. Furthermore, a few +methods in `BeVariant` have been replaced or their behavior adapted. + +.. index:: API diff --git a/Documentation/Changelog/10.0/Index.rst b/Documentation/Changelog/10.0/Index.rst new file mode 100644 index 00000000..f1afa74d --- /dev/null +++ b/Documentation/Changelog/10.0/Index.rst @@ -0,0 +1,20 @@ +.. include:: ../../Includes.rst.txt + +10.0 Changes +============ + +**Table of contents** + +.. contents:: + :local: + :depth: 1 + +Breaking +-------- + +.. toctree:: + :maxdepth: 1 + :titlesonly: + :glob: + + Breaking-* diff --git a/Documentation/Changelog/9.3/Breaking-611-ChangePhpDependency.rst b/Documentation/Changelog/9.3/Breaking-611-ChangePhpDependency.rst new file mode 100644 index 00000000..fb7896f0 --- /dev/null +++ b/Documentation/Changelog/9.3/Breaking-611-ChangePhpDependency.rst @@ -0,0 +1,30 @@ +.. include:: ../../Includes.rst.txt + +====================================== +Breaking: #611 - Change PHP Dependency +====================================== + +See `Issue 611 `__ + +Description +=========== + +Tests with newer versions of phpstan under newer php versions showed that the +constructor method `\Extcode\Cart\Domain\Model\Cart\BeVariant::__construct()` uses +required method parameters after optional parameters. This is deprecated since. +PHP 8.0. (see https://php.watch/versions/8.0/deprecate-required-param-after-optional) + +As this may lead to an error in a later PHP version, compatibility is restricted +to PHP 8.1-8.4. + +Affected Installations +====================== + +All installations. + +Migration +========= + +This restriction currently has no effect. No migration is necessary. + +.. index:: API diff --git a/Documentation/Changelog/9.3/Index.rst b/Documentation/Changelog/9.3/Index.rst new file mode 100644 index 00000000..5c3b1691 --- /dev/null +++ b/Documentation/Changelog/9.3/Index.rst @@ -0,0 +1,20 @@ +.. include:: ../../Includes.rst.txt + +9.3 Changes +=========== + +**Table of contents** + +.. contents:: + :local: + :depth: 1 + +Breaking +-------- + +.. toctree:: + :maxdepth: 1 + :titlesonly: + :glob: + + Breaking-* diff --git a/Documentation/Changelog/Index.rst b/Documentation/Changelog/Index.rst index 256f5ffe..93a2c69a 100644 --- a/Documentation/Changelog/Index.rst +++ b/Documentation/Changelog/Index.rst @@ -10,6 +10,8 @@ ChangeLog :maxdepth: 5 :titlesonly: + 10.0/Index + 9.3/Index 9.1/Index 9.0/Index 8.5/Index diff --git a/Documentation/guides.xml b/Documentation/guides.xml index ad995743..39dfb9f7 100644 --- a/Documentation/guides.xml +++ b/Documentation/guides.xml @@ -11,8 +11,8 @@ interlink-shortcode="extcode/cart" /> diff --git a/README.md b/README.md index be5b4ec6..16823602 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ Sometimes minor versions also result in minor adjustments to own templates or co | Cart | TYPO3 | PHP | Support/Development | |--------|------------|-----------|--------------------------------------| -| 10.x.x | 13.0 | 8.2+ | Features, Bugfixes, Security Updates | -| 9.x.x | 12.4 | 8.1+ | Bugfixes, Security Updates | +| 10.x.x | 13.4 | 8.2 - 8.4 | Features, Bugfixes, Security Updates | +| 9.x.x | 12.4 | 8.1 - 8.4 | Bugfixes, Security Updates | | 8.x.x | 10.4, 11.5 | 7.2+ | Security Updates | | 7.x.x | 10.4 | 7.2 - 7.4 | | | 6.x.x | 9.5 | 7.2 - 7.4 | | diff --git a/Tests/Unit/Domain/Model/Cart/BeVariantTest.php b/Tests/Unit/Domain/Model/Cart/BeVariantTest.php index dd255dde..70734a85 100644 --- a/Tests/Unit/Domain/Model/Cart/BeVariantTest.php +++ b/Tests/Unit/Domain/Model/Cart/BeVariantTest.php @@ -68,7 +68,6 @@ public function setUp(): void $this->beVariant = new BeVariant( $this->id, $this->product, - null, $this->title, $this->sku, $this->priceCalcMethod, @@ -181,40 +180,6 @@ public function getQuantityReturnsQuantitySetByConstructor(): void ); } - #[Test] - public function constructVariantWithoutCartProductOrVariantThrowsInvalidArgumentException(): void - { - $this->expectException(\InvalidArgumentException::class); - - new BeVariant( - $this->id, - null, - null, - $this->sku, - $this->title, - $this->priceCalcMethod, - $this->price, - $this->quantity - ); - } - - #[Test] - public function constructVariantWithCartProductAndVariantThrowsInvalidArgumentException(): void - { - $this->expectException(\InvalidArgumentException::class); - - new BeVariant( - $this->id, - $this->product, - $this->beVariant, - $this->sku, - $this->title, - $this->priceCalcMethod, - $this->price, - $this->quantity - ); - } - #[Test] public function constructWithoutTitleThrowsException(): void { @@ -224,7 +189,6 @@ public function constructWithoutTitleThrowsException(): void 1, $this->product, null, - null, 'test-variant-sku', 0, 1.0, @@ -240,7 +204,6 @@ public function constructWithoutSkuThrowsException(): void new BeVariant( 1, $this->product, - null, 'Test Variant', null, 0, @@ -257,7 +220,6 @@ public function constructWithoutQuantityThrowsException(): void new BeVariant( 1, $this->product, - null, 'Test Variant', 'test-variant-sku', 0, @@ -448,7 +410,6 @@ public function getParentPriceRespectsTheQuantityDiscountsOfProductsForEachVaria $beVariant1 = new BeVariant( '1', $this->product, - null, $title, $sku, $priceCalcMethod, @@ -460,7 +421,6 @@ public function getParentPriceRespectsTheQuantityDiscountsOfProductsForEachVaria $beVariant2 = new BeVariant( '2', $this->product, - null, $title, $sku, $priceCalcMethod, @@ -472,7 +432,6 @@ public function getParentPriceRespectsTheQuantityDiscountsOfProductsForEachVaria $beVariant3 = new BeVariant( '3', $this->product, - null, $title, $sku, $priceCalcMethod, diff --git a/Tests/Unit/Service/AbstractConfigurationFromTypoScriptServiceTest.php b/Tests/Unit/Service/AbstractConfigurationFromTypoScriptServiceTest.php index 8b92cf09..25a0c5eb 100644 --- a/Tests/Unit/Service/AbstractConfigurationFromTypoScriptServiceTest.php +++ b/Tests/Unit/Service/AbstractConfigurationFromTypoScriptServiceTest.php @@ -180,7 +180,7 @@ public function getTypeZonePluginSettingsReturnsTypeZoneSettings(): void private function createSubject(array $configurations) { - $configurationManager = $this->createStub(ConfigurationManagerInterface::class); + $configurationManager = self::createStub(ConfigurationManagerInterface::class); $configurationManager->method('getConfiguration')->willReturn($configurations); return new class ($configurationManager, new ServiceFactory()) extends AbstractConfigurationFromTypoScriptService {}; diff --git a/Tests/Unit/Service/TaxClassServiceTest.php b/Tests/Unit/Service/TaxClassServiceTest.php index 1b9bcf48..80996f99 100644 --- a/Tests/Unit/Service/TaxClassServiceTest.php +++ b/Tests/Unit/Service/TaxClassServiceTest.php @@ -243,13 +243,13 @@ public function parsingTaxClassesFromTypoScriptWithIntegerZeroAsCalcIsValid(): v private function createSubject(array $settings): TaxClassService { - $configurationManager = $this->createStub(ConfigurationManagerInterface::class); + $configurationManager = self::createStub(ConfigurationManagerInterface::class); $configurationManager->method('getConfiguration')->willReturn($settings); return new TaxClassService( $configurationManager, new TaxClassFactory( - $this->createStub(LoggerInterface::class) + self::createStub(LoggerInterface::class) ) ); } diff --git a/composer.json b/composer.json index e1148762..8c5a6533 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ } }, "require": { - "php": "^8.2", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "ext-json": "*", "ext-openssl": "*", "typo3/cms-core": "^13.4", diff --git a/ext_emconf.php b/ext_emconf.php index c6c27ed7..a82622c2 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,7 +11,10 @@ 'author_company' => 'extco.de UG (haftungsbeschränkt)', 'constraints' => [ 'depends' => [ + 'php' => '8.1.0-8.4.99', 'typo3' => '13.4.0-13.4.99', + 'extbase' => '13.4.0-13.4.99', + 'fluid' => '13.4.0-13.4.99', ], 'conflicts' => [], 'suggests' => [], diff --git a/rector.php b/rector.php index 54b60925..2c72b1d6 100644 --- a/rector.php +++ b/rector.php @@ -40,7 +40,7 @@ ConvertImplicitVariablesToExplicitGlobalsRector::class, ]) ->withConfiguredRule(ExtEmConfRector::class, [ - ExtEmConfRector::PHP_VERSION_CONSTRAINT => '8.2.0-8.3.99', + ExtEmConfRector::PHP_VERSION_CONSTRAINT => '8.2.0-8.4.99', ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '13.4.0-13.4.99', ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [], ])