Skip to content

Commit 38e4c4a

Browse files
authored
Merge pull request #804 from TomHAnderson/feat/merge-drop-php74
Feat/merge drop php74
2 parents 7c1ed51 + d3ea2f9 commit 38e4c4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+346
-345
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
name: "PHPUnit"
1414
uses: "doctrine/.github/.github/workflows/[email protected]"
1515
with:
16-
php-versions: '["7.4", "8.0", "8.1", "8.2"]'
16+
php-versions: '["8.0", "8.1", "8.2"]'

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
],
3737
"homepage": "http://www.doctrine-project.org/",
3838
"require": {
39-
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0",
39+
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
4040
"composer-runtime-api": "^2.0",
4141
"doctrine/annotations": "^1.13.3 || ^2",
4242
"doctrine/cache": "^1.13.0 || ^2.1.0",

phpcs.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<arg name="cache" value=".phpcs.cache"/>
77
<arg name="colors"/>
88

9-
<!-- set minimal required PHP version (7.4) -->
10-
<config name="php_version" value="70400"/>
9+
<!-- set minimal required PHP version (8.0) -->
10+
<config name="php_version" value="80000"/>
1111

1212
<!-- Ignore warnings, show progress of the run and show sniff names -->
1313
<arg value="nps"/>

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ parameters:
1616
-
1717
message: '#mock an undefined method save\(\) on class Doctrine\\Common\\Cache\\ArrayCache#'
1818
path: tests/Cache/DoctrineCacheStorageTest.php
19-
2019
includes:
2120
- vendor/phpstan/phpstan-phpunit/extension.neon
2221
- vendor/phpstan/phpstan-phpunit/rules.neon

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0"?>
22
<psalm
33
errorLevel="4"
4+
findUnusedCode="false"
5+
findUnusedBaselineEntry="true"
46
resolveFromConfigFile="true"
57
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
68
xmlns="https://getpsalm.org/schema/config"

src/Authentication/Adapter/ObjectRepository.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Laminas\Authentication\Result as AuthenticationResult;
1313

1414
use function call_user_func;
15-
use function get_class;
1615
use function method_exists;
1716
use function property_exists;
1817
use function sprintf;
@@ -38,7 +37,7 @@ class ObjectRepository extends AbstractAdapter
3837
*
3938
* @param mixed[]|AuthenticationOptions $options
4039
*/
41-
public function __construct($options = [], ?Inflector $inflector = null)
40+
public function __construct(array|AuthenticationOptions $options = [], ?Inflector $inflector = null)
4241
{
4342
$this->setOptions($options);
4443
$this->inflector = $inflector ?? InflectorFactory::create()->build();
@@ -47,7 +46,7 @@ public function __construct($options = [], ?Inflector $inflector = null)
4746
/**
4847
* @param mixed[]|AuthenticationOptions $options
4948
*/
50-
public function setOptions($options): self
49+
public function setOptions(array|AuthenticationOptions $options): self
5150
{
5251
if (! $options instanceof AuthenticationOptions) {
5352
$options = new AuthenticationOptions($options);
@@ -102,8 +101,8 @@ protected function validateIdentity(object $identity): AuthenticationResult
102101
sprintf(
103102
'Property (%s) in (%s) is not accessible. You should implement %s::%s()',
104103
$credentialProperty,
105-
get_class($identity),
106-
get_class($identity),
104+
$identity::class,
105+
$identity::class,
107106
$getter
108107
)
109108
);

src/Authentication/Storage/ObjectRepository.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ObjectRepository implements StorageInterface
1717
/**
1818
* @param mixed[]|AuthenticationOptions $options
1919
*/
20-
public function setOptions($options): ObjectRepository
20+
public function setOptions(array|AuthenticationOptions $options): ObjectRepository
2121
{
2222
if (! $options instanceof AuthenticationOptions) {
2323
$options = new AuthenticationOptions($options);
@@ -33,7 +33,7 @@ public function setOptions($options): ObjectRepository
3333
*
3434
* @param mixed[]|AuthenticationOptions $options
3535
*/
36-
public function __construct($options = [])
36+
public function __construct(array|AuthenticationOptions $options = [])
3737
{
3838
$this->setOptions($options);
3939
}
@@ -60,18 +60,13 @@ public function read(): ?object
6060
/**
6161
* Will return the key of the identity. If only the key is needed, this avoids an
6262
* unnecessary db call
63-
*
64-
* @return mixed
6563
*/
66-
public function readKeyOnly()
64+
public function readKeyOnly(): mixed
6765
{
6866
return $identity = $this->options->getStorage()->read();
6967
}
7068

71-
/**
72-
* @param mixed $contents
73-
*/
74-
public function write($contents): void
69+
public function write(mixed $contents): void
7570
{
7671
$metadataInfo = $this->options->getClassMetadata();
7772
$identifierValues = $metadataInfo->getIdentifierValues($contents);

src/Cache/DoctrineCacheStorage.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@
1515
*/
1616
class DoctrineCacheStorage extends AbstractAdapter
1717
{
18-
protected Cache $cache;
19-
2018
/**
2119
* {@inheritDoc}
2220
*
2321
* @param iterable<mixed>|AdapterOptions $options
2422
* @param Cache $cache
2523
*/
26-
public function __construct($options, Cache $cache)
24+
public function __construct($options, protected Cache $cache)
2725
{
2826
parent::__construct($options);
29-
30-
$this->cache = $cache;
3127
}
3228

3329
/**

src/Cache/LaminasStorageCache.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
*/
1717
class LaminasStorageCache extends CacheProvider
1818
{
19-
protected StorageInterface $storage;
20-
21-
public function __construct(StorageInterface $storage)
19+
public function __construct(protected StorageInterface $storage)
2220
{
23-
$this->storage = $storage;
2421
}
2522

2623
/**

src/Form/Element/ObjectMultiCheckbox.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ public function setOptions(iterable $options): self
2828
}
2929

3030
/**
31-
* @param mixed $value
32-
* @param mixed $key
33-
*
3431
* @return $this
3532
*/
36-
public function setOption($key, $value): self
33+
public function setOption(mixed $key, mixed $value): self
3734
{
3835
$this->getProxy()->setOptions([$key => $value]);
3936

0 commit comments

Comments
 (0)