6
6
use PHPStan \Reflection \NamespaceAnswerer ;
7
7
use PHPStan \Reflection \ReflectionProvider ;
8
8
use PHPStan \Reflection \ReflectionProvider \ReflectionProviderProvider ;
9
- use PHPStan \Type \Accessory \AccessoryNonEmptyStringType ;
9
+ use PHPStan \Type \Accessory \AccessoryNonFalsyStringType ;
10
10
use PHPStan \Type \Constant \ConstantFloatType ;
11
11
use PHPStan \Type \Constant \ConstantIntegerType ;
12
12
use PHPStan \Type \Constant \ConstantStringType ;
@@ -73,7 +73,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
73
73
if ($ resolvedConstantName === 'PHP_VERSION ' ) {
74
74
return new IntersectionType ([
75
75
new StringType (),
76
- new AccessoryNonEmptyStringType (),
76
+ new AccessoryNonFalsyStringType (),
77
77
]);
78
78
}
79
79
if ($ resolvedConstantName === 'PHP_MAJOR_VERSION ' ) {
@@ -106,7 +106,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
106
106
if ($ resolvedConstantName === 'PHP_OS ' ) {
107
107
return new IntersectionType ([
108
108
new StringType (),
109
- new AccessoryNonEmptyStringType (),
109
+ new AccessoryNonFalsyStringType (),
110
110
]);
111
111
}
112
112
if ($ resolvedConstantName === 'PHP_OS_FAMILY ' ) {
@@ -132,7 +132,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
132
132
new ConstantStringType ('phpdbg ' ),
133
133
new IntersectionType ([
134
134
new StringType (),
135
- new AccessoryNonEmptyStringType (),
135
+ new AccessoryNonFalsyStringType (),
136
136
]),
137
137
]);
138
138
}
@@ -165,61 +165,61 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
165
165
if ($ resolvedConstantName === 'PHP_EXTENSION_DIR ' ) {
166
166
return new IntersectionType ([
167
167
new StringType (),
168
- new AccessoryNonEmptyStringType (),
168
+ new AccessoryNonFalsyStringType (),
169
169
]);
170
170
}
171
171
if ($ resolvedConstantName === 'PHP_PREFIX ' ) {
172
172
return new IntersectionType ([
173
173
new StringType (),
174
- new AccessoryNonEmptyStringType (),
174
+ new AccessoryNonFalsyStringType (),
175
175
]);
176
176
}
177
177
if ($ resolvedConstantName === 'PHP_BINDIR ' ) {
178
178
return new IntersectionType ([
179
179
new StringType (),
180
- new AccessoryNonEmptyStringType (),
180
+ new AccessoryNonFalsyStringType (),
181
181
]);
182
182
}
183
183
if ($ resolvedConstantName === 'PHP_BINARY ' ) {
184
184
return new IntersectionType ([
185
185
new StringType (),
186
- new AccessoryNonEmptyStringType (),
186
+ new AccessoryNonFalsyStringType (),
187
187
]);
188
188
}
189
189
if ($ resolvedConstantName === 'PHP_MANDIR ' ) {
190
190
return new IntersectionType ([
191
191
new StringType (),
192
- new AccessoryNonEmptyStringType (),
192
+ new AccessoryNonFalsyStringType (),
193
193
]);
194
194
}
195
195
if ($ resolvedConstantName === 'PHP_LIBDIR ' ) {
196
196
return new IntersectionType ([
197
197
new StringType (),
198
- new AccessoryNonEmptyStringType (),
198
+ new AccessoryNonFalsyStringType (),
199
199
]);
200
200
}
201
201
if ($ resolvedConstantName === 'PHP_DATADIR ' ) {
202
202
return new IntersectionType ([
203
203
new StringType (),
204
- new AccessoryNonEmptyStringType (),
204
+ new AccessoryNonFalsyStringType (),
205
205
]);
206
206
}
207
207
if ($ resolvedConstantName === 'PHP_SYSCONFDIR ' ) {
208
208
return new IntersectionType ([
209
209
new StringType (),
210
- new AccessoryNonEmptyStringType (),
210
+ new AccessoryNonFalsyStringType (),
211
211
]);
212
212
}
213
213
if ($ resolvedConstantName === 'PHP_LOCALSTATEDIR ' ) {
214
214
return new IntersectionType ([
215
215
new StringType (),
216
- new AccessoryNonEmptyStringType (),
216
+ new AccessoryNonFalsyStringType (),
217
217
]);
218
218
}
219
219
if ($ resolvedConstantName === 'PHP_CONFIG_FILE_PATH ' ) {
220
220
return new IntersectionType ([
221
221
new StringType (),
222
- new AccessoryNonEmptyStringType (),
222
+ new AccessoryNonFalsyStringType (),
223
223
]);
224
224
}
225
225
if ($ resolvedConstantName === 'PHP_SHLIB_SUFFIX ' ) {
@@ -232,7 +232,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
232
232
return IntegerRangeType::fromInterval (1 , null );
233
233
}
234
234
if ($ resolvedConstantName === '__COMPILER_HALT_OFFSET__ ' ) {
235
- return IntegerRangeType::fromInterval (0 , null );
235
+ return IntegerRangeType::fromInterval (1 , null );
236
236
}
237
237
// core other, https://www.php.net/manual/en/info.constants.php
238
238
if ($ resolvedConstantName === 'PHP_WINDOWS_VERSION_MAJOR ' ) {
@@ -261,7 +261,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
261
261
if ($ resolvedConstantName === 'ICONV_IMPL ' ) {
262
262
return new IntersectionType ([
263
263
new StringType (),
264
- new AccessoryNonEmptyStringType (),
264
+ new AccessoryNonFalsyStringType (),
265
265
]);
266
266
}
267
267
// libxml, https://www.php.net/manual/en/libxml.constants.php
@@ -271,7 +271,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
271
271
if ($ resolvedConstantName === 'LIBXML_DOTTED_VERSION ' ) {
272
272
return new IntersectionType ([
273
273
new StringType (),
274
- new AccessoryNonEmptyStringType (),
274
+ new AccessoryNonFalsyStringType (),
275
275
]);
276
276
}
277
277
// openssl, https://www.php.net/manual/en/openssl.constants.php
0 commit comments