Pkd   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 78.79 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 26
loc 33
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 1 7 2

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
 * MOJEPANSTWO-API
4
 *
5
 * Copyright © 2017 pudelek.org.pl
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For the full copyright and license information, please view source file
10
 * that is bundled with this package in the file LICENSE
11
 *
12
 * @author Marcin Pudełek <[email protected]>
13
 */
14
15
declare (strict_types=1);
16
17
namespace mrcnpdlk\MojePanstwo\Model\KrsEntity;
18
19
use mrcnpdlk\MojePanstwo\Model\ModelAbstract;
20
21 View Code Duplication
class Pkd extends ModelAbstract
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
     * @var integer
25
     */
26
    public $id;
27
    /**
28
     * Opis
29
     *
30
     * @var string
31
     */
32
    public $str;
33
    /**
34
     * @var boolean
35
     */
36
    public $przewazajaca;
37
38
39
    /**
40
     * Pkd constructor.
41
     *
42
     * @param \stdClass|null $oData
43
     *
44
     * @throws \mrcnpdlk\MojePanstwo\Exception
45
     */
46
    public function __construct(\stdClass $oData = null)
47
    {
48
        parent::__construct($oData);
49
        if ($oData) {
50
            $this->id = $this->convertToId($this->id);
51
        }
52
    }
53
}
54