Skip to content

Commit f398d72

Browse files
authored
Updated codebase to PHP 8.0 (#53)
1 parent 86b0e61 commit f398d72

File tree

2 files changed

+17
-38
lines changed

2 files changed

+17
-38
lines changed

src/DenormalizeItemProcessor.php

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,21 @@
1515
*/
1616
final class DenormalizeItemProcessor implements ItemProcessorInterface
1717
{
18-
private DenormalizerInterface $denormalizer;
19-
private string $type;
20-
private ?string $format;
21-
22-
/**
23-
* @phpstan-var array<string, mixed>
24-
*/
25-
private array $context;
26-
27-
/**
28-
* @phpstan-param array<string, mixed> $context
29-
*/
3018
public function __construct(
31-
DenormalizerInterface $denormalizer,
32-
string $type,
33-
string $format = null,
34-
array $context = []
19+
private DenormalizerInterface $denormalizer,
20+
private string $type,
21+
private ?string $format = null,
22+
/**
23+
* @phpstan-var array<string, mixed>
24+
*/
25+
private array $context = [],
3526
) {
36-
$this->denormalizer = $denormalizer;
37-
$this->type = $type;
38-
$this->format = $format;
39-
$this->context = $context;
4027
}
4128

4229
/**
4330
* @inheritDoc
4431
*/
45-
public function process($item)
32+
public function process(mixed $item): mixed
4633
{
4734
try {
4835
if (!$this->denormalizer->supportsDenormalization($item, $this->type, $this->format)) {

src/NormalizeItemProcessor.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,20 @@
1515
*/
1616
final class NormalizeItemProcessor implements ItemProcessorInterface
1717
{
18-
private NormalizerInterface $normalizer;
19-
private ?string $format;
20-
21-
/**
22-
* @phpstan-var array<string, mixed>
23-
*/
24-
private array $context;
25-
26-
/**
27-
* @phpstan-param array<string, mixed> $context
28-
*/
29-
public function __construct(NormalizerInterface $normalizer, string $format = null, array $context = [])
30-
{
31-
$this->normalizer = $normalizer;
32-
$this->format = $format;
33-
$this->context = $context;
18+
public function __construct(
19+
private NormalizerInterface $normalizer,
20+
private ?string $format = null,
21+
/**
22+
* @phpstan-var array<string, mixed>
23+
*/
24+
private array $context = [],
25+
) {
3426
}
3527

3628
/**
3729
* @inheritDoc
3830
*/
39-
public function process($item)
31+
public function process(mixed $item): mixed
4032
{
4133
try {
4234
if (!$this->normalizer->supportsNormalization($item, $this->format)) {

0 commit comments

Comments
 (0)