1 | <?php |
||
13 | class Font |
||
14 | { |
||
15 | /** |
||
16 | * 名称. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $name; |
||
21 | |||
22 | /** |
||
23 | * 颜色. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $color; |
||
28 | |||
29 | /** |
||
30 | * 字号. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $size; |
||
35 | |||
36 | /** |
||
37 | * 风格,具体不知效果. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $style; |
||
42 | |||
43 | public function __construct($name, $color, $size, array $style = []) |
||
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | */ |
||
54 | public function setName($name) |
||
58 | |||
59 | /** |
||
60 | * @param string $color |
||
61 | */ |
||
62 | public function setColor($color) |
||
66 | |||
67 | /** |
||
68 | * @param string $size |
||
69 | */ |
||
70 | public function setSize($size) |
||
74 | |||
75 | /** |
||
76 | * @param string $style |
||
77 | */ |
||
78 | public function setStyle($style) |
||
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getName() |
||
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | public function getColor() |
||
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | public function getSize() |
||
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getStyle() |
||
114 | |||
115 | /** |
||
116 | * 转换成数组. |
||
117 | * |
||
118 | * @return array |
||
119 | */ |
||
120 | public function toArray() |
||
129 | |||
130 | /** |
||
131 | * 创建一个默认字体. |
||
132 | * |
||
133 | * @return static |
||
134 | */ |
||
135 | public static function createDefault() |
||
139 | } |
||
140 |
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..