Skip to content

Commit 4e3989a

Browse files
authored
Update codebase to PHP 7.4 (#37)
1 parent 0eafd5c commit 4e3989a

File tree

16 files changed

+483
-554
lines changed

16 files changed

+483
-554
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.2, 7.3, 7.4, 8.0]
11+
php: [7.4, 8.0, 8.1]
1212

1313
steps:
1414
- name: Checkout code

RoboFile.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Robo\Tasks;
6+
27
require_once 'vendor/autoload.php';
38
/**
49
* This is project's console commands configuration for Robo task runner.
510
*
6-
* @see http://robo.li/
11+
* @see https://robo.li/
712
*/
8-
class RoboFile extends \Robo\Tasks
13+
class RoboFile extends Tasks
914
{
1015
protected $docs = [
1116
'docs/Stub.md' => 'Codeception\Stub',
@@ -22,15 +27,15 @@ public function docs()
2227
$this->say("Here goes, $class");
2328
$this->taskGenDoc($file)
2429
->docClass($class)
25-
->filterMethods(function(\ReflectionMethod $method) {
30+
->filterMethods(function(ReflectionMethod $method) {
2631
if ($method->isConstructor() or $method->isDestructor()) return false;
2732
if (!$method->isPublic()) return false;
2833
if (strpos($method->name, '_') === 0) return false;
2934
if (strpos($method->name, 'stub') === 0) return false;
3035
return true;
3136
})
3237
->processMethodDocBlock(
33-
function (\ReflectionMethod $m, $doc) {
38+
function (ReflectionMethod $m, $doc) {
3439
$doc = str_replace(array('@since'), array(' * available since version'), $doc);
3540
$doc = str_replace(array(' @', "\n@"), array(" * ", "\n * "), $doc);
3641
return $doc;

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
},
1212
"require": {
1313
"phpunit/phpunit": "^8.4 | ^9.0"
14+
},
15+
"require-dev": {
16+
"consolidation/robo": "^3.0"
1417
}
1518
}

docs/Expected.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ $user = $this->make('User', [
1818
'someMethod' => function() {}
1919
]);
2020
$user->someMethod();
21-
?>
2221
```
2322

2423
* `param mixed` $params
25-
* return StubMarshaler
2624

2725
#### *public static* once($params = null)
2826
Checks if a method has been invoked exactly one
@@ -44,7 +42,6 @@ $user = $this->make(
4442
);
4543
$userName = $user->getName();
4644
$this->assertEquals('Davert', $userName);
47-
?>
4845
```
4946
Alternatively, a function can be passed as parameter:
5047

@@ -55,8 +52,6 @@ Expected::once(function() { return Faker::name(); });
5552

5653
* `param mixed` $params
5754

58-
* return StubMarshaler
59-
6055
#### *public static* atLeastOnce($params = null)
6156
Checks if a method has been invoked at least one
6257
time.
@@ -77,7 +72,6 @@ $user = $this->make(
7772
$user->getName();
7873
$userName = $user->getName();
7974
$this->assertEquals('Davert', $userName);
80-
?>
8175
```
8276

8377
Alternatively, a function can be passed as parameter:
@@ -89,8 +83,6 @@ Expected::atLeastOnce(function() { return Faker::name(); });
8983

9084
* `param mixed` $params
9185

92-
* return StubMarshaler
93-
9486
#### *public static* exactly($count, $params = null)
9587
Checks if a method has been invoked a certain amount
9688
of times.
@@ -115,7 +107,6 @@ $user->getName();
115107
$user->getName();
116108
$userName = $user->getName();
117109
$this->assertEquals('Davert', $userName);
118-
?>
119110
```
120111
Alternatively, a function can be passed as parameter:
121112

@@ -124,9 +115,6 @@ Alternatively, a function can be passed as parameter:
124115
Expected::exactly(function() { return Faker::name() });
125116
```
126117

127-
* `param int` $count
128118
* `param mixed` $params
129119

130-
* return StubMarshaler
131-
132120

0 commit comments

Comments
 (0)