chore: style changes

This commit is contained in:
Nuno Maduro
2023-01-11 20:11:36 +00:00
parent 0675529320
commit 349e2f45df
14 changed files with 78 additions and 40 deletions

View File

@ -1,21 +0,0 @@
<?php
declare(strict_types=1);
namespace Pest\Factories\Annotations;
use Pest\Factories\TestCaseMethodFactory;
/**
* @interal
*/
interface AddsAnnotation
{
/**
* Adds annotations to method
*
* @param array<int, string> $annotations
* @return array<int, string>
*/
public function __invoke(TestCaseMethodFactory $method, array $annotations): array;
}

View File

@ -4,19 +4,17 @@ declare(strict_types=1);
namespace Pest\Factories\Annotations;
use Pest\Contracts\AddsAnnotations;
use Pest\Factories\Covers\CoversNothing as CoversNothingFactory;
use Pest\Factories\TestCaseMethodFactory;
/**
* @internal
*/
final class CoversNothing implements AddsAnnotation
final class CoversNothing implements AddsAnnotations
{
/**
* Adds annotations regarding the "depends" feature.
*
* @param array<int, string> $annotations
* @return array<int, string>
* {@inheritdoc}
*/
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
{

View File

@ -4,19 +4,17 @@ declare(strict_types=1);
namespace Pest\Factories\Annotations;
use Pest\Contracts\AddsAnnotations;
use Pest\Factories\TestCaseMethodFactory;
use Pest\Support\Str;
/**
* @internal
*/
final class Depends implements AddsAnnotation
final class Depends implements AddsAnnotations
{
/**
* Adds annotations regarding the "depends" feature.
*
* @param array<int, string> $annotations
* @return array<int, string>
* {@inheritdoc}
*/
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
{

View File

@ -4,18 +4,16 @@ declare(strict_types=1);
namespace Pest\Factories\Annotations;
use Pest\Contracts\AddsAnnotations;
use Pest\Factories\TestCaseMethodFactory;
/**
* @internal
*/
final class Groups implements AddsAnnotation
final class Groups implements AddsAnnotations
{
/**
* Adds annotations regarding the "groups" feature.
*
* @param array<int, string> $annotations
* @return array<int, string>
* {@inheritdoc}
*/
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
{

View File

@ -4,19 +4,16 @@ declare(strict_types=1);
namespace Pest\Factories\Annotations;
use Pest\Contracts\AddsAnnotations;
use Pest\Factories\TestCaseMethodFactory;
final class TestDox implements AddsAnnotation
final class TestDox implements AddsAnnotations
{
/**
* Add metadata via test dox for TeamCity
*
* @param array<int, string> $annotations
* @return array<int, string>
* {@inheritdoc}
*/
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
{
// First test dox on class overrides the method name.
$annotations[] = "@testdox $method->description";
return $annotations;

View File

@ -6,12 +6,12 @@ namespace Pest\Factories;
use ParseError;
use Pest\Concerns;
use Pest\Contracts\AddsAnnotations;
use Pest\Contracts\HasPrintableTestCaseName;
use Pest\Exceptions\DatasetMissing;
use Pest\Exceptions\ShouldNotHappen;
use Pest\Exceptions\TestAlreadyExist;
use Pest\Exceptions\TestDescriptionMissing;
use Pest\Factories\Annotations\AddsAnnotation;
use Pest\Factories\Concerns\HigherOrderable;
use Pest\Plugins\Environment;
use Pest\Support\Reflection;
@ -30,7 +30,7 @@ final class TestCaseFactory
/**
* The list of annotations.
*
* @var array<int, class-string<AddsAnnotation>>
* @var array<int, class-string<AddsAnnotations>>
*/
private const ANNOTATIONS = [
Annotations\Depends::class,

View File

@ -5,8 +5,8 @@ declare(strict_types=1);
namespace Pest\Factories;
use Closure;
use Pest\Contracts\AddsAnnotations;
use Pest\Exceptions\ShouldNotHappen;
use Pest\Factories\Annotations\AddsAnnotation;
use Pest\Factories\Concerns\HigherOrderable;
use Pest\Plugins\Retry;
use Pest\Repositories\DatasetsRepository;
@ -113,7 +113,7 @@ final class TestCaseMethodFactory
/**
* Creates a PHPUnit method as a string ready for evaluation.
*
* @param array<int, class-string<AddsAnnotation>> $annotationsToUse
* @param array<int, class-string<AddsAnnotations>> $annotationsToUse
* @param array<int, class-string<\Pest\Factories\Attributes\Attribute>> $attributesToUse
*/
public function buildForEvaluation(string $classFQN, array $annotationsToUse, array $attributesToUse): string