EditBuilderAction::getObjectActions()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Admingenerator\GeneratorBundle\Builder\Admin;
4
5
/**
6
 * This builder generates php for edit actions
7
 * @author cedric Lombardot
8
 */
9
class EditBuilderAction extends EditBuilder
10
{
11
    public function getOutputName()
12
    {
13
        return $this->getGenerator()->getGeneratedControllerFolder().'/EditController.php';
14
    }
15
16
    /**
17
     * Return a list of action from list.object_actions
18
     * @return array
19
     */
20 View Code Duplication
    public function getObjectActions()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        $objectActions = parent::getObjectActions();
23
24
        if (array_key_exists('edit', $objectActions)) {
25
            unset($objectActions['edit']);
26
            $this->objectActions = $objectActions;
27
        }
28
29
        return $this->objectActions;
30
    }
31
}
32