Passed
Push — master ( e89c90...b07112 )
by Bas
03:34
created

Verslag::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 10
ccs 4
cts 5
cp 0.8
rs 10
cc 2
nc 1
nop 1
crap 2.032
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace DMT\Insolvency\Model;
4
5
use DMT\Insolvency\Client;
6
use JMS\Serializer\Annotation as JMS;
7
8
/**
9
 * Class Verslag
10
 *
11
 * @JMS\XmlNamespace("http://www.rechtspraak.nl/namespaces/inspubber01")
12
 * @JMS\XmlRoot("verslag", namespace="http://www.rechtspraak.nl/namespaces/inspubber01")
0 ignored issues
show
Coding Style introduced by
Tag value for @JMS\XmlRoot("verslag", tag indented incorrectly; expected 47 spaces but found 1
Loading history...
13
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
14
class Verslag implements ConstructWithClientInterface
15
{
16
    use LazyLoadingPropertyTrait;
17
18
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
19
     * @JMS\SerializedName("insolventienummer")
20
     * @JMS\Type("string")
21
     * @JMS\XmlElement(cdata=false, namespace="http://www.rechtspraak.nl/namespaces/inspubber01")
0 ignored issues
show
Coding Style introduced by
Tag value for @JMS\XmlElement(cdata=false, tag indented incorrectly; expected 13 spaces but found 1
Loading history...
22
     *
23
     * @var string $insolventienummer
24
     */
25
    public $insolventienummer;
26
27
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
28
     * @JMS\SerializedName("rechtbank")
29
     * @JMS\Type("string")
30
     * @JMS\XmlElement(cdata=false, namespace="http://www.rechtspraak.nl/namespaces/inspubber01")
0 ignored issues
show
Coding Style introduced by
Tag value for @JMS\XmlElement(cdata=false, tag indented incorrectly; expected 5 spaces but found 1
Loading history...
31
     *
32
     * @var string $rechtbank
33
     */
34
    public $rechtbank;
35
36
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
37
     * @JMS\SerializedName("publicatiedatumVerslag")
38
     * @JMS\Type("DateTime<'Y-m-d\TH:i:sP'>")
39
     * @JMS\XmlElement(cdata=false, namespace="http://www.rechtspraak.nl/namespaces/inspubber01")
0 ignored issues
show
Coding Style introduced by
Tag value for @JMS\XmlElement(cdata=false, tag indented incorrectly; expected 18 spaces but found 1
Loading history...
40
     *
41
     * @var \DateTime $publicatiedatumVerslag
42
     */
43
    public $publicatiedatumVerslag;
44
45
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
46
     * @JMS\SerializedName("kenmerk")
47
     * @JMS\Type("string")
48
     * @JMS\XmlElement(cdata=false, namespace="http://www.rechtspraak.nl/namespaces/inspubber01")
0 ignored issues
show
Coding Style introduced by
Tag value for @JMS\XmlElement(cdata=false, tag indented incorrectly; expected 3 spaces but found 1
Loading history...
49
     *
50
     * @var string $kenmerk
51
     */
52
    public $kenmerk;
53
54
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
55
     * @JMS\SerializedName("titel")
56
     * @JMS\Type("string")
57
     * @JMS\XmlElement(cdata=false, namespace="http://www.rechtspraak.nl/namespaces/inspubber01")
58
     *
59
     * @var string $titel
60
     */
61
    public $titel;
62
63
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
64
     * @JMS\SerializedName("eindverslag")
65
     * @JMS\Type("bool")
66
     * @JMS\XmlElement(cdata=false, namespace="http://www.rechtspraak.nl/namespaces/inspubber01")
0 ignored issues
show
Coding Style introduced by
Tag value for @JMS\XmlElement(cdata=false, tag indented incorrectly; expected 7 spaces but found 1
Loading history...
67
     *
68
     * @var bool $eindverslag
69
     */
70
    public $eindverslag;
71
72
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
73
     * @JMS\SerializedName("uri")
74
     * @JMS\Type("string")
75
     * @JMS\XmlAttribute()
76
     *
77
     * @var string $uri
78
     */
79
    public $uri;
80
81
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
82
     * @JMS\ReadOnlyProperty()
83
     *
84
     * @var Document|null $report
85
     */
86
    private $report;
0 ignored issues
show
Coding Style introduced by
Private member variable "report" must be prefixed with an underscore
Loading history...
87
88 8
    public function __construct(Client $client)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
89
    {
90
        $this->report = function () use ($client) {
0 ignored issues
show
Documentation Bug introduced by
It seems like function(...) { /* ... */ } of type callable is incompatible with the declared type DMT\Insolvency\Model\Document|null of property $report.

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..

Loading history...
91 2
            if (!$this->kenmerk) {
92
                return null;
93
            }
94
95 2
            $report = $client->getReport($this->kenmerk);
96
97 2
            return $report->result->report ?? null;
98
        };
99 8
    }
100
}
101