Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function perform( |
||
20 | AgentInterface $agent, |
||
21 | GridMetadata $gridMetadata, |
||
22 | string $actionName, |
||
23 | array $selectedIdentifiers |
||
24 | ) |
||
25 | { |
||
26 | $actionMetadatas = $gridMetadata->getActions(); |
||
27 | if (!isset($actionMetadatas[$actionName])) { |
||
28 | throw new \InvalidArgumentException(sprintf( |
||
29 | 'Action "%s" is not available for class "%s". Availabile actions: "%s"', |
||
30 | $actionName, $gridMetadata->getClassMetadata()->name, implode('", "', array_keys($actionMetadatas)) |
||
31 | )); |
||
32 | } |
||
33 | |||
34 | $collection = $agent->findMany($selectedIdentifiers, $gridMetadata->getClassMetadata()->name); |
||
|
|||
35 | |||
36 | $actionMetadata = $actionMetadatas[$actionName]; |
||
37 | $action = $this->registry->get($actionMetadata->getType()); |
||
38 | $options = new OptionsResolver(); |
||
39 | $action->configureOptions($options); |
||
40 | $options = $options->resolve($actionMetadata->getOptions()); |
||
41 | |||
42 | $action->perform($agent, $collection, $options); |
||
43 | } |
||
44 | } |
||
45 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.