| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function perform( |
||
| 19 | AgentInterface $agent, |
||
| 20 | GridMetadata $gridMetadata, |
||
| 21 | string $actionName, |
||
| 22 | array $selectedIdentifiers |
||
| 23 | ) { |
||
| 24 | $actionMetadatas = $gridMetadata->getActions(); |
||
| 25 | if (!isset($actionMetadatas[$actionName])) { |
||
| 26 | throw new \InvalidArgumentException(sprintf( |
||
| 27 | 'Action "%s" is not available for class "%s". Availabile actions: "%s"', |
||
| 28 | $actionName, $gridMetadata->getClassMetadata()->name, implode('", "', array_keys($actionMetadatas)) |
||
| 29 | )); |
||
| 30 | } |
||
| 31 | |||
| 32 | $collection = $agent->findMany($selectedIdentifiers, $gridMetadata->getClassMetadata()->name); |
||
|
|
|||
| 33 | |||
| 34 | $actionMetadata = $actionMetadatas[$actionName]; |
||
| 35 | $action = $this->registry->get($actionMetadata->getType()); |
||
| 36 | $options = new OptionsResolver(); |
||
| 37 | $action->configureOptions($options); |
||
| 38 | $options = $options->resolve($actionMetadata->getOptions()); |
||
| 39 | |||
| 40 | $action->perform($agent, $collection, $options); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
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.