Skip to content

Commit 0f92a44

Browse files
committed
removed dead code
1 parent c930ca4 commit 0f92a44

File tree

5 files changed

+7
-20
lines changed

5 files changed

+7
-20
lines changed

tests/Utils/ArrayHash.phpt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,7 @@ test('numeric key handling supports both integer and string offsets', function (
128128
$keys[] = $key;
129129
}
130130

131-
if (PHP_VERSION_ID < 70200) {
132-
Assert::same(['0', '1'], $keys);
133-
} else {
134-
Assert::same([0, 1], $keys);
135-
}
131+
Assert::same([0, 1], $keys);
136132

137133
Assert::same(1, $row->{0});
138134
Assert::same(1, $row->{'0'});
@@ -184,13 +180,13 @@ test('accessing undefined keys triggers a notice or warning', function () {
184180
$row = new ArrayHash;
185181
Assert::error(
186182
fn() => $row->undef,
187-
PHP_VERSION_ID < 80000 ? E_NOTICE : E_WARNING,
183+
E_WARNING,
188184
'Undefined property: Nette\Utils\ArrayHash::$undef',
189185
);
190186

191187
Assert::error(
192188
fn() => $row['undef'],
193-
PHP_VERSION_ID < 80000 ? E_NOTICE : E_WARNING,
189+
E_WARNING,
194190
'Undefined property: Nette\Utils\ArrayHash::$undef',
195191
);
196192
});

tests/Utils/Arrays.wrap().phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test('converts scalars to strings with error on array conversion', function () {
4242

4343
Assert::error(
4444
fn() => Arrays::wrap([[]]),
45-
PHP_VERSION_ID < 80000 ? E_NOTICE : E_WARNING,
45+
E_WARNING,
4646
'Array to string conversion',
4747
);
4848
});

tests/Utils/Callback.invokeSafe.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Callback::invokeSafe('preg_replace_callback', ['#.#', function () {
5656
throw new Exception('Should not be thrown');
5757
});
5858

59-
Assert::same(PHP_VERSION_ID < 80000 ? 'Undefined variable: a' : 'Undefined variable $a', $res);
59+
Assert::same('Undefined variable $a', $res);
6060

6161

6262
// exception inside

tests/Utils/Strings.contains().phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,4 @@ Assert::true(Strings::contains('foo', 'foo'));
1919
Assert::true(Strings::contains('123', '123'));
2020
Assert::true(Strings::contains('123', '1'));
2121
Assert::false(Strings::contains('', 'foo'));
22-
23-
if (PHP_VERSION_ID < 80000) {
24-
Assert::error(
25-
fn() => Assert::false(Strings::contains('', '')),
26-
E_WARNING,
27-
'strpos(): Empty needle',
28-
);
29-
} else {
30-
Assert::true(Strings::contains('', ''));
31-
}
22+
Assert::true(Strings::contains('', ''));

tests/Utils/Strings.replace().errors.callback.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require __DIR__ . '/../bootstrap.php';
1616
Assert::error(fn() => Strings::replace('hello', '#.+#', function ($m) {
1717
$a++; // E_NOTICE
1818
return strtoupper($m[0]);
19-
}), ...(PHP_VERSION_ID < 80000 ? [E_NOTICE, 'Undefined variable: a'] : [E_WARNING, 'Undefined variable $a']));
19+
}), E_WARNING, 'Undefined variable $a');
2020

2121

2222
Assert::same('HELLO', Strings::replace('hello', '#.+#', function ($m) {

0 commit comments

Comments
 (0)