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 $metadataFactoryOptions;
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 MetadataFactoryOptions
66
*/
67
public function getOptions()
68
{
69
if (null === $this->metadataFactoryOptions) {
70
$this->metadataFactoryOptions = new MetadataFactoryOptions($this->options);
It seems like new \Nnx\JmsSerializerMo...Options($this->options) of type object<Nnx\JmsSerializer...MetadataFactoryOptions> is incompatible with the declared type object<Nnx\JmsSerializer...ions\SerializerOptions> of property $metadataFactoryOptions.
Our type inference engine has found an assignment to a property that is incompatible
with the declared type of that property.
Either this assignment is in error or the assigned type should be added
to the documentation/type hint for that property..
The expression $this->metadataFactoryOptions; of type Nnx\JmsSerializerModule\...tions\SerializerOptions adds the type Nnx\JmsSerializerModule\Options\SerializerOptions to the return on line 73 which is incompatible with the return type documented by Nnx\JmsSerializerModule\...uginOptions::getOptions of type Nnx\JmsSerializerModule\...\MetadataFactoryOptions.
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.