Completed
Push — master ( 3182b0...115a8b )
by Arkadiusz
11s
created

CreatePage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 4 4 1
A setBody() 4 4 1
A getDefinedElements() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Lakion\SyliusCmsBundle\Tests\Behat\Page\Admin\StringBlock;
4
5
use Sylius\Behat\Page\Admin\Crud\CreatePage as BaseCreatePage;
6
7 View Code Duplication
class CreatePage extends BaseCreatePage implements CreatePageInterface
0 ignored issues
show
Duplication introduced by
This class 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...
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function setName($name)
13
    {
14
        $this->getSession()->getPage()->fillField('Name', $name);
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function setBody($body)
21
    {
22
        $this->getSession()->getPage()->fillField('Body', $body);
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected function getDefinedElements()
29
    {
30
        return array_merge(parent::getDefinedElements(), [
31
            'body' => '#lakion_sylius_cms_string_block_body',
32
            'name' => '#lakion_sylius_cms_string_block_name',
33
        ]);
34
    }
35
}
36