1 | <?php |
||
53 | class QrCodeComponent extends Component |
||
54 | { |
||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | public $text = ''; |
||
59 | /** |
||
60 | * @var int |
||
61 | */ |
||
62 | public $size = 300; |
||
63 | /** |
||
64 | * @var int |
||
65 | */ |
||
66 | public $margin = 10; |
||
67 | /** |
||
68 | * @var array the foreground color. Syntax is: |
||
69 | * |
||
70 | * ``` |
||
71 | * [ |
||
72 | * 'r' => 0, // RED |
||
73 | * 'g' => 0, // GREEN |
||
74 | * 'b' => 0 // BLUE |
||
75 | * ] |
||
76 | * ``` |
||
77 | */ |
||
78 | public $foregroundColor; |
||
79 | /** |
||
80 | * @var array the background color. Syntax is: |
||
81 | * |
||
82 | * ``` |
||
83 | * [ |
||
84 | * 'r' => 255, // RED |
||
85 | * 'g' => 255, // GREEN |
||
86 | * 'b' => 255 // BLUE |
||
87 | * ] |
||
88 | * ``` |
||
89 | * |
||
90 | */ |
||
91 | public $backgroundColor; |
||
92 | /** |
||
93 | * @var string |
||
94 | */ |
||
95 | public $encoding = 'UTF-8'; |
||
96 | /** |
||
97 | * @var string ErrorCorrectionLevelInterface value |
||
98 | */ |
||
99 | public $errorCorrectionLevel; |
||
100 | /** |
||
101 | * @var string |
||
102 | */ |
||
103 | public $logoPath; |
||
104 | /** |
||
105 | * @var int |
||
106 | */ |
||
107 | public $logoWidth; |
||
108 | /** |
||
109 | * @var LabelInterface|string |
||
110 | */ |
||
111 | public $label; |
||
112 | /** |
||
113 | * @var WriterInterface |
||
114 | */ |
||
115 | public $writer; |
||
116 | /** |
||
117 | * @var QrCodeInterface |
||
118 | */ |
||
119 | protected $qrCode; |
||
120 | |||
121 | /** |
||
122 | * @inheritdoc |
||
123 | */ |
||
124 | public function __call($name, $params) |
||
128 | |||
129 | /** |
||
130 | * @inheritdoc |
||
131 | * @throws InvalidPathException |
||
132 | */ |
||
133 | public function init() |
||
153 | } |
||
154 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.