Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
usox committed Feb 11, 2024
1 parent fdd0abc commit 5f47b53
Show file tree
Hide file tree
Showing 11 changed files with 284 additions and 317 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"psr/http-server-handler": "^1.0",
"psr/log": "^1.1||^3",
"ramsey/uuid": "^4.1",
"teapot/status-code": "^1.1"
"teapot/status-code": "^2"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +40,7 @@
"phpstan/phpstan-mockery": "^1",
"phpstan/phpstan-strict-rules": "^1",
"phpunit/phpunit": "^10",
"rector/rector": "^0.18"
"rector/rector": "^1"
},
"config": {
"sort-packages": true,
Expand Down
519 changes: 254 additions & 265 deletions composer.lock

Large diffs are not rendered by default.

27 changes: 11 additions & 16 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,19 @@
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->importNames();

$rectorConfig->paths([
return RectorConfig::configure()
->withImportNames()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests'
]);

$rectorConfig->import(SetList::CODE_QUALITY);
$rectorConfig->import(SetList::DEAD_CODE);
$rectorConfig->import(SetList::PHP_81);

$rectorConfig->rule(ClassPropertyAssignToConstructorPromotionRector::class);
$rectorConfig->rule(RemoveUnusedVariableInCatchRector::class);

$rectorConfig->skip([
])
->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true)
->withPhpSets(php81: true)
->withRules([
ClassPropertyAssignToConstructorPromotionRector::class,
RemoveUnusedVariableInCatchRector::class,
])
->withSkip([
FlipTypeControlToUseExclusiveTypeRector::class,
]);
};
1 change: 1 addition & 0 deletions src/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public static function factory(
if ($streamFactory === null) {
$streamFactory = Psr17FactoryDiscovery::findStreamFactory();
}

if ($responseFactory === null) {
$responseFactory = Psr17FactoryDiscovery::findResponseFactory();
}
Expand Down
6 changes: 2 additions & 4 deletions tests/Dispatch/MethodDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MethodDispatcherTest extends MockeryTestCase

private MethodDispatcher $subject;

public function setUp(): void
protected function setUp(): void
{
$this->schemaLoader = Mockery::mock(SchemaLoaderInterface::class);
$this->methodValidator = Mockery::mock(MethodValidatorInterface::class);
Expand Down Expand Up @@ -109,9 +109,7 @@ public function testDispatchReturnsHandler(): void
$this->methodValidator->shouldReceive('validateOutput')
->with(
$schemaContent,
Mockery::on(function ($param) use ($result): bool {
return (array) $param == $result;
})
Mockery::on(static fn ($param): bool => (array) $param == $result)
)
->once();

Expand Down
18 changes: 5 additions & 13 deletions tests/Dispatch/MethodValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MethodValidatorTest extends MockeryTestCase

private MethodValidator $subject;

public function setUp(): void
protected function setUp(): void
{
$this->schemaValidator = Mockery::mock(Validator::class);
$this->errorFormatter = Mockery::mock(ErrorFormatter::class);
Expand All @@ -50,9 +50,7 @@ public function testValidateInputThrowsExceptionIfInputDoesNotValidate(): void
$this->schemaValidator->shouldReceive('validate')
->with(
$parameter,
Mockery::on(static function ($value) use ($schemaParameter): bool {
return json_encode($value) === json_encode($schemaParameter);
})
Mockery::on(static fn ($value): bool => json_encode($value) === json_encode($schemaParameter))
)
->once()
->andReturn($validationResult);
Expand Down Expand Up @@ -80,9 +78,7 @@ public function testValidateInputValidates(): void
$this->schemaValidator->shouldReceive('validate')
->with(
$parameter,
Mockery::on(static function ($value) use ($schemaParameter): bool {
return (array) $value === $schemaParameter;
})
Mockery::on(static fn ($value): bool => (array) $value === $schemaParameter)
)
->once()
->andReturn($result);
Expand Down Expand Up @@ -114,9 +110,7 @@ public function testValidateOutputThrowsExceptionIfOutputDoesNotValidate(): void

$this->schemaValidator->shouldReceive('validate')
->with(
Mockery::on(static function ($value) use ($output): bool {
return json_encode($value) === json_encode(['data' => $output]);
}),
Mockery::on(static fn ($value): bool => json_encode($value) === json_encode(['data' => $output])),
Mockery::on(static function ($value) use ($schemaParameter): bool {
$schemaParameter = [
'type' => 'object',
Expand Down Expand Up @@ -158,9 +152,7 @@ public function testValidateOutputValidates(): void

$this->schemaValidator->shouldReceive('validate')
->with(
Mockery::on(static function ($value) use ($output): bool {
return json_encode($value) === json_encode(['data' => $output]);
}),
Mockery::on(static fn ($value): bool => json_encode($value) === json_encode(['data' => $output])),
Mockery::on(static function ($value) use ($schemaParameter): bool {
$schemaParameter = [
'type' => 'object',
Expand Down
18 changes: 5 additions & 13 deletions tests/Dispatch/RequestValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RequestValidatorTest extends MockeryTestCase

private RequestValidator $subject;

public function setUp(): void
protected function setUp(): void
{
$this->schemaLoader = Mockery::mock(SchemaLoaderInterface::class);
$this->validator = Mockery::mock(Validator::class);
Expand Down Expand Up @@ -77,12 +77,8 @@ public function testValidateThrowsExceptionIfInputDoesNotValidate(): void

$this->validator->shouldReceive('validate')
->with(
Mockery::on(static function ($value) use ($input): bool {
return (array) $value === $input;
}),
Mockery::on(static function ($value) use ($schemaContent): bool {
return $value == $schemaContent;
})
Mockery::on(static fn ($value): bool => (array) $value === $input),
Mockery::on(static fn ($value): bool => $value == $schemaContent)
)
->once()
->andReturn($validationResult);
Expand Down Expand Up @@ -120,12 +116,8 @@ public function testValidateReturnsValidatedInput(): void

$this->validator->shouldReceive('validate')
->with(
Mockery::on(static function ($value) use ($input): bool {
return (array) $value === $input;
}),
Mockery::on(static function ($value) use ($schemaContent): bool {
return $value == $schemaContent;
})
Mockery::on(static fn ($value): bool => (array) $value === $input),
Mockery::on(static fn ($value): bool => $value == $schemaContent)
)
->once()
->andReturn($validationResult);
Expand Down
2 changes: 1 addition & 1 deletion tests/Dispatch/SchemaLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SchemaLoaderTest extends MockeryTestCase
{
private SchemaLoader $subject;

public function setUp(): void
protected function setUp(): void
{
$this->subject = new SchemaLoader();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/EndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EndpointTest extends MockeryTestCase

private Endpoint $subject;

public function setUp(): void
protected function setUp(): void
{
$this->requestValidator = Mockery::mock(RequestValidatorInterface::class);
$this->methodDispatcher = Mockery::mock(MethodDispatcherInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/ResponseMalformedExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ResponseMalformedExceptionTest extends MockeryTestCase

private ResponseMalformedException $subject;

public function setUp(): void
protected function setUp(): void
{
$this->subject = new ResponseMalformedException(
'',
Expand Down
2 changes: 1 addition & 1 deletion tests/Response/ResponseBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ResponseBuilderTest extends MockeryTestCase
{
private ResponseBuilder $subject;

public function setUp(): void
protected function setUp(): void
{
$this->subject = new ResponseBuilder();
}
Expand Down

0 comments on commit 5f47b53

Please sign in to comment.