Skip to content

Commit

Permalink
Update codebase to PHP 7.4 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
TavoNiievez authored Nov 30, 2021
1 parent 0eafd5c commit 4e3989a
Show file tree
Hide file tree
Showing 16 changed files with 483 additions and 554 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
php: [7.2, 7.3, 7.4, 8.0]
php: [7.4, 8.0, 8.1]

steps:
- name: Checkout code
Expand Down
13 changes: 9 additions & 4 deletions RoboFile.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<?php

declare(strict_types=1);

use Robo\Tasks;

require_once 'vendor/autoload.php';
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
* @see https://robo.li/
*/
class RoboFile extends \Robo\Tasks
class RoboFile extends Tasks
{
protected $docs = [
'docs/Stub.md' => 'Codeception\Stub',
Expand All @@ -22,15 +27,15 @@ public function docs()
$this->say("Here goes, $class");
$this->taskGenDoc($file)
->docClass($class)
->filterMethods(function(\ReflectionMethod $method) {
->filterMethods(function(ReflectionMethod $method) {
if ($method->isConstructor() or $method->isDestructor()) return false;
if (!$method->isPublic()) return false;
if (strpos($method->name, '_') === 0) return false;
if (strpos($method->name, 'stub') === 0) return false;
return true;
})
->processMethodDocBlock(
function (\ReflectionMethod $m, $doc) {
function (ReflectionMethod $m, $doc) {
$doc = str_replace(array('@since'), array(' * available since version'), $doc);
$doc = str_replace(array(' @', "\n@"), array(" * ", "\n * "), $doc);
return $doc;
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
},
"require": {
"phpunit/phpunit": "^8.4 | ^9.0"
},
"require-dev": {
"consolidation/robo": "^3.0"
}
}
12 changes: 0 additions & 12 deletions docs/Expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ $user = $this->make('User', [
'someMethod' => function() {}
]);
$user->someMethod();
?>
```

* `param mixed` $params
* return StubMarshaler

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

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

* `param mixed` $params

* return StubMarshaler

#### *public static* atLeastOnce($params = null)
Checks if a method has been invoked at least one
time.
Expand All @@ -77,7 +72,6 @@ $user = $this->make(
$user->getName();
$userName = $user->getName();
$this->assertEquals('Davert', $userName);
?>
```

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

* `param mixed` $params

* return StubMarshaler

#### *public static* exactly($count, $params = null)
Checks if a method has been invoked a certain amount
of times.
Expand All @@ -115,7 +107,6 @@ $user->getName();
$user->getName();
$userName = $user->getName();
$this->assertEquals('Davert', $userName);
?>
```
Alternatively, a function can be passed as parameter:

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

* `param int` $count
* `param mixed` $params

* return StubMarshaler


Loading

0 comments on commit 4e3989a

Please sign in to comment.