66use PHPStan \Reflection \NamespaceAnswerer ;
77use PHPStan \Reflection \ReflectionProvider ;
88use PHPStan \Reflection \ReflectionProvider \ReflectionProviderProvider ;
9- use PHPStan \Type \Accessory \AccessoryNonEmptyStringType ;
9+ use PHPStan \Type \Accessory \AccessoryNonFalsyStringType ;
1010use PHPStan \Type \Constant \ConstantFloatType ;
1111use PHPStan \Type \Constant \ConstantIntegerType ;
1212use PHPStan \Type \Constant \ConstantStringType ;
@@ -73,7 +73,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
7373 if ($ resolvedConstantName === 'PHP_VERSION ' ) {
7474 return new IntersectionType ([
7575 new StringType (),
76- new AccessoryNonEmptyStringType (),
76+ new AccessoryNonFalsyStringType (),
7777 ]);
7878 }
7979 if ($ resolvedConstantName === 'PHP_MAJOR_VERSION ' ) {
@@ -106,7 +106,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
106106 if ($ resolvedConstantName === 'PHP_OS ' ) {
107107 return new IntersectionType ([
108108 new StringType (),
109- new AccessoryNonEmptyStringType (),
109+ new AccessoryNonFalsyStringType (),
110110 ]);
111111 }
112112 if ($ resolvedConstantName === 'PHP_OS_FAMILY ' ) {
@@ -132,7 +132,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
132132 new ConstantStringType ('phpdbg ' ),
133133 new IntersectionType ([
134134 new StringType (),
135- new AccessoryNonEmptyStringType (),
135+ new AccessoryNonFalsyStringType (),
136136 ]),
137137 ]);
138138 }
@@ -165,61 +165,61 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
165165 if ($ resolvedConstantName === 'PHP_EXTENSION_DIR ' ) {
166166 return new IntersectionType ([
167167 new StringType (),
168- new AccessoryNonEmptyStringType (),
168+ new AccessoryNonFalsyStringType (),
169169 ]);
170170 }
171171 if ($ resolvedConstantName === 'PHP_PREFIX ' ) {
172172 return new IntersectionType ([
173173 new StringType (),
174- new AccessoryNonEmptyStringType (),
174+ new AccessoryNonFalsyStringType (),
175175 ]);
176176 }
177177 if ($ resolvedConstantName === 'PHP_BINDIR ' ) {
178178 return new IntersectionType ([
179179 new StringType (),
180- new AccessoryNonEmptyStringType (),
180+ new AccessoryNonFalsyStringType (),
181181 ]);
182182 }
183183 if ($ resolvedConstantName === 'PHP_BINARY ' ) {
184184 return new IntersectionType ([
185185 new StringType (),
186- new AccessoryNonEmptyStringType (),
186+ new AccessoryNonFalsyStringType (),
187187 ]);
188188 }
189189 if ($ resolvedConstantName === 'PHP_MANDIR ' ) {
190190 return new IntersectionType ([
191191 new StringType (),
192- new AccessoryNonEmptyStringType (),
192+ new AccessoryNonFalsyStringType (),
193193 ]);
194194 }
195195 if ($ resolvedConstantName === 'PHP_LIBDIR ' ) {
196196 return new IntersectionType ([
197197 new StringType (),
198- new AccessoryNonEmptyStringType (),
198+ new AccessoryNonFalsyStringType (),
199199 ]);
200200 }
201201 if ($ resolvedConstantName === 'PHP_DATADIR ' ) {
202202 return new IntersectionType ([
203203 new StringType (),
204- new AccessoryNonEmptyStringType (),
204+ new AccessoryNonFalsyStringType (),
205205 ]);
206206 }
207207 if ($ resolvedConstantName === 'PHP_SYSCONFDIR ' ) {
208208 return new IntersectionType ([
209209 new StringType (),
210- new AccessoryNonEmptyStringType (),
210+ new AccessoryNonFalsyStringType (),
211211 ]);
212212 }
213213 if ($ resolvedConstantName === 'PHP_LOCALSTATEDIR ' ) {
214214 return new IntersectionType ([
215215 new StringType (),
216- new AccessoryNonEmptyStringType (),
216+ new AccessoryNonFalsyStringType (),
217217 ]);
218218 }
219219 if ($ resolvedConstantName === 'PHP_CONFIG_FILE_PATH ' ) {
220220 return new IntersectionType ([
221221 new StringType (),
222- new AccessoryNonEmptyStringType (),
222+ new AccessoryNonFalsyStringType (),
223223 ]);
224224 }
225225 if ($ resolvedConstantName === 'PHP_SHLIB_SUFFIX ' ) {
@@ -232,7 +232,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
232232 return IntegerRangeType::fromInterval (1 , null );
233233 }
234234 if ($ resolvedConstantName === '__COMPILER_HALT_OFFSET__ ' ) {
235- return IntegerRangeType::fromInterval (0 , null );
235+ return IntegerRangeType::fromInterval (1 , null );
236236 }
237237 // core other, https://www.php.net/manual/en/info.constants.php
238238 if ($ resolvedConstantName === 'PHP_WINDOWS_VERSION_MAJOR ' ) {
@@ -261,7 +261,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
261261 if ($ resolvedConstantName === 'ICONV_IMPL ' ) {
262262 return new IntersectionType ([
263263 new StringType (),
264- new AccessoryNonEmptyStringType (),
264+ new AccessoryNonFalsyStringType (),
265265 ]);
266266 }
267267 // libxml, https://www.php.net/manual/en/libxml.constants.php
@@ -271,7 +271,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
271271 if ($ resolvedConstantName === 'LIBXML_DOTTED_VERSION ' ) {
272272 return new IntersectionType ([
273273 new StringType (),
274- new AccessoryNonEmptyStringType (),
274+ new AccessoryNonFalsyStringType (),
275275 ]);
276276 }
277277 // openssl, https://www.php.net/manual/en/openssl.constants.php
0 commit comments