feat: improves auto-completion

This commit is contained in:
Nuno Maduro
2023-02-14 08:56:46 +00:00
parent 7fe8399d48
commit 7fdc7d6997

View File

@ -43,7 +43,7 @@ if (! function_exists('beforeEach')) {
/** /**
* Runs the given closure before each test in the current file. * Runs the given closure before each test in the current file.
* *
* @return BeforeEachCall|TestCase|mixed * @return HigherOrderTapProxy<TestCall|TestCase>|TestCall|mixed
*/ */
function beforeEach(Closure $closure = null): BeforeEachCall function beforeEach(Closure $closure = null): BeforeEachCall
{ {
@ -62,6 +62,7 @@ if (! function_exists('dataset')) {
function dataset(string $name, Closure|iterable $dataset): void function dataset(string $name, Closure|iterable $dataset): void
{ {
$scope = DatasetInfo::scope(Backtrace::datasetsFile()); $scope = DatasetInfo::scope(Backtrace::datasetsFile());
DatasetsRepository::set($name, $dataset, $scope); DatasetsRepository::set($name, $dataset, $scope);
} }
} }
@ -87,7 +88,7 @@ if (! function_exists('test')) {
* is the test description; the second argument is * is the test description; the second argument is
* a closure that contains the test expectations. * a closure that contains the test expectations.
* *
* @return HigherOrderTapProxy<TestCall|TestCase>|TestCall * @return HigherOrderTapProxy<TestCall|TestCase>|TestCall|mixed
*/ */
function test(string $description = null, Closure $closure = null): HigherOrderTapProxy|TestCall function test(string $description = null, Closure $closure = null): HigherOrderTapProxy|TestCall
{ {
@ -107,7 +108,7 @@ if (! function_exists('it')) {
* is the test description; the second argument is * is the test description; the second argument is
* a closure that contains the test expectations. * a closure that contains the test expectations.
* *
* @return TestCall|TestCase|mixed * @return HigherOrderTapProxy<TestCall|TestCase>|TestCall|mixed
*/ */
function it(string $description, Closure $closure = null): TestCall function it(string $description, Closure $closure = null): TestCall
{ {
@ -126,7 +127,7 @@ if (! function_exists('todo')) {
* is marked as incomplete. Yet, Collision, Pest's * is marked as incomplete. Yet, Collision, Pest's
* printer, will display it as a "todo" test. * printer, will display it as a "todo" test.
* *
* @return TestCall|TestCase|mixed * @return HigherOrderTapProxy<TestCall|TestCase>|TestCall|mixed
*/ */
function todo(string $description): TestCall function todo(string $description): TestCall
{ {
@ -142,7 +143,7 @@ if (! function_exists('afterEach')) {
/** /**
* Runs the given closure after each test in the current file. * Runs the given closure after each test in the current file.
* *
* @return AfterEachCall|TestCase|mixed * @return HigherOrderTapProxy<TestCall|TestCase>|TestCall|mixed
*/ */
function afterEach(Closure $closure = null): AfterEachCall function afterEach(Closure $closure = null): AfterEachCall
{ {