Completed
Pull Request — master (#21)
by Daniel
02:36
created

DeleteAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A perform() 0 8 2
A configureOptions() 0 3 1
1
<?php
2
3
namespace Psi\Component\Grid\Action;
4
5
use Psi\Component\Grid\ActionInterface;
6
use Psi\Component\ObjectAgent\AgentInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolver;
8
9
class DeleteAction implements ActionInterface
10
{
11
    public function perform(AgentInterface $agent, \Traversable $collection, array $options)
12
    {
13
        foreach ($collection as $object) {
14
            $agent->remove($object);
0 ignored issues
show
Bug introduced by
The method remove() does not seem to exist on object<Psi\Component\ObjectAgent\AgentInterface>.

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.

Loading history...
15
        }
16
17
        $agent->flush();
0 ignored issues
show
Bug introduced by
The method flush() does not seem to exist on object<Psi\Component\ObjectAgent\AgentInterface>.

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.

Loading history...
18
    }
19
20
    public function configureOptions(OptionsResolver $options)
21
    {
22
    }
23
}
24