Skip to content

Commit

Permalink
cleanup ci configuration and latest cs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Feb 1, 2024
1 parent f680f0e commit 67267b3
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^9.6",
"rector/rector": "^0.18.0"
"rector/rector": "^0.19.0"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 0 additions & 12 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\Class_\PropertyTypeFromStrictSetterGetterRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
Expand All @@ -18,11 +16,7 @@
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictParamRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector;

return static function (RectorConfig $rectorConfig): void {
Expand All @@ -39,23 +33,17 @@
ReturnTypeFromStrictNewArrayRector::class,
ReturnTypeFromStrictParamRector::class,
ReturnTypeFromStrictScalarReturnExprRector::class,
ReturnTypeFromStrictTypedCallRector::class,
ReturnTypeFromStrictTypedPropertyRector::class,
PropertyTypeFromStrictSetterGetterRector::class,
TypedPropertyFromStrictConstructorRector::class,
TypedPropertyFromStrictGetterMethodReturnTypeRector::class,
TypedPropertyFromStrictSetUpRector::class,
ParamTypeFromStrictTypedPropertyRector::class,
AddMethodCallBasedStrictParamTypeRector::class,

ParamTypeByMethodCallTypeRector::class,
AddParamTypeFromPropertyTypeRector::class,
]);

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
SetList::TYPE_DECLARATION,
PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
]);

// use imports instead of FQN: https://github.com/rectorphp/rector/blob/main/docs/auto_import_names.md#auto-import-names
Expand Down
3 changes: 2 additions & 1 deletion src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function __construct(
private Builder $metadataBuilder,
private DeserializerGenerator $deserializerGenerator,
private SerializerGenerator $serializerGenerator
) {}
) {
}

public function compile(): void
{
Expand Down
4 changes: 3 additions & 1 deletion src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ final class Context
*/
private array $groups = [];

public function __construct() {}
public function __construct()
{
}

/**
* @return string[]
Expand Down
4 changes: 3 additions & 1 deletion src/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
/**
* Base exception thrown by the serializer.
*/
class Exception extends \Exception {}
class Exception extends \Exception
{
}
4 changes: 3 additions & 1 deletion src/Exception/UnsupportedFormatException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
/**
* Thrown when requesting the serializer to handle a format that is not supported.
*/
final class UnsupportedFormatException extends Exception {}
final class UnsupportedFormatException extends Exception
{
}
4 changes: 3 additions & 1 deletion src/Path/AbstractEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

abstract class AbstractEntry implements \Stringable
{
public function __construct(private string $path) {}
public function __construct(private string $path)
{
}

abstract public function __toString(): string;

Expand Down
4 changes: 3 additions & 1 deletion src/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
*/
final class Serializer implements SerializerInterface
{
public function __construct(private string $cacheDirectory) {}
public function __construct(private string $cacheDirectory)
{
}

/**
* {@inheritdoc}
Expand Down
3 changes: 2 additions & 1 deletion tests/Fixtures/NonEmptyConstructor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public function __construct(
* @Serializer\Type("string")
*/
private string $optional = 'optional'
) {}
) {
}

public function getApiString(): string
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Fixtures/SerializerFailureModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

namespace Tests\Liip\Serializer\Fixtures;

class SerializerFailureModel {}
class SerializerFailureModel
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

function deserialize_Tests_Liip_Serializer_Fixtures_SerializerFailureModel($model): void
{
throw new \Exception();
throw new Exception();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

function serialize_Tests_Liip_Serializer_Fixtures_SerializerFailureModel_api_2($model): void
{
throw new \Exception();
throw new Exception();
}

0 comments on commit 67267b3

Please sign in to comment.