@@ -26,25 +26,23 @@ public function __construct(private readonly ContainerInterface $locator)
26
26
/**
27
27
* {@inheritDoc}
28
28
*/
29
- public function process ($ data , Operation $ operation , array $ uriVariables = [], array $ context = [])
29
+ public function process (mixed $ data , Operation $ operation , array $ uriVariables = [], array $ context = [])
30
30
{
31
31
if (!($ processor = $ operation ->getProcessor ())) {
32
- return ;
32
+ return null ;
33
33
}
34
34
35
35
if (\is_callable ($ processor )) {
36
36
return $ processor ($ data , $ operation , $ uriVariables , $ context );
37
37
}
38
38
39
- if (\is_string ($ processor )) {
40
- if (!$ this ->locator ->has ($ processor )) {
41
- throw new RuntimeException (sprintf ('Processor "%s" not found on operation "%s" ' , $ processor , $ operation ->getName ()));
42
- }
39
+ if (!$ this ->locator ->has ($ processor )) {
40
+ throw new RuntimeException (sprintf ('Processor "%s" not found on operation "%s" ' , $ processor , $ operation ->getName ()));
41
+ }
43
42
44
- /** @var ProcessorInterface */
45
- $ processor = $ this ->locator ->get ($ processor );
43
+ /** @var ProcessorInterface $processorInstance */
44
+ $ processorInstance = $ this ->locator ->get ($ processor );
46
45
47
- return $ processor ->process ($ data , $ operation , $ uriVariables , $ context );
48
- }
46
+ return $ processorInstance ->process ($ data , $ operation , $ uriVariables , $ context );
49
47
}
50
48
}
0 commit comments