style: address stan + lint issues

This commit is contained in:
jordanbrauer
2021-04-06 19:32:49 -05:00
parent ff44589572
commit 54f9397f47
7 changed files with 10 additions and 16 deletions

View File

@ -5,9 +5,8 @@ declare(strict_types=1);
namespace Pest\Concerns; namespace Pest\Concerns;
use Closure; use Closure;
use Pest\Repositories\BeforeEachRepository;
use Pest\Support\ExceptionTrace;
use Pest\Support\ChainableClosure; use Pest\Support\ChainableClosure;
use Pest\Support\ExceptionTrace;
use Pest\TestSuite; use Pest\TestSuite;
use PHPUnit\Framework\ExecutionOrderDependency; use PHPUnit\Framework\ExecutionOrderDependency;
use PHPUnit\Util\Test; use PHPUnit\Util\Test;
@ -58,7 +57,7 @@ trait TestCase
public function __construct(Closure $test, string $description, array $data) public function __construct(Closure $test, string $description, array $data)
{ {
$this->__test = $test; $this->__test = $test;
$this->__description = $description; $this->__description = $description;
parent::__construct('__test', $data); parent::__construct('__test', $data);
} }
@ -173,7 +172,7 @@ trait TestCase
$beforeEach = TestSuite::getInstance()->beforeEach->get(self::$__filename); $beforeEach = TestSuite::getInstance()->beforeEach->get(self::$__filename);
if ($this->beforeEach instanceof Closure) { if ($this->beforeEach instanceof Closure) {
$beforeEach = ChainableClosure::from($this->beforeEach, $beforeEach); $beforeEach = ChainableClosure::from($this->beforeEach, $beforeEach);
} }
@ -187,7 +186,7 @@ trait TestCase
{ {
$afterEach = TestSuite::getInstance()->afterEach->get(self::$__filename); $afterEach = TestSuite::getInstance()->afterEach->get(self::$__filename);
if ($this->afterEach instanceof Closure) { if ($this->afterEach instanceof Closure) {
$afterEach = ChainableClosure::from($this->afterEach, $afterEach); $afterEach = ChainableClosure::from($this->afterEach, $afterEach);
} }

View File

@ -25,7 +25,7 @@ final class TestRepository
private $state = []; private $state = [];
/** /**
* @var array<string, array<int, array<int, string>>> * @var array<string, array<int, array<int, string, Closure>>>
*/ */
private $uses = []; private $uses = [];
@ -96,10 +96,10 @@ final class TestRepository
/** /**
* Uses the given `$testCaseClass` on the given `$paths`. * Uses the given `$testCaseClass` on the given `$paths`.
* *
* @param array<int, string> $classOrTraits * @param array<int, string> $classOrTraits
* @param array<int, string> $groups * @param array<int, string> $groups
* @param array<int, string> $paths * @param array<int, string> $paths
* @param array<intm Closure> $hooks * @param array<int, Closure> $hooks
*/ */
public function use(array $classOrTraits, array $groups, array $paths, array $hooks): void public function use(array $classOrTraits, array $groups, array $paths, array $hooks): void
{ {

View File

@ -8,4 +8,3 @@ afterAll(function () {
test('global afterAll execution order', function () { test('global afterAll execution order', function () {
}); });

View File

@ -21,4 +21,3 @@ test('global afterEach execution order', function () {
->not() ->not()
->toHaveProperty('ith'); ->toHaveProperty('ith');
}); });

View File

@ -8,4 +8,3 @@ beforeAll(function () {
test('global beforeAll execution order', function () { test('global beforeAll execution order', function () {
}); });

View File

@ -24,4 +24,3 @@ test('global beforeEach execution order', function () {
->and($this->baz) ->and($this->baz)
->toBe(2); ->toBe(2);
}); });

View File

@ -10,10 +10,9 @@ uses()
// dump(0); // dump(0);
// }) // })
->afterEach(function () { ->afterEach(function () {
$this->ith = 0; $this->ith = 0;
}) })
// ->afterAll(function () { // ->afterAll(function () {
// dump(0); // dump(0);
// }) // })
->in('Hooks'); ->in('Hooks');