Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
91.67% covered (success)
91.67%
11 / 12
83.33% covered (warning)
83.33%
5 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 1
Client
91.67% covered (success)
91.67%
11 / 12
83.33% covered (warning)
83.33%
5 / 6
10.06
0.00% covered (danger)
0.00%
0 / 1
 getDefaults
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
 hasFamilyName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
6
 hasEmail
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
 hasTelephone
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
 getEmailSendCount
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 hasSurveyAccepted
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3namespace BO\Zmsentities;
4
5class Client extends Schema\Entity
6{
7    public static $schema = "client.json";
8
9    /**
10     * @return (false|int|string)[]
11     *
12     */
13    #[\Override]
14    public function getDefaults()
15    {
16        return [
17            'familyName' => '',
18            'email' => '',
19            'emailSendCount' => 0,
20            'surveyAccepted' => false,
21            'telephone' => ''
22        ];
23    }
24
25    public function hasFamilyName(): bool
26    {
27        return ($this->toProperty()->familyName->get()) ? true : false;
28    }
29
30    public function hasEmail(): bool
31    {
32        return ($this->toProperty()->email->get()) ? true : false;
33    }
34
35    public function hasTelephone(): bool
36    {
37        return ($this->toProperty()->telephone->get()) ? true : false;
38    }
39
40    public function getEmailSendCount()
41    {
42        return $this->toProperty()->emailSendCount->get();
43    }
44
45    public function hasSurveyAccepted(): bool
46    {
47        return (1 == $this->toProperty()->surveyAccepted->get()) ? true : false;
48    }
49}