Skip to content

Commit e8dedb5

Browse files
authored
Add Support for PHP 8.4 (#201)
Add support for PHP 8.4 Fixes various minor 8.4 compatibility issues in tests Signed-off-by: Nishant Rana <glo04412@adobe.com>
1 parent 562e02b commit e8dedb5

File tree

9 files changed

+152
-139
lines changed

9 files changed

+152
-139
lines changed

.laminas-ci.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ignore_php_platform_requirements": {
3+
"8.4": true
4+
}
5+
}

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"homepage": "https://laminas.dev",
1010
"license": "BSD-3-Clause",
1111
"require": {
12-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
12+
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
1313
},
1414
"require-dev": {
1515
"ext-phar": "*",
1616
"doctrine/annotations": "^2.0.1",
1717
"laminas/laminas-coding-standard": "^2.5.0",
18-
"laminas/laminas-stdlib": "^3.17.0",
19-
"phpunit/phpunit": "^10.3.3",
18+
"laminas/laminas-stdlib": "^3.18.0",
19+
"phpunit/phpunit": "^10.5.37",
2020
"psalm/plugin-phpunit": "^0.19.0",
2121
"vimeo/psalm": "^5.15.0"
2222
},

composer.lock

+138-129
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/book/migration.md

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ $parameterGenerator->setType('*'); // invalid (throws exception)
9393
$parameterGenerator->setType('\\'); // invalid (throws exception)
9494
```
9595

96-
9796
## Generated type-hints are now prefixed by `"\"`
9897

9998
Generated type-hints are now prefixed with the `NAMESPACE_SEPARATOR`,

test/Generator/TestAsset/ParameterClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function defaultConstant($con = self::FOO)
7575

7676
}
7777

78-
public function defaultObjectEqualsNullAndNotOptional(\stdClass $a = null, $b)
78+
public function nullableAndRequired(?\stdClass $a, $b)
7979
{
8080

8181
}

test/Generator/TestAsset/TestSampleSingleClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function someMethod()
3232
protected function withParamsAndReturnType(
3333
$mixed,
3434
array $array,
35-
callable $callable = null,
35+
?callable $callable = null,
3636
?int $int = 0
3737
): bool {
3838
/* test test */

test/Reflection/TestAsset/TestSampleClass5.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TestSampleClass5
3434
* which spans multiple lines
3535
* @return mixed Some return descr
3636
*/
37-
public function doSomething($one, $two = 2, $three = 'three', array $array = array(), TestSampleClass $class = null)
37+
public function doSomething($one, $two = 2, $three = 'three', array $array = array(), ?TestSampleClass $class = null)
3838
{
3939
return 'mixedValue';
4040
}
@@ -63,7 +63,7 @@ public function doSomethingElse($one, $two = 2, $three = 'three')
6363
public function methodWithNotAllParamsDeclared(
6464
string $one,
6565
$two = null,
66-
int $three = null,
66+
?int $three = null,
6767
string $four = '',
6868
$five = null
6969
) {

test/TestAsset/IterableHintsClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function nullableIterableParameter(?iterable $foo)
1212
{
1313
}
1414

15-
public function nullDefaultIterableParameter(iterable $foo = null)
15+
public function nullDefaultIterableParameter(?iterable $foo = null)
1616
{
1717
}
1818

test/TestAsset/ObjectHintsClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function nullableObjectParameter(?object $foo)
1212
{
1313
}
1414

15-
public function nullDefaultObjectParameter(object $foo = null)
15+
public function nullDefaultObjectParameter(?object $foo = null)
1616
{
1717
}
1818

0 commit comments

Comments
 (0)