Skip to content

Commit 4d2886a

Browse files
committed
fix 7.1
1 parent 477d393 commit 4d2886a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

phper/src/functions.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,9 @@ impl FunctionEntry {
220220
))
221221
}
222222
}
223-
#[allow(clippy::absurd_extreme_comparisons)]
224223
ReturnTypeHint::Never => {
225224
if PHP_MAJOR_VERSION < 8
226-
|| (PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION <= 1)
225+
|| (PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION < 2)
227226
{
228227
None
229228
} else {

tests/integration/tests/php/typehints.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
['testCallableOptional', 'callable', false, false],
4949
['testCallableNullable', 'callable', true, true],
5050

51-
['testObject', 'object', false, true, '7.1'],
52-
['testObjectOptional', 'object', false, false, '7.1'],
53-
['testObjectNullable', 'object', true, true, '7.1'],
51+
['testObject', 'object', false, true, '7.2'],
52+
['testObjectOptional', 'object', false, false, '7.2'],
53+
['testObjectNullable', 'object', true, true, '7.2'],
5454

5555
['testIterable', 'iterable', false, true, '7.1'],
5656
['testIterableOptional', 'iterable', false, false, '7.1'],
@@ -79,7 +79,7 @@
7979
assert_eq(1, count($params), 'has 1 param');
8080
$param = $params[0];
8181
$type = $param->getType();
82-
if (PHP_VERSION_ID >= 70100) {
82+
if (PHP_VERSION_ID >= 70200) {
8383
assert_eq($input[1], (string)$type->getName(), sprintf('%s has typehint type', $input[0]));
8484
assert_eq($input[2], $type->allowsNull(), sprintf('%s allows null', $input[0]));
8585
assert_eq($input[3], !$param->isOptional(), sprintf('%s is optional', $input[0]));
@@ -127,7 +127,7 @@
127127
}
128128
$reflectionMethod = $reflection->getMethod($input[0]);
129129
$return = $reflectionMethod->getReturnType();
130-
if ($input[1] !== 'never' && PHP_VERSION_ID > 70100) {
130+
if ($input[1] !== 'never' && PHP_VERSION_ID > 70200) {
131131
assert_eq($input[1], $return->getName(), sprintf('%s has typehint type', $input[0]));
132132
assert_eq($input[2], $return->allowsNull(), sprintf('%s allows null', $input[0]));
133133
}

0 commit comments

Comments
 (0)