Skip to content

Fix warning for rfc/deprecate-implicitly-nullable-types and Add php version 8.2 ~ 8.4 to strategy matrix #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4, 8.0, 8.1]
php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]

steps:
- name: Checkout code
Expand Down
12 changes: 6 additions & 6 deletions src/Codeception/Specify.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ trait Specify
getCurrentSpecifyTest as public;
}

public function specify(string $thing, Closure $code = null, $examples = []): ?self
public function specify(string $thing, ?Closure $code = null, $examples = []): ?self
{
if ($code instanceof Closure) {
$this->runSpec($thing, $code, $examples);
Expand All @@ -27,7 +27,7 @@ public function specify(string $thing, Closure $code = null, $examples = []): ?s
return $this;
}

public function describe(string $feature, Closure $code = null): ?self
public function describe(string $feature, ?Closure $code = null): ?self
{
if ($code instanceof Closure) {
$this->runSpec($feature, $code);
Expand All @@ -37,7 +37,7 @@ public function describe(string $feature, Closure $code = null): ?self
return $this;
}

public function it(string $specification, Closure $code = null, $examples = []): self
public function it(string $specification, ?Closure $code = null, $examples = []): self
{
if ($code instanceof Closure) {
$this->runSpec($specification, $code, $examples);
Expand All @@ -48,12 +48,12 @@ public function it(string $specification, Closure $code = null, $examples = []):
return $this;
}

public function its(string $specification, Closure $code = null, $examples = []): self
public function its(string $specification, ?Closure $code = null, $examples = []): self
{
return $this->it($specification, $code, $examples);
}

public function should(string $behavior, Closure $code = null, $examples = []): self
public function should(string $behavior, ?Closure $code = null, $examples = []): self
{
if ($code instanceof Closure) {
$this->runSpec('should ' . $behavior, $code, $examples);
Expand All @@ -64,7 +64,7 @@ public function should(string $behavior, Closure $code = null, $examples = []):
return $this;
}

public function shouldNot(string $behavior, Closure $code = null, $examples = []): self
public function shouldNot(string $behavior, ?Closure $code = null, $examples = []): self
{
if ($code instanceof Closure) {
$this->runSpec('should not ' . $behavior, $code, $examples);
Expand Down
6 changes: 3 additions & 3 deletions src/Codeception/Specify/SpecifyHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private function getCurrentSpecifyTest(): SpecifyTest
* @param Closure|null $callable
* @param callable|array $params
*/
private function runSpec(string $specification, Closure $callable = null, $params = [])
private function runSpec(string $specification, ?Closure $callable = null, $params = [])
{
if ($callable === null) {
return;
Expand Down Expand Up @@ -204,12 +204,12 @@ private function specifyCloneProperties(array $properties)
}
}

private function beforeSpecify(Closure $callable = null)
private function beforeSpecify(?Closure $callable = null)
{
$this->beforeSpecify[] = $callable->bindTo($this);
}

private function afterSpecify(Closure $callable = null)
private function afterSpecify(?Closure $callable = null)
{
$this->afterSpecify[] = $callable->bindTo($this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Specify/SpecifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function count(): int
/**
* Runs a test and collects its result in a TestResult instance.
*/
public function run(TestResult $result = null): TestResult
public function run(?TestResult $result = null): TestResult
{
try {
call_user_func_array($this->test, $this->example);
Expand Down