SerializerPluginOptions::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/jms-serializer-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\JmsSerializerModule\Options;
7
8
use Zend\Stdlib\AbstractOptions;
9
10
/**
11
 * Class SerializerPluginOptions
12
 *
13
 * @package Nnx\JmsSerializerModule\Options
14
 */
15 View Code Duplication
class SerializerPluginOptions extends AbstractOptions
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...
16
{
17
    /**
18
     * Имя плагина
19
     *
20
     * @var string
21
     */
22
    protected $name;
23
24
    /**
25
     * Настройки плагина
26
     *
27
     * @var array
28
     */
29
    protected $options = [];
30
31
    /**
32
     * Настройки для сериалайзера
33
     *
34
     * @var SerializerOptions
35
     */
36
    protected $serializerOptions;
37
38
    /**
39
     * Возвращает имя плагина
40
     *
41
     * @return string
42
     */
43
    public function getName()
44
    {
45
        return $this->name;
46
    }
47
48
    /**
49
     * Устанавливает имя плагина
50
     *
51
     * @param string $name
52
     *
53
     * @return $this
54
     */
55
    public function setName($name)
56
    {
57
        $this->name = $name;
58
59
        return $this;
60
    }
61
62
    /**
63
     * Возвращает настройки плагина
64
     *
65
     * @return SerializerOptions
66
     */
67
    public function getOptions()
68
    {
69
        if (null === $this->serializerOptions) {
70
            $this->serializerOptions = new SerializerOptions($this->options);
71
        }
72
73
        return $this->serializerOptions;
74
    }
75
76
    /**
77
     * Устанавливает настройки плагина
78
     *
79
     * @param array $options
80
     *
81
     * @return $this
82
     */
83
    public function setOptions(array $options)
84
    {
85
        $this->options = $options;
86
87
        return $this;
88
    }
89
}
90