Skip to content

Commit 3fd0b0b

Browse files
simPodondrejmirtes
authored andcommitted
Drop nullable type hints from callbacks in AssertHelper
1 parent 1ba7ef1 commit 3fd0b0b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/Type/BeberleiAssert/AssertHelper.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -222,37 +222,37 @@ private static function getExpressionResolvers(): array
222222
{
223223
if (self::$resolvers === null) {
224224
self::$resolvers = [
225-
'integer' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
225+
'integer' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
226226
return new \PhpParser\Node\Expr\FuncCall(
227227
new \PhpParser\Node\Name('is_int'),
228228
[$value]
229229
);
230230
},
231-
'string' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
231+
'string' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
232232
return new \PhpParser\Node\Expr\FuncCall(
233233
new \PhpParser\Node\Name('is_string'),
234234
[$value]
235235
);
236236
},
237-
'float' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
237+
'float' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
238238
return new \PhpParser\Node\Expr\FuncCall(
239239
new \PhpParser\Node\Name('is_float'),
240240
[$value]
241241
);
242242
},
243-
'numeric' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
243+
'numeric' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
244244
return new \PhpParser\Node\Expr\FuncCall(
245245
new \PhpParser\Node\Name('is_numeric'),
246246
[$value]
247247
);
248248
},
249-
'boolean' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
249+
'boolean' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
250250
return new \PhpParser\Node\Expr\FuncCall(
251251
new \PhpParser\Node\Name('is_bool'),
252252
[$value]
253253
);
254254
},
255-
'scalar' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
255+
'scalar' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
256256
return new \PhpParser\Node\Expr\FuncCall(
257257
new \PhpParser\Node\Name('is_scalar'),
258258
[$value]
@@ -269,19 +269,19 @@ private static function getExpressionResolvers(): array
269269
[$value]
270270
);
271271
},
272-
'isResource' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
272+
'isResource' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
273273
return new \PhpParser\Node\Expr\FuncCall(
274274
new \PhpParser\Node\Name('is_resource'),
275275
[$value]
276276
);
277277
},
278-
'isCallable' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
278+
'isCallable' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
279279
return new \PhpParser\Node\Expr\FuncCall(
280280
new \PhpParser\Node\Name('is_callable'),
281281
[$value]
282282
);
283283
},
284-
'isArray' => function (Scope $scope, Arg $value): ?\PhpParser\Node\Expr {
284+
'isArray' => function (Scope $scope, Arg $value): \PhpParser\Node\Expr {
285285
return new \PhpParser\Node\Expr\FuncCall(
286286
new \PhpParser\Node\Name('is_array'),
287287
[$value]
@@ -311,43 +311,43 @@ private static function getExpressionResolvers(): array
311311
)
312312
);
313313
},
314-
'true' => function (Scope $scope, Arg $expr): ?\PhpParser\Node\Expr {
314+
'true' => function (Scope $scope, Arg $expr): \PhpParser\Node\Expr {
315315
return new \PhpParser\Node\Expr\BinaryOp\Identical(
316316
$expr->value,
317317
new \PhpParser\Node\Expr\ConstFetch(new \PhpParser\Node\Name('true'))
318318
);
319319
},
320-
'false' => function (Scope $scope, Arg $expr): ?\PhpParser\Node\Expr {
320+
'false' => function (Scope $scope, Arg $expr): \PhpParser\Node\Expr {
321321
return new \PhpParser\Node\Expr\BinaryOp\Identical(
322322
$expr->value,
323323
new \PhpParser\Node\Expr\ConstFetch(new \PhpParser\Node\Name('false'))
324324
);
325325
},
326-
'null' => function (Scope $scope, Arg $expr): ?\PhpParser\Node\Expr {
326+
'null' => function (Scope $scope, Arg $expr): \PhpParser\Node\Expr {
327327
return new \PhpParser\Node\Expr\BinaryOp\Identical(
328328
$expr->value,
329329
new \PhpParser\Node\Expr\ConstFetch(new \PhpParser\Node\Name('null'))
330330
);
331331
},
332-
'notNull' => function (Scope $scope, Arg $expr): ?\PhpParser\Node\Expr {
332+
'notNull' => function (Scope $scope, Arg $expr): \PhpParser\Node\Expr {
333333
return new \PhpParser\Node\Expr\BinaryOp\NotIdentical(
334334
$expr->value,
335335
new \PhpParser\Node\Expr\ConstFetch(new \PhpParser\Node\Name('null'))
336336
);
337337
},
338-
'same' => function (Scope $scope, Arg $value1, Arg $value2): ?\PhpParser\Node\Expr {
338+
'same' => function (Scope $scope, Arg $value1, Arg $value2): \PhpParser\Node\Expr {
339339
return new \PhpParser\Node\Expr\BinaryOp\Identical(
340340
$value1->value,
341341
$value2->value
342342
);
343343
},
344-
'notSame' => function (Scope $scope, Arg $value1, Arg $value2): ?\PhpParser\Node\Expr {
344+
'notSame' => function (Scope $scope, Arg $value1, Arg $value2): \PhpParser\Node\Expr {
345345
return new \PhpParser\Node\Expr\BinaryOp\NotIdentical(
346346
$value1->value,
347347
$value2->value
348348
);
349349
},
350-
'subclassOf' => function (Scope $scope, Arg $expr, Arg $class): ?\PhpParser\Node\Expr {
350+
'subclassOf' => function (Scope $scope, Arg $expr, Arg $class): \PhpParser\Node\Expr {
351351
return new \PhpParser\Node\Expr\FuncCall(
352352
new \PhpParser\Node\Name('is_subclass_of'),
353353
[

0 commit comments

Comments
 (0)