Skip to content

Commit

Permalink
Replace docblock union-typehints in tests by native intersection type…
Browse files Browse the repository at this point in the history
…-hints
  • Loading branch information
usox committed Nov 12, 2023
1 parent 1d572a9 commit 32ee179
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
11 changes: 4 additions & 7 deletions tests/Dispatch/MethodDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@

class MethodDispatcherTest extends MockeryTestCase
{
/** @var MockInterface|SchemaLoaderInterface */
private MockInterface $schemaLoader;
private MockInterface&SchemaLoaderInterface $schemaLoader;

/** @var MethodValidatorInterface|MockInterface */
private MockInterface $methodValidator;
private MockInterface&MethodValidatorInterface $methodValidator;

/** @var MethodProviderInterface|MockInterface */
private MockInterface $methodProvider;
private MockInterface&MethodProviderInterface $methodProvider;

private MockInterface $logger;
private MockInterface&LoggerInterface $logger;

private MethodDispatcher $subject;

Expand Down
5 changes: 2 additions & 3 deletions tests/Dispatch/MethodValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@

class MethodValidatorTest extends MockeryTestCase
{
/** @var Validator|MockInterface */
private MockInterface $schemaValidator;
private MockInterface&Validator $schemaValidator;

private MockInterface $errorFormatter;
private MockInterface&ErrorFormatter $errorFormatter;

private MethodValidator $subject;

Expand Down
6 changes: 2 additions & 4 deletions tests/Dispatch/RequestValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@

class RequestValidatorTest extends MockeryTestCase
{
/** @var MockInterface|SchemaLoaderInterface */
private MockInterface $schemaLoader;
private MockInterface&SchemaLoaderInterface $schemaLoader;

/** @var MockInterface|Validator */
private MockInterface $validator;
private MockInterface&Validator $validator;

private RequestValidator $subject;

Expand Down
14 changes: 7 additions & 7 deletions tests/EndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@

class EndpointTest extends MockeryTestCase
{
private MockInterface $requestValidator;
private MockInterface&RequestValidatorInterface $requestValidator;

private MockInterface $methodDispatcher;
private MockInterface&MethodDispatcherInterface $methodDispatcher;

private MockInterface $responseBuilder;
private MockInterface&ResponseBuilderInterface $responseBuilder;

private MockInterface $uuidFactory;
private MockInterface&UuidFactoryInterface $uuidFactory;

private MockInterface $streamFactory;
private MockInterface&StreamFactoryInterface $streamFactory;

private MockInterface $responseFactory;
private MockInterface&ResponseFactoryInterface $responseFactory;

private MockInterface $logger;
private MockInterface&LoggerInterface $logger;

private Endpoint $subject;

Expand Down
1 change: 0 additions & 1 deletion tests/Response/ResponseBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class ResponseBuilderTest extends MockeryTestCase
{
/** @var ResponseBuilder|null */
private ResponseBuilder $subject;

public function setUp(): void
Expand Down

0 comments on commit 32ee179

Please sign in to comment.