Skip to content

Commit fdf013c

Browse files
authored
[TASK] php84 compatibility (#136)
1 parent 78f2aaa commit fdf013c

File tree

10 files changed

+48
-43
lines changed

10 files changed

+48
-43
lines changed

.ddev/config.yaml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ type: php
33
docroot: .test
44
php_version: "8.3"
55
webserver_type: apache-fpm
6-
router_http_port: "80"
7-
router_https_port: "443"
86
xdebug_enabled: false
97
additional_hostnames:
108
- 12.t3api
@@ -31,14 +29,13 @@ corepack_enable: false
3129
# name: <projectname> # Name of the project, automatically provides
3230
# http://projectname.ddev.site and https://projectname.ddev.site
3331

34-
# type: <projecttype> # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress
32+
# type: <projecttype> # backdrop, cakephp, craftcms, drupal, drupal6, drupal7, drupal8, drupal9, drupal10, drupal11, generic, laravel, magento, magento2, php, shopware6, silverstripe, symfony, typo3, wordpress
3533
# See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more
3634
# information on the different project types
37-
# "drupal" covers recent Drupal 8+
3835

3936
# docroot: <relative_path> # Relative path to the directory containing index.php.
4037

41-
# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"
38+
# php_version: "8.3" # PHP version to use, "5.6" through "8.4"
4239

4340
# You can explicitly specify the webimage but this
4441
# is not recommended, as the images are often closely tied to DDEV's' behavior,
@@ -51,7 +48,7 @@ corepack_enable: false
5148
# version: <version> # database version, like "10.11" or "8.0"
5249
# MariaDB versions can be 5.5-10.8, 10.11, and 11.4.
5350
# MySQL versions can be 5.5-8.0.
54-
# PostgreSQL versions can be 9-16.
51+
# PostgreSQL versions can be 9-17.
5552

5653
# router_http_port: <port> # Port to be used for http (defaults to global configuration, usually 80)
5754
# router_https_port: <port> # Port for https (defaults to global configuration, usually 443)
@@ -61,14 +58,33 @@ corepack_enable: false
6158
# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better,
6259
# as leaving Xdebug enabled all the time is a big performance hit.
6360

61+
# xhgui_https_port: 8142
62+
# Can be used to change the router https port for xhgui application
63+
# Very rarely used
64+
65+
# xhgui_http_port: 8143
66+
# Can be used to change the router http port for xhgui application
67+
# Very rarely used
68+
69+
# host_xhgui_port: 8142
70+
# Can be used to change the host binding port of the xhgui
71+
# application. Rarely used; only when port conflict and
72+
# bind_all_ports is used (normally with router disabled)
73+
6474
# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart"
6575
# Note that for most people the commands
6676
# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better,
6777
# as leaving Xhprof enabled all the time is a big performance hit.
6878

69-
# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn
79+
# xhprof_mode: [prepend|xhgui|global]
80+
# Set to "xhgui" to enable XHGui features
81+
# "xhgui" will become default in a future major release
82+
83+
# webserver_type: nginx-fpm, apache-fpm, generic
7084

7185
# timezone: Europe/Berlin
86+
# If timezone is unset, DDEV will attempt to derive it from the host system timezone
87+
# using the $TZ environment variable or the /etc/localtime symlink.
7288
# This is the timezone used in the containers and by PHP;
7389
# it can be set to any valid timezone,
7490
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
@@ -88,9 +104,9 @@ corepack_enable: false
88104
# - preview
89105
# - snapshot
90106
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
91-
# To reinstall Composer after the image was built, run "ddev debug refresh".
107+
# To reinstall Composer after the image was built, run "ddev debug rebuild".
92108

93-
# nodejs_version: "20"
109+
# nodejs_version: "22"
94110
# change from the default system Node.js version to any other version.
95111
# See https://ddev.readthedocs.io/en/stable/users/configuration/config/#nodejs_version for more information
96112
# and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation,
@@ -216,8 +232,8 @@ corepack_enable: false
216232

217233
# You can inject environment variables into the web container with:
218234
# web_environment:
219-
# - SOMEENV=somevalue
220-
# - SOMEOTHERENV=someothervalue
235+
# - SOMEENV=somevalue
236+
# - SOMEOTHERENV=someothervalue
221237

222238
# no_project_mount: false
223239
# (Experimental) If true, DDEV will not mount the project into the web container;

.ddev/docker-compose.web.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ services:
55
- PACKAGE_NAME=sourcebroker/t3api
66

77
- TYPO3_VERSIONS=12 13
8-
- TYPO3_VERSIONS_12_PHP=8.1 8.2 8.3
9-
- TYPO3_VERSIONS_13_PHP=8.2 8.3
8+
- TYPO3_VERSIONS_12_PHP=8.1 8.2 8.3 8.4
9+
- TYPO3_VERSIONS_13_PHP=8.2 8.3 8.4
1010

1111
- TYPO3_INSTALL_DB_DRIVER=mysqli
1212
- TYPO3_INSTALL_DB_USER=root

.github/workflows/TYPO3_12.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
1616
typo3: ["12"]
17-
php: ["8.1", "8.2", "8.3"]
17+
php: ["8.1", "8.2", "8.3", "8.4"]
1818
composer: ["lowest", "highest"]
1919
env:
2020
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/TYPO3_13.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
1616
typo3: ["13"]
17-
php: ["8.2", "8.3"]
17+
php: ["8.2", "8.3", "8.4"]
1818
composer: ["lowest", "highest"]
1919
env:
2020
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Classes/Serializer/ContextBuilder/DeserializationContextBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function create(): Context
2424
* @param null $targetObject
2525
* @return DeserializationContext
2626
*/
27-
public function createFromOperation(OperationInterface $operation, Request $request, $targetObject = null): Context
27+
public function createFromOperation(OperationInterface $operation, Request $request, mixed $targetObject = null): Context
2828
{
2929
$context = $this->create();
3030

Classes/Service/SerializerService.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ public static function isDebugMode(): bool
7575
return Environment::getContext()->isDevelopment();
7676
}
7777

78-
/**
79-
* @param mixed $result
80-
*/
81-
public function serialize($result, SerializationContext|null $serializationContext = null): string
78+
public function serialize(mixed $result, ?SerializationContext $serializationContext = null): string
8279
{
8380
return $this->getSerializerBuilder()
8481
->setSerializationContextFactory(function () use ($serializationContext): SerializationContext {
@@ -88,10 +85,7 @@ public function serialize($result, SerializationContext|null $serializationConte
8885
->serialize($result, 'json');
8986
}
9087

91-
/**
92-
* @return mixed
93-
*/
94-
public function deserialize(string $data, string $type, DeserializationContext|null $deserializationContext = null)
88+
public function deserialize(string $data, string $type, ?DeserializationContext $deserializationContext = null): mixed
9589
{
9690
return $this->getSerializerBuilder()
9791
->setDeserializationContextFactory(function () use ($deserializationContext): DeserializationContext {

Tests/Functional/Domain/Repository/ApiResourceRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getAllDomainModelsReturnsAllClasses(): void
4949
* @return mixed
5050
* @throws \ReflectionException
5151
*/
52-
protected static function callProtectedMethod(string $methodName, array $arguments = [], object $object = null)
52+
protected static function callProtectedMethod(string $methodName, array $arguments = [], ?object $object = null)
5353
{
5454
$serializerMetadataServiceReflection = new \ReflectionClass(ApiResourceRepository::class);
5555
$method = $serializerMetadataServiceReflection->getMethod($methodName);

Tests/Unit/Domain/Model/PaginationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public static function getNumberOfItemsPerPageReturnsCorrectValue(
165165
);
166166
}
167167

168-
protected static function getPaginationInstance(array $attributes = [], Request $request = null): Pagination
168+
protected static function getPaginationInstance(array $attributes = [], ?Request $request = null): Pagination
169169
{
170170
$pagination = Pagination::create(
171171
array_merge(self::DEFAULT_API_RESOURCE_PAGINATION_ATTRIBUTES, $attributes)

composer.json

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,21 @@
2727
"symfony/property-info": "^6.4 || ^7.0",
2828
"symfony/psr-http-message-bridge": "^6.4 || ^7.0",
2929
"symfony/routing": "^6.4 || ^7.0",
30-
"typo3/cms-core": "^12.4.16 || ^13.3",
30+
"typo3/cms-core": "^13",
3131
"typo3/cms-extbase": "^12.4.16 || ^13.3",
3232
"typo3/cms-frontend": "^12.4.16 || ^13.3"
3333
},
3434
"require-dev": {
35-
"ergebnis/composer-normalize": "^2.29.0",
36-
"friendsofphp/php-cs-fixer": "^3.57.1",
35+
"ergebnis/composer-normalize": "^2.47.0",
36+
"friendsofphp/php-cs-fixer": "^3.75.0",
3737
"phpstan/extension-installer": "^1.2.0",
38-
"phpstan/phpstan": "^1.10.67",
39-
"phpstan/phpstan-phpunit": "^1.3.16",
40-
"phpstan/phpstan-strict-rules": "^1.5.5",
41-
"phpunit/phpunit": "^10.5.17",
42-
"saschaegerer/phpstan-typo3": "^1.10.0",
43-
"seld/jsonlint": "^1.10.2",
44-
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
38+
"phpstan/phpstan": "^1.12.26",
39+
"saschaegerer/phpstan-typo3": "~1.10.2",
40+
"seld/jsonlint": "^1.11.0",
41+
"symfony/yaml": "^6.0 || ^7.0",
4542
"typo3/cms-install": "^12.4.16 || ^13.3",
4643
"typo3/coding-standards": "^0.8",
47-
"typo3/testing-framework": "^8.2.1",
48-
"webmozart/assert": "^1.11.0"
44+
"typo3/testing-framework": "^8.2.1"
4945
},
5046
"replace": {
5147
"typo3-ter/t3api": "self.version"
@@ -90,7 +86,7 @@
9086
],
9187
"ci:composer:normalize": "@composer normalize --dry-run",
9288
"ci:json:lint": "find ./composer.json ./Resources ./Configuration -name '*.json' | xargs -r php .Build/bin/jsonlint -q",
93-
"ci:php:cs-fixer": ".Build/bin/php-cs-fixer fix --config .php-cs-fixer.php -v --dry-run --using-cache no --diff",
89+
"ci:php:cs-fixer": "PHP_CS_FIXER_IGNORE_ENV=1 .Build/bin/php-cs-fixer fix --config .php-cs-fixer.php -v --dry-run --using-cache no --diff",
9490
"ci:php:lint": "find . -name '*.php' -not -path './.Build/*' -not -path './.cache/*' -not -path './.ddev/*' -not -path './.test/*' -not -path './.Documentation/*' -not -path './.Documentation-GENERATED-temp/*' -print0 | xargs -0 -n 1 -P 4 php -l > /dev/null",
9591
"ci:php:stan": ".Build/bin/phpstan --no-progress",
9692
"ci:tests:create-directories": "mkdir -p .Build/public/typo3temp/var/tests",
@@ -106,6 +102,6 @@
106102
"@fix:composer:normalize"
107103
],
108104
"fix:composer:normalize": "@composer normalize",
109-
"fix:php:cs-fixer": ".Build/bin/php-cs-fixer fix --config .php-cs-fixer.php"
105+
"fix:php:cs-fixer": "PHP_CS_FIXER_IGNORE_ENV=1 .Build/bin/php-cs-fixer fix --config .php-cs-fixer.php"
110106
}
111107
}

phpstan-baseline.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
- '#Construct empty\(\)#'
43
- '#Unsafe usage of new static\(\)#'
54
- '#Access to an undefined property Metadata\\PropertyMetadata::\$type.#'
65
typo3:

0 commit comments

Comments
 (0)