Code quality improvements

This commit is contained in:
Nuno Maduro
2022-09-16 11:27:17 +01:00
parent e9564febaf
commit 45011ebd14
42 changed files with 266 additions and 278 deletions

View File

@ -46,8 +46,8 @@ final class UsesCall
* @param array<int, string> $classAndTraits
*/
public function __construct(
private string $filename,
private array $classAndTraits
private readonly string $filename,
private readonly array $classAndTraits
) {
$this->targets = [$filename];
}
@ -87,7 +87,7 @@ final class UsesCall
/**
* Sets the test group(s).
*/
public function group(string ...$groups): UsesCall
public function group(string ...$groups): self
{
$this->groups = array_values($groups);
@ -97,7 +97,7 @@ final class UsesCall
/**
* Sets the global beforeAll test hook.
*/
public function beforeAll(Closure $hook): UsesCall
public function beforeAll(Closure $hook): self
{
$this->hooks[0] = $hook;
@ -107,7 +107,7 @@ final class UsesCall
/**
* Sets the global beforeEach test hook.
*/
public function beforeEach(Closure $hook): UsesCall
public function beforeEach(Closure $hook): self
{
$this->hooks[1] = $hook;
@ -117,7 +117,7 @@ final class UsesCall
/**
* Sets the global afterEach test hook.
*/
public function afterEach(Closure $hook): UsesCall
public function afterEach(Closure $hook): self
{
$this->hooks[2] = $hook;
@ -127,7 +127,7 @@ final class UsesCall
/**
* Sets the global afterAll test hook.
*/
public function afterAll(Closure $hook): UsesCall
public function afterAll(Closure $hook): self
{
$this->hooks[3] = $hook;