1 | <?php |
||
18 | class Person extends AbstractType implements TypeInterface, C\SetLoggerInterface |
||
19 | { |
||
20 | use T\LoggerTrait; |
||
21 | |||
22 | /** |
||
23 | * The DOMNode element to parse. |
||
24 | * |
||
25 | * @var DOMNode |
||
26 | */ |
||
27 | protected $node; |
||
28 | |||
29 | /** |
||
30 | * The person's name. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $name; |
||
35 | |||
36 | /** |
||
37 | * The person's URL. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $uri; |
||
42 | |||
43 | /** |
||
44 | * The person's email address. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $email; |
||
49 | |||
50 | /** |
||
51 | * The person's avatar. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $avatar; |
||
56 | |||
57 | /** |
||
58 | * Constructs a new instance of this class. |
||
59 | * |
||
60 | * @param DOMNode|null $node The `DOMNode` element to parse. |
||
61 | * @param LoggerInterface $logger The PSR-3 logger. |
||
|
|||
62 | */ |
||
63 | public function __construct(?DOMNode $node = null, LoggerInterface $logger = null) |
||
75 | |||
76 | /** |
||
77 | * Converts this object into a string representation. |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function __toString(): string |
||
105 | |||
106 | /** |
||
107 | * Gets the DOMNode element. |
||
108 | * |
||
109 | * @return DOMNode|null |
||
110 | */ |
||
111 | public function getNode(): ?DOMNode |
||
115 | |||
116 | /** |
||
117 | * Gets the person's name. |
||
118 | * |
||
119 | * @return Node |
||
120 | */ |
||
121 | public function getName(): Node |
||
125 | |||
126 | /** |
||
127 | * Gets the person's URL. |
||
128 | * |
||
129 | * @return Node |
||
130 | */ |
||
131 | public function getUrl(): Node |
||
135 | |||
136 | /** |
||
137 | * Gets the person's email address. |
||
138 | * |
||
139 | * @return Node |
||
140 | */ |
||
141 | public function getEmail(): Node |
||
145 | |||
146 | /** |
||
147 | * Gets the person's avatar. |
||
148 | * |
||
149 | * @return Node |
||
150 | */ |
||
151 | public function getAvatar(): Node |
||
155 | } |
||
156 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.