GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

OrderedSubmitButtonBuilder::getPosition()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Ordered Form package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\OrderedForm\Builder;
13
14
use Ivory\OrderedForm\Exception\OrderedConfigurationException;
15
use Ivory\OrderedForm\OrderedFormConfigInterface;
16
use Symfony\Component\Form\Exception\BadMethodCallException;
17
use Symfony\Component\Form\SubmitButtonBuilder;
18
19
/**
20
 * @author GeLo <[email protected]>
21
 */
22 View Code Duplication
class OrderedSubmitButtonBuilder extends SubmitButtonBuilder implements OrderedFormConfigBuilderInterface, OrderedFormConfigInterface
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...
23
{
24
    /**
25
     * @var string|array|null
26
     */
27
    private $position;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 45
    public function getPosition()
33
    {
34 45
        return $this->position;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 72
    public function setPosition($position)
41
    {
42 72
        if ($this->locked) {
43 9
            throw new BadMethodCallException('The config builder cannot be modified anymore.');
44
        }
45
46 63
        if (is_string($position) && ($position !== 'first') && ($position !== 'last')) {
47 9
            throw OrderedConfigurationException::createInvalidStringPosition($this->getName(), $position);
48
        }
49
50 54
        if (is_array($position) && !isset($position['before']) && !isset($position['after'])) {
51 9
            throw OrderedConfigurationException::createInvalidArrayPosition($this->getName(), $position);
52
        }
53
54 45
        $this->position = $position;
55
56 45
        return $this;
57
    }
58
}
59