Completed
Push — dev ( 997c2c...9002dc )
by
unknown
05:25
created

ClonerOptions::setClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * @year    2016
4
 * @link    https://github.com/nnx-framework/cloner
5
 * @author  Lobanov Aleksandr <[email protected]>
6
 */
7
8
namespace Nnx\Cloner\Options;
9
10
use Zend\Stdlib\AbstractOptions;
11
12
/**
13
 * Class ClonerOptions
14
 *
15
 * @package Nnx\Cloner\Options
16
 */
17
class ClonerOptions extends AbstractOptions
18
{
19
20
    /**
21
     * @var string создаваемый класс клонера
22
     */
23
    protected $class;
24
25
    /**
26
     * @var Cloner\RelationOptions[]
27
     */
28
    protected $relations = [];
29
30
    /**
31
     * @return string
32
     */
33
    public function getClass()
34
    {
35
        return $this->class;
36
    }
37
38
    /**
39
     * @param string $class
40
     *
41
     * @return $this
42
     */
43
    public function setClass($class)
44
    {
45
        $this->class = $class;
46
        return $this;
47
    }
48
49
    /**
50
     * @return Cloner\RelationOptions[]
51
     */
52
    public function getRelations()
53
    {
54
        return $this->relations;
55
    }
56
57
    /**
58
     * @param Cloner\RelationOptions[] $relations
59
     *
60
     * @return $this
61
     */
62
    public function setRelations($relations)
63
    {
64
        foreach ($relations as $name => $options) {
65
            $this->relations[$name] = new Cloner\RelationOptions($options);
0 ignored issues
show
Unused Code introduced by
The call to RelationOptions::__construct() has too many arguments starting with $options.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
66
        }
67
        return $this;
68
    }
69
}
70