Skip to content

Commit 5fc4c96

Browse files
authored
Update codebase to PHP 7.4 (#52)
1 parent 1cdac18 commit 5fc4c96

38 files changed

+221
-148
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php: [7.3, 7.4, 8.0]
11+
php: [7.4, 8.0, 8.1]
1212

1313
steps:
1414
- name: Checkout code

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ With [BDD][3] assertions influenced by [Chai][4], [Jasmine][5], and [RSpec][6] y
1515

1616
## Installation
1717

18-
*Requires PHP 7.1 or higher*
18+
*Requires PHP 7.4 or higher*
1919

2020
```
2121
composer require codeception/verify --dev

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.3 || ^8.0",
16+
"php": "^7.4 || ^8.0",
1717
"ext-dom": "*",
1818
"phpunit/phpunit": "^9.3"
1919
},

src/Codeception/Exception/InvalidVerifyException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Codeception\Exception;
46

src/Codeception/Verify/Asserts/AssertThrows.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Codeception\Verify\Asserts;
46

@@ -18,23 +20,23 @@ public function assertThrows($throws = null, $message = false): self
1820

1921
try {
2022
call_user_func($this->actual);
21-
} catch (Throwable $exception) {
23+
} catch (Throwable $throwable) {
2224
if (!$throws) {
2325
return $this; // it throws
2426
}
2527

26-
$actualThrows = get_class($exception);
27-
$actualMessage = $exception->getMessage();
28+
$actualThrows = get_class($throwable);
29+
$actualMessage = $throwable->getMessage();
2830

29-
Assert::assertSame($throws, $actualThrows, sprintf('exception \'%s\' was expected, but \'%s\' was thrown', $throws, $actualThrows));
31+
Assert::assertSame($throws, $actualThrows, sprintf("exception '%s' was expected, but '%s' was thrown", $throws, $actualThrows));
3032

3133
if ($message) {
32-
Assert::assertSame($message, $actualMessage, sprintf('exception message \'%s\' was expected, but \'%s\' was received', $message, $actualMessage));
34+
Assert::assertSame($message, $actualMessage, sprintf("exception message '%s' was expected, but '%s' was received", $message, $actualMessage));
3335
}
3436
}
3537

36-
if (!isset($exception)) {
37-
throw new ExpectationFailedException(sprintf('exception \'%s\' was not thrown as expected', $throws));
38+
if (!isset($throwable)) {
39+
throw new ExpectationFailedException(sprintf("exception '%s' was not thrown as expected", $throws));
3840
}
3941

4042
return $this;
@@ -62,11 +64,11 @@ public function assertDoesNotThrow($throws = null, $message = false): self
6264
}
6365

6466
if (!$message) {
65-
throw new ExpectationFailedException(sprintf('exception \'%s\' was not expected to be thrown', $throws));
67+
throw new ExpectationFailedException(sprintf("exception '%s' was not expected to be thrown", $throws));
6668
}
6769

6870
if ($message === $actualMessage) {
69-
throw new ExpectationFailedException(sprintf('exception \'%s\' with message \'%s\' was not expected to be thrown', $throws, $message));
71+
throw new ExpectationFailedException(sprintf("exception '%s' with message '%s' was not expected to be thrown", $throws, $message));
7072
}
7173
}
7274

src/Codeception/Verify/Expect.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Codeception\Verify;
46

0 commit comments

Comments
 (0)