File tree Expand file tree Collapse file tree 2 files changed +17
-38
lines changed Expand file tree Collapse file tree 2 files changed +17
-38
lines changed Original file line number Diff line number Diff line change 1515 */
1616final 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 )) {
Original file line number Diff line number Diff line change 1515 */
1616final 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 )) {
You can’t perform that action at this time.
0 commit comments