FolderResponseModel   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 62
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 62
loc 62
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getKind() 4 4 1
A setKind() 6 6 1
A getData() 4 4 1
A setData() 6 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
/*
4
 * This file is part of the zibios/wrike-php-jmsserializer package.
5
 *
6
 * (c) Zbigniew Ślązak
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zibios\WrikePhpJmsserializer\Model\Folder;
13
14
use JMS\Serializer\Annotation as SA;
15
use Zibios\WrikePhpJmsserializer\Model\AbstractModel;
16
use Zibios\WrikePhpJmsserializer\Model\ResponseModelInterface;
17
18
/**
19
 * Folder Response Model.
20
 */
21 View Code Duplication
class FolderResponseModel extends AbstractModel implements ResponseModelInterface
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...
22
{
23
    /**
24
     * Kind of response.
25
     *
26
     * @SA\Type("string")
27
     * @SA\SerializedName("kind")
28
     *
29
     * @var string|null
30
     */
31
    protected $kind;
32
33
    /**
34
     * Collection of response models.
35
     *
36
     * @SA\Type("array<Zibios\WrikePhpJmsserializer\Model\Folder\FolderResourceModel>")
37
     * @SA\SerializedName("data")
38
     *
39
     * @var array|FolderResourceModel]|null
40
     */
41
    protected $data;
42
43
    /**
44
     * @return null|string
45
     */
46 1
    public function getKind()
47
    {
48 1
        return $this->kind;
49
    }
50
51
    /**
52
     * @param null|string $kind
53
     *
54
     * @return $this
55
     */
56 1
    public function setKind($kind)
57
    {
58 1
        $this->kind = $kind;
59
60 1
        return $this;
61
    }
62
63
    /**
64
     * @return array|FolderResourceModel[]|null
65
     */
66 3
    public function getData()
67
    {
68 3
        return $this->data;
69
    }
70
71
    /**
72
     * @param array|FolderResourceModel[]|null $data
73
     *
74
     * @return $this
75
     */
76 1
    public function setData($data)
77
    {
78 1
        $this->data = $data;
79
80 1
        return $this;
81
    }
82
}
83