Skip to content

Commit 844672b

Browse files
authored
Merge pull request #77 from extcode/76-add-php-85-support
[TASK] Add PHP 8.5 support
2 parents 38318f0 + ef11e2e commit 844672b

7 files changed

Lines changed: 32 additions & 165 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
php-version:
1818
- 8.2
1919
- 8.3
20+
- 8.4
21+
- 8.5
2022
steps:
2123
- name: Checkout
2224
uses: actions/checkout@v4
@@ -59,6 +61,7 @@ jobs:
5961
- php-version: '8.2'
6062
- php-version: '8.3'
6163
- php-version: '8.4'
64+
- php-version: '8.5'
6265
steps:
6366
- uses: actions/checkout@v4
6467

@@ -77,15 +80,15 @@ jobs:
7780
- name: Code Quality (by PHPStan)
7881
run: vendor/bin/phpstan analyse -c Build/phpstan.neon
7982

80-
tests-acceptance:
83+
test-unit-and-functional:
8184
runs-on: ubuntu-latest
8285
needs:
8386
- coding-guideline
8487
- code-quality
8588
steps:
86-
- uses: actions/checkout@v3
89+
- uses: actions/checkout@v5
8790

88-
- uses: cachix/install-nix-action@v17
91+
- uses: cachix/install-nix-action@v31
8992
with:
9093
nix_path: nixpkgs=channel:nixos-unstable
9194

@@ -98,6 +101,20 @@ jobs:
98101
- name: Run Unit Tests PHP8.4
99102
run: nix-shell --arg phpVersion \"php84\" --pure --run project-test-unit
100103

104+
- name: Run Unit Tests PHP8.5
105+
run: nix-shell --arg phpVersion \"php85\" --pure --run project-test-unit
106+
107+
test-acceptance:
108+
runs-on: ubuntu-latest
109+
needs:
110+
- test-unit-and-functional
111+
steps:
112+
- uses: actions/checkout@v5
113+
114+
- uses: cachix/install-nix-action@v31
115+
with:
116+
nix_path: nixpkgs=channel:nixos-unstable
117+
101118
- name: Run Acceptance Tests PHP8.2
102119
run: nix-shell --arg phpVersion \"php82\" --pure --run project-test-acceptance
103120

@@ -106,3 +123,7 @@ jobs:
106123

107124
- name: Run Acceptance Tests PHP8.4
108125
run: nix-shell --arg phpVersion \"php84\" --pure --run project-test-acceptance
126+
127+
- name: Run Acceptance Tests PHP8.5
128+
run: nix-shell --arg phpVersion \"php85\" --pure --run project-test-acceptance
129+

.gitlab-ci.yml

Lines changed: 0 additions & 151 deletions
This file was deleted.

Classes/Domain/Model/Book.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ public function getBestSpecialPrice(array $frontendUserGroupIds = []): float
8484

8585
foreach ($this->getSpecialPrices() as $specialPrice) {
8686
if ($specialPrice->getPrice() < $bestSpecialPrice) {
87-
if (!$specialPrice->getFrontendUserGroup() ||
88-
in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
87+
if (!$specialPrice->getFrontendUserGroup()
88+
|| in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
8989
) {
9090
$bestSpecialPrice = $specialPrice->getPrice();
9191
}

Classes/EventListener/CheckProductAvailability.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public function __invoke(CheckProductAvailabilityEvent $event): void
4747
$book = $this->bookRepository->findByIdentifier($cartProduct->getProductId());
4848

4949
if (
50-
!$book instanceof Book ||
51-
(
52-
$book->isHandleStock() &&
53-
($quantity > $book->getStock())
50+
!$book instanceof Book
51+
|| (
52+
$book->isHandleStock()
53+
&& ($quantity > $book->getStock())
5454
)
5555
) {
5656
$event->setAvailable(false);

Tests/Unit/Domain/Model/BookTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public function getTaxClassIdReturnsValueForTaxClassId(): void
8787
private function setProperty(object $instance, string $propertyName, mixed $propertyValue)
8888
{
8989
$reflection = new \ReflectionProperty($instance, $propertyName);
90-
$reflection->setAccessible(true);
9190
$reflection->setValue($instance, $propertyValue);
9291
}
9392
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
}
4646
},
4747
"require": {
48-
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
48+
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
4949
"ext-json": "*",
5050
"ext-pdo": "*",
5151
"extcode/cart": "^11.0",
@@ -55,7 +55,7 @@
5555
"typo3/cms-fluid": "^13.4"
5656
},
5757
"require-dev": {
58-
"codappix/typo3-php-datasets": "^1.5",
58+
"codappix/typo3-php-datasets": "^2.1",
5959
"codeception/codeception": "^5.0",
6060
"codeception/module-db": "^3.1",
6161
"codeception/module-webdriver": "^4.0",

shell.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ in pkgs.mkShell {
156156
packages = [ pkgs.gnumake pkgs.busybox ];
157157

158158
shellHook = ''
159-
export TMPDIR=$HOME/.cache/development/cart_books
160-
161159
export PROJECT_ROOT="$(pwd)"
162160
163161
export typo3DatabaseDriver=pdo_sqlite

0 commit comments

Comments
 (0)