Skip to content

Commit 23dec6c

Browse files
Remove implicitly nullable parameter declarations. (#11)
* EC-7055: Remove implicitly nullable parameter declarations. * EC-7055: Added changelog changes. * EC-7055: Fixes after review. * EC-7055: Updated CI job.
1 parent ecede7c commit 23dec6c

File tree

13 files changed

+51
-35
lines changed

13 files changed

+51
-35
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
- '8.0'
2626
- '8.1'
2727
- '8.2'
28+
- '8.3'
29+
- '8.4'
2830
symfony:
2931
- '3.*'
3032
- '4.*'
@@ -38,6 +40,8 @@ jobs:
3840
- { php: '8.0', symfony: '3.*' }
3941
- { php: '8.1', symfony: '3.*' }
4042
- { php: '8.2', symfony: '3.*' }
43+
- { php: '8.3', symfony: '3.*' }
44+
- { php: '8.4', symfony: '3.*' }
4145
- { php: '7.1', symfony: '5.*' }
4246
- { php: '7.1', symfony: '6.*' }
4347
- { php: '7.2', symfony: '6.*' }
@@ -55,6 +59,14 @@ jobs:
5559
php-version: ${{ matrix.php }}
5660
tools: flex
5761

62+
- name: Ignore specific Composer audit advisory
63+
run: |
64+
if [[ "${{ matrix.php }}" == "7.1" ]]; then
65+
echo "COMPOSER_AUDIT_BLOCK_INSECURE=0" >> $GITHUB_ENV
66+
else
67+
composer config --global audit.ignore "PKSA-w2tw-kmfg-rt9s"
68+
fi
69+
5870
- name: Install dependencies
5971
uses: ramsey/composer-install@v2
6072
env:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 3.4.0
8+
### Added
9+
- PHP 8.4 support, removed implicitly nullable parameter declarations.
10+
711
## 3.3.0
812
### Added
913
- Symfony 6 support.

phpunit.xml.dist

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit backupGlobals="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
backupGlobals="false"
45
backupStaticAttributes="false"
56
colors="true"
67
convertErrorsToExceptions="true"
@@ -10,20 +11,19 @@
1011
stopOnFailure="false"
1112
bootstrap="vendor/autoload.php">
1213

14+
<coverage>
15+
<include>
16+
<directory>./</directory>
17+
</include>
18+
<exclude>
19+
<directory>./tests</directory>
20+
<directory>./vendor</directory>
21+
</exclude>
22+
</coverage>
23+
1324
<testsuites>
1425
<testsuite name="Evp Serializer Component Test Suite">
1526
<directory>./tests/</directory>
1627
</testsuite>
1728
</testsuites>
18-
19-
<filter>
20-
<whitelist>
21-
<directory>./</directory>
22-
<exclude>
23-
<directory>./tests</directory>
24-
<directory>./vendor</directory>
25-
</exclude>
26-
</whitelist>
27-
</filter>
28-
2929
</phpunit>

src/Entity/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Result implements \IteratorAggregate, ResultInterface
4040
protected $items;
4141

4242

43-
public function __construct(Filter $filter = null)
43+
public function __construct(?Filter $filter = null)
4444
{
4545
$this->filter = $filter;
4646
}

src/Exception/InvalidDataException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class InvalidDataException extends Exception
2222
*/
2323
private $violations;
2424

25-
public function __construct($message = '', $customCode = null, \Exception $previous = null)
25+
public function __construct($message = '', $customCode = null, ?Exception $previous = null)
2626
{
2727
$this->customCode = $customCode;
2828
$this->violations = [];

src/Filter/FieldsFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public function __construct(FieldsParser $fieldsParser)
1717

1818
/**
1919
* @param array $data
20-
* @param array $fields
20+
* @param null|array $fields
2121
* @param array $scope
2222
*
2323
* @return array
2424
*/
25-
public function filter($data, array $fields = null, array $scope = array())
25+
public function filter($data, ?array $fields = null, array $scope = [])
2626
{
2727
$fieldsConfig = $this->fieldsParser->parseFields($fields, $scope);
2828

src/Filter/FieldsParser.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ class FieldsParser
66
{
77

88
/**
9-
* @param array $fields
9+
* @param null|array $fields
1010
* @param array $scope
1111
*
1212
* @return FieldsConfig
1313
*/
14-
public function parseFields(array $fields = null, array $scope = array())
14+
public function parseFields(?array $fields = null, array $scope = [])
1515
{
1616
$fieldsConfig = $this->parseUnscopedFields($fields);
1717
foreach ($scope as $fieldName) {
@@ -21,12 +21,12 @@ public function parseFields(array $fields = null, array $scope = array())
2121
}
2222

2323
/**
24-
* @param array $fields
24+
* @param null|array $fields
2525
*
2626
* @throws \InvalidArgumentException
2727
* @return FieldsConfig
2828
*/
29-
public function parseUnscopedFields(array $fields = null)
29+
public function parseUnscopedFields(?array $fields = null)
3030
{
3131
if ($fields === null) {
3232
return $this->createWithDefaultsIncluded();
@@ -65,4 +65,4 @@ protected function createWithDefaultsIncluded()
6565
{
6666
return new FieldsConfig(true, array(), array());
6767
}
68-
}
68+
}

src/Normalizer/ArrayNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function mapToEntity($data)
4141
return $result;
4242
}
4343

44-
public function mapFromEntity($entity, NormalizationContextInterface $context = null)
44+
public function mapFromEntity($entity, ?NormalizationContextInterface $context = null)
4545
{
4646
$result = array();
4747
if ($entity !== null) {

src/Normalizer/ContextAwareDenormalizerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ interface ContextAwareDenormalizerInterface extends DenormalizerInterface
1414
*
1515
* @return mixed
1616
*/
17-
public function mapToEntity($data, NormalizationContextInterface $context = null);
17+
public function mapToEntity($data, ?NormalizationContextInterface $context = null);
1818
}

src/Normalizer/ContextAwareNormalizerInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ interface ContextAwareNormalizerInterface extends NormalizerInterface
99
/**
1010
* Maps some structure to raw data. Usually entity object to array
1111
*
12-
* @param mixed $entity
13-
* @param \Paysera\Component\Serializer\Entity\NormalizationContextInterface $context
12+
* @param mixed $entity
13+
* @param null|NormalizationContextInterface $context
1414
*
1515
* @return mixed
1616
*/
17-
public function mapFromEntity($entity, NormalizationContextInterface $context = null);
17+
public function mapFromEntity($entity, ?NormalizationContextInterface $context = null);
1818

1919
}

0 commit comments

Comments
 (0)