Skip to content

Commit

Permalink
[TASK] Raise TYPO3 version and dependencies
Browse files Browse the repository at this point in the history
Relates: #583
  • Loading branch information
extcode committed Oct 16, 2024
1 parent cb2a245 commit 0eae841
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 91 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
strategy:
matrix:
php-version:
- 8.1
- 8.2
- 8.3
steps:
Expand Down Expand Up @@ -71,7 +70,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
php-version: "8.2"
tools: composer:v2

- name: Install dependencies
Expand All @@ -87,12 +86,10 @@ jobs:
strategy:
matrix:
include:
- php-version: '8.1'
typo3-version: '^12.4'
- php-version: '8.2'
typo3-version: '^12.4'
typo3-version: '^13.2'
- php-version: '8.3'
typo3-version: '^12.4'
typo3-version: '^13.2'
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -121,18 +118,12 @@ jobs:
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Run Unit Tests PHP8.1
run: nix-shell --pure --run project-test-unit

- name: Run Unit Tests PHP8.2
run: nix-shell --arg phpVersion \"php82\" --pure --run project-test-unit

- name: Run Unit Tests PHP8.3
run: nix-shell --arg phpVersion \"php83\" --pure --run project-test-unit

- name: Run Functional Tests PHP8.1
run: nix-shell --pure --run project-test-functional

- name: Run Functional Tests PHP8.2
run: nix-shell --arg phpVersion \"php82\" --pure --run project-test-functional

Expand Down
38 changes: 12 additions & 26 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ stages:
- analysis

lint:cgl:
image: $CI_REGISTRY/containers/phpunit-with-php-8.1:main
image: $CI_REGISTRY/containers/phpunit-with-php-8.2:main
stage: lint
before_script:
- composer remove typo3/cms-core --no-update
Expand Down Expand Up @@ -54,13 +54,7 @@ lint:yaml:
stage: lint
image: $CONTAINER_IMAGE
script:
- find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

lint:php81:
<<: *lint_php
stage: lint
variables:
CONTAINER_IMAGE: php:8.1-alpine
- find *.php Classes Configuration Tests

lint:php82:
<<: *lint_php
Expand All @@ -73,10 +67,10 @@ lint:php83:
CONTAINER_IMAGE: php:8.3-alpine

phpstan:analyse:
image: $CI_REGISTRY/containers/phpunit-with-php-8.1:main
image: $CI_REGISTRY/containers/phpunit-with-php-8.2:main
stage: lint
before_script:
- composer config platform.php 8.1
- composer config platform.php 8.2
- composer install --no-progress --no-ansi --no-interaction
script:
- .build/bin/phpstan analyse -c Build/phpstan.neon --memory-limit 256M
Expand Down Expand Up @@ -112,28 +106,20 @@ phpstan:analyse:
expire_in: 1 day
when: always

# Build in PHP 8.1 and TYPO3 12.4
test:php81:typo3_12:
<<: *test_php
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.1:main
TYPO3_VERSION: ^12.4
COVERAGE: 0

# Build in PHP 8.2 and TYPO3 12.4
test:php82:typo3_12:
# Build in PHP 8.2 and TYPO3 13.3
test:php82:typo3_13:
<<: *test_php
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.2:main
TYPO3_VERSION: ^12.4
TYPO3_VERSION: ^13.3
COVERAGE: 0

# Build in PHP 8.3 and TYPO3 12.4
test:php83:typo3_12:
# Build in PHP 8.3 and TYPO3 13.2
test:php83:typo3_13:
<<: *test_php
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.3:main
TYPO3_VERSION: ^12.4
TYPO3_VERSION: ^13.3
COVERAGE: 1

documentation:
Expand Down Expand Up @@ -163,7 +149,7 @@ sonarqube:
SONAR_SOURCES: "./Classes"
SONAR_GITLAB_PROJECT_ID: "$CI_PROJECT_ID"
script:
- echo "sonar.projectKey=cart-9.x" > sonar-project.properties
- echo "sonar.projectKey=cart-10.x" > sonar-project.properties
- gitlab-sonar-scanner -Dsonar.php.coverage.reportPath=phpunit.coverage.xml -Dsonar.php.tests.reportPath=phpunit.report.xml
allow_failure: true

Expand All @@ -179,5 +165,5 @@ sonarqube-reports:
SONAR_SOURCES: "./Classes"
SONAR_TESTS: "./Tests"
script:
- echo "sonar.projectKey=cart-9.x" > sonar-project.properties
- echo "sonar.projectKey=cart-10.x" > sonar-project.properties
- gitlab-sonar-scanner -Dsonar.php.coverage.reportPath=phpunit.coverage.xml -Dsonar.php.tests.reportPath=phpunit.report.xml
5 changes: 2 additions & 3 deletions Classes/Controller/Backend/Order/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/

use Extcode\Cart\Controller\Backend\ActionController;
use Extcode\Cart\Domain\Model\Cart\Cart;
use Extcode\Cart\Domain\Model\Order\Item;
Expand All @@ -20,8 +19,8 @@
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Imaging\IconSize;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Pagination\SimplePagination;
Expand Down Expand Up @@ -159,7 +158,7 @@ private function setDocHeader(array $buttons): void

foreach ($buttons as $button) {
$title = $this->getLanguageService()->sL(self::LANG_FILE . $button['title']);
$icon = $this->iconFactory->getIcon($button['icon'], Icon::SIZE_SMALL);
$icon = $this->iconFactory->getIcon($button['icon'], IconSize::SMALL->value);

$viewButton = $buttonBar->makeLinkButton()
->setHref($button['link'])
Expand Down
4 changes: 2 additions & 2 deletions Classes/Controller/Cart/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@

class OrderController extends ActionController
{
protected function getErrorFlashMessage(): ?string
protected function getErrorFlashMessage(): bool|string
{
return LocalizationUtility::translate(
'tx_cart.error.validation',
'Cart'
);
) ?? false;
}

public function initializeCreateAction(): void
Expand Down
10 changes: 5 additions & 5 deletions Classes/Domain/Model/Cart/TaxClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* LICENSE file that was distributed with this source code.
*/

final class TaxClass implements TaxClassInterface
final readonly class TaxClass implements TaxClassInterface
{
public function __construct(
private readonly int $id,
private readonly string $value,
private readonly float $calc,
private readonly string $title
private int $id,
private string $value,
private float $calc,
private string $title
) {}

public function getId(): int
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Cart/TaxClassFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

use Psr\Log\LoggerInterface;

final class TaxClassFactory implements TaxClassFactoryInterface
final readonly class TaxClassFactory implements TaxClassFactoryInterface
{
public function __construct(
private readonly LoggerInterface $logger
private LoggerInterface $logger
) {}

public function getTaxClass(int $taxClassKey, array $taxClassValue): ?TaxClass
Expand Down
6 changes: 3 additions & 3 deletions Classes/Event/Cart/UpdateCountryEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
use Extcode\Cart\Domain\Model\Cart\Cart;
use TYPO3\CMS\Extbase\Mvc\Request;

final class UpdateCountryEvent implements UpdateCountryEventInterface
final readonly class UpdateCountryEvent implements UpdateCountryEventInterface
{
public function __construct(
private readonly Cart $cart,
private readonly Request $request
private Cart $cart,
private Request $request
) {}

public function getCart(): Cart
Expand Down
8 changes: 4 additions & 4 deletions Classes/Event/Cart/UpdateCurrencyEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
use Extcode\Cart\Domain\Model\Cart\Cart;
use TYPO3\CMS\Extbase\Mvc\Request;

final class UpdateCurrencyEvent implements UpdateCurrencyEventInterface
final readonly class UpdateCurrencyEvent implements UpdateCurrencyEventInterface
{
public function __construct(
private readonly Cart $cart,
private readonly Request $request,
private readonly array $settings = []
private Cart $cart,
private Request $request,
private array $settings = []
) {}

public function getCart(): Cart
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Cart Products

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5b5b6e0c8ac143c381026061abf3c9e8)](https://www.codacy.com/app/extcode/cart?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=extcode/cart&amp;utm_campaign=Badge_Grade)
![GitHub Actions](https://github.com/extcode/cart/actions/workflows/ci.yaml/badge.svg?branch=10.x-dev)

The extension is a small but powerful extension which "solely" adds a shopping cart to your TYPO3 installation and is
well suited for content commerce.
Expand Down Expand Up @@ -45,17 +48,18 @@ Sometimes minor versions also result in minor adjustments to own templates or co

## 3.1 Compatibility and supported Versions

| Cart | TYPO3 | PHP | Support/Development |
|-------|------------|-----------|--------------------------------------|
| 9.x.x | 12.0 | 8.1+ | Features, Bugfixes, Security Updates |
| 8.x.x | 10.4, 11.5 | 7.2+ | Features, Bugfixes, Security Updates |
| 7.x.x | 10.4 | 7.2 - 7.4 | Security Updates |
| 6.x.x | 9.5 | 7.2 - 7.4 | |
| 5.x.x | 8.7 | 7.0 - 7.4 | |
| 4.x.x | 7.6 - 8.7 | 5.6 - 7.2 | |
| 3.x.x | 6.2 - 8.7 | 5.6 - 7.0 | |
| 2.x.x | | | |
| 1.x.x | | | |
| 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 |
| 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 | |
| 5.x.x | 8.7 | 7.0 - 7.4 | |
| 4.x.x | 7.6 - 8.7 | 5.6 - 7.2 | |
| 3.x.x | 6.2 - 8.7 | 5.6 - 7.0 | |
| 2.x.x | | | |
| 1.x.x | | | |

If you need extended support for features and bug fixes outside of the currently supported versions,
we are happy to offer paid services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
use Extcode\Cart\Event\Mail\AttachmentEvent;
use Extcode\Cart\EventListener\Mail\AttachmentFromOrderItem;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\EventDispatcher\ListenerProvider;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

class AttachmentFromOrderItemTest extends FunctionalTestCase
Expand All @@ -28,6 +30,10 @@ class AttachmentFromOrderItemTest extends FunctionalTestCase
public function setUp(): void
{
parent::setUp();

$GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())
->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE);

$this->importPHPDataSet(__DIR__ . '/../../../Fixtures/BaseDatabase.php');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
use Extcode\Cart\Event\Mail\AttachmentEvent;
use Extcode\Cart\EventListener\Mail\AttachmentFromTypoScript;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\EventDispatcher\ListenerProvider;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
Expand All @@ -30,6 +32,10 @@ class AttachmentFromTypoScriptTest extends FunctionalTestCase
public function setUp(): void
{
parent::setUp();

$GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())
->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE);

$this->importPHPDataSet(__DIR__ . '/../../../Fixtures/BaseDatabase.php');
}

Expand Down
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,21 @@
}
},
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"ext-openssl": "*",
"typo3/cms-core": "^12.4",
"typo3/cms-extbase": "^12.4",
"typo3/cms-fluid": "^12.4",
"typo3/cms-form": "^12.4"
"typo3/cms-core": "^13.4",
"typo3/cms-extbase": "^13.4",
"typo3/cms-fluid": "^13.4",
"typo3/cms-form": "^13.4"
},
"require-dev": {
"codappix/typo3-php-datasets": "^1.5",
"friendsofphp/php-cs-fixer": "^3.16",
"phpstan/phpstan": "^1.10",
"sbuerk/typo3-cmscomposerinstallers-testingframework-bridge": "^0.0.1",
"ssch/typo3-rector": "^2.6",
"typo3/cms-dashboard": "^12.4",
"typo3/testing-framework": "^8.0"
"friendsofphp/php-cs-fixer": "^3.64",
"phpstan/phpstan": "^1.12",
"ssch/typo3-rector": "^2.9",
"typo3/cms-dashboard": "^13.4",
"typo3/testing-framework": "^8.2"
},
"scripts": {
"test:cgl": [
Expand All @@ -85,10 +84,10 @@
".build/bin/phpstan analyse -c Build/phpstan.neon --memory-limit 256M"
],
"test:rector:process": [
".build/bin/rector process"
".build/bin/rector process *"
],
"test:rector:process:dry-run": [
".build/bin/rector process --dry-run"
".build/bin/rector process * --dry-run"
],
"test:typoscript:lint": [
".build/bin/typoscript-lint -c Build/typoscriptlint.yaml Configuration"
Expand All @@ -107,6 +106,6 @@
]
},
"suggest": {
"typo3/cms-dashboard": "^12.3"
"typo3/cms-dashboard": "^13.4"
}
}
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
'title' => 'Cart',
'description' => 'Shopping Cart(s) for TYPO3',
'category' => 'plugin',
'version' => '9.0.3',
'version' => '10.0.0',
'state' => 'stable',
'author' => 'Daniel Gohlke',
'author_email' => '[email protected]',
'author_company' => 'extco.de UG (haftungsbeschränkt)',
'constraints' => [
'depends' => [
'typo3' => '12.4.0-12.4.99',
'typo3' => '13.4.0-13.4.99',
],
'conflicts' => [],
'suggests' => [],
Expand Down
Loading

0 comments on commit 0eae841

Please sign in to comment.