Skip to content

Commit e2c2179

Browse files
committed
Drop PHP 7, Support PHP 8.2
Signed-off-by: Roger Vilà <[email protected]>
1 parent db57b30 commit e2c2179

21 files changed

+1039
-1247
lines changed

composer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
"config": {
2121
"sort-packages": true,
22+
"platform": {
23+
"php": "8.0.99"
24+
},
2225
"allow-plugins": {
2326
"dealerdirect/phpcodesniffer-composer-installer": true,
2427
"composer/package-versions-deprecated": true
@@ -30,7 +33,7 @@
3033
}
3134
},
3235
"require": {
33-
"php": "^7.3 || ~8.0.0 || ~8.1.0",
36+
"php": " ~8.0.0 || ~8.1.0 || ~8.2.0",
3437
"laminas-api-tools/api-tools": "^1.4",
3538
"laminas-api-tools/api-tools-admin-ui": "^2.0",
3639
"laminas-api-tools/api-tools-api-problem": "^1.3",
@@ -61,14 +64,13 @@
6164
},
6265
"require-dev": {
6366
"ext-sqlite3": "*",
64-
"alcaeus/mongo-php-adapter": "^1.2.2",
6567
"laminas/laminas-coding-standard": "~2.3.0",
6668
"laminas/laminas-config": "^2.6 || ^3.2",
6769
"laminas/laminas-loader": "^2.6",
6870
"phpspec/prophecy-phpunit": "^2.0.1",
69-
"phpunit/phpunit": "^9.5.5",
70-
"psalm/plugin-phpunit": "^0.15.0",
71-
"vimeo/psalm": "^4.3"
71+
"phpunit/phpunit": "^9.5.27",
72+
"psalm/plugin-phpunit": "^0.16.1",
73+
"vimeo/psalm": "^4.30"
7274
},
7375
"autoload": {
7476
"psr-4": {

composer.lock

Lines changed: 947 additions & 1191 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@
3636

3737
<!-- Include all rules from Laminas Coding Standard -->
3838
<rule ref="LaminasCodingStandard"/>
39+
<rule ref="WebimpressCodingStandard.PHP.CorrectClassNameCase.Invalid">
40+
<exclude-pattern>./src/*</exclude-pattern>
41+
<exclude-pattern>./test/*</exclude-pattern>
42+
</rule>
3943
</ruleset>

psalm.xml.dist

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<psalm
3-
totallyTyped="true"
3+
errorLevel="1"
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xmlns="https://getpsalm.org/schema/config"
66
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
@@ -14,6 +14,7 @@
1414
<directory name="view"/>
1515

1616
<ignoreFiles>
17+
<file name="config/module.config.php"/>
1718
<directory name="test/Controller/TestAsset"/>
1819
<directory name="test/Model/TestAsset"/>
1920
<directory name="test/TestAsset"/>
@@ -36,12 +37,53 @@
3637

3738
<MissingFile>
3839
<errorLevel type="suppress">
39-
<file name="test/Model/DbAutodiscoveryModelFactoryTest.php" />
40-
<file name="test/Model/DbConnectedRestServiceModelTest.php" />
41-
<file name="test/Model/RestServiceModelTest.php" />
42-
<file name="test/Model/RestServiceResourceTest.php" />
40+
<file name="test/Model/DbAutodiscoveryModelFactoryTest.php"/>
41+
<file name="test/Model/DbConnectedRestServiceModelTest.php"/>
42+
<file name="test/Model/RestServiceModelTest.php"/>
43+
<file name="test/Model/RestServiceResourceTest.php"/>
44+
<file name="test/Controller/AuthenticationControllerTest.php"/>
45+
<file name="test/Model/VersioningModelTest.php"/>
4346
</errorLevel>
4447
</MissingFile>
48+
49+
<UndefinedClass>
50+
<errorLevel type="suppress">
51+
<file name="test/Model/AuthenticationModelTest.php"/>
52+
<file name="src/Model/AuthenticationModel.php"/>
53+
</errorLevel>
54+
</UndefinedClass>
55+
56+
<DeprecatedClass>
57+
<errorLevel type="suppress">
58+
<file name="test/Listener/CryptFilterListenerTest.php"/>
59+
<file name="src/Model/AbstractAutodiscoveryModel.php"/>
60+
<file name="src/Model/DbConnectedRestServiceModel.php"/>
61+
</errorLevel>
62+
</DeprecatedClass>
63+
64+
<MoreSpecificImplementedParamType>
65+
<errorLevel type="suppress">
66+
<directory name="src/Model"/>
67+
</errorLevel>
68+
</MoreSpecificImplementedParamType>
69+
70+
<MixedArgumentTypeCoercion>
71+
<errorLevel type="suppress">
72+
<file name="src/InputFilter/InputFilterInputFilter.php"/>
73+
</errorLevel>
74+
</MixedArgumentTypeCoercion>
75+
76+
<PossiblyUndefinedMethod>
77+
<errorLevel type="suppress">
78+
<directory name="test"/>
79+
</errorLevel>
80+
</PossiblyUndefinedMethod>
81+
82+
<InvalidArgument>
83+
<errorLevel type="suppress">
84+
<file name="test/Controller/AuthenticationControllerTest.php"/>
85+
</errorLevel>
86+
</InvalidArgument>
4587
</issueHandlers>
4688

4789
<plugins>

src/InputFilter/Factory/InputFilterInputFilterFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public function __invoke(ContainerInterface $container, $requestedName, ?array $
2424
{
2525
$factory = new InputFilterFactory();
2626
$factory->setInputFilterManager($container->get('InputFilterManager'));
27-
$factory->getDefaultFilterChain()->setPluginManager($container->get('FilterManager'));
28-
$factory->getDefaultValidatorChain()->setPluginManager($container->get('ValidatorManager'));
27+
$factory->getDefaultFilterChain()?->setPluginManager($container->get('FilterManager'));
28+
$factory->getDefaultValidatorChain()?->setPluginManager($container->get('ValidatorManager'));
2929

3030
return new InputFilterInputFilter($factory);
3131
}

src/InputFilter/Validator/ContentNegotiationSelectorsValidator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use function class_exists;
1111
use function class_implements;
12-
use function get_class;
1312
use function gettype;
1413
use function in_array;
1514
use function is_array;
@@ -47,7 +46,7 @@ public function isValid($value)
4746
if (! is_array($value)) {
4847
$this->error(
4948
self::INVALID_VALUE,
50-
is_object($value) ? get_class($value) : gettype($value)
49+
is_object($value) ? $value::class : gettype($value)
5150
);
5251
return false;
5352
}

src/InputFilter/Validator/IsStringValidator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Laminas\Validator\AbstractValidator as LaminasAbstractValidator;
88

9-
use function get_class;
109
use function gettype;
1110
use function is_object;
1211
use function is_string;
@@ -29,7 +28,7 @@ class IsStringValidator extends LaminasAbstractValidator
2928
public function isValid($value)
3029
{
3130
if (! is_string($value)) {
32-
$this->error(self::INVALID_TYPE, is_object($value) ? get_class($value) : gettype($value));
31+
$this->error(self::INVALID_TYPE, is_object($value) ? $value::class : gettype($value));
3332
return false;
3433
}
3534

src/Listener/EnableHalRenderCollectionsListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __invoke(MvcEvent $e)
2626
return;
2727
}
2828

29-
$app = $e->getTarget();
29+
$app = $e->getApplication();
3030
$services = $app->getServiceManager();
3131
$helpers = $services->get('ViewHelperManager');
3232
$hal = $helpers->get('Hal');

src/Model/ContentNegotiationEntity.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
class ContentNegotiationEntity
1111
{
1212
/**
13-
* @param string $name
1413
* @param array<string, mixed> $config
1514
*/
16-
public function __construct($name, $config)
15+
public function __construct(public string $name, public array $config)
1716
{
18-
$this->name = $name;
19-
$this->config = $config;
2017
}
2118

2219
/**
@@ -35,6 +32,7 @@ public function getArrayCopy()
3532
/**
3633
* Reset state of entity
3734
*
35+
* @param array<string,string> $array
3836
* @return void
3937
*/
4038
public function exchangeArray(array $array)

src/Model/DbAdapterEntity.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
class DbAdapterEntity
1111
{
1212
/**
13-
* @param string $name
1413
* @param array<string, mixed> $config
1514
*/
16-
public function __construct($name, $config)
15+
public function __construct(public string $name, public array $config)
1716
{
18-
$this->name = $name;
19-
$this->config = $config;
2017
}
2118

2219
/**
@@ -34,7 +31,7 @@ public function getArrayCopy()
3431
/**
3532
* Reset state of entity
3633
*
37-
* @param array<string, mixed> $array
34+
* @param array<string,string> $array
3835
* @return void
3936
*/
4037
public function exchangeArray(array $array)

0 commit comments

Comments
 (0)