Completed
Push — dev ( 240328...12a618 )
by
unknown
20:20
created

ClonerOptions::setRelations()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
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
     * @var Cloner\RelationOptions[]
21
     */
22
    protected $relations = [];
23
24
    /**
25
     * @return Cloner\RelationOptions[]
26
     */
27
    public function getRelations()
28
    {
29
        return $this->relations;
30
    }
31
32
    /**
33
     * @param Cloner\RelationOptions[] $relations
34
     *
35
     * @return $this
36
     */
37
    public function setRelations($relations)
38
    {
39
        foreach ($relations as $name => $options) {
40
            $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...
41
        }
42
        return $this;
43
    }
44
}
45