Skip to content

Commit

Permalink
ReadOnlyClassRector
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Jul 18, 2024
1 parent 9e5b8e1 commit dd17dee
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Rector\Php80\Rector\FuncCall\ClassOnObjectRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector;

Expand All @@ -38,6 +39,7 @@
// ->withPhpSets(php82: true)
->withRules([
MixedTypeRector::class,
ReadOnlyClassRector::class,
ReadOnlyPropertyRector::class,
RemoveUnusedVariableInCatchRector::class,
ClassOnObjectRector::class,
Expand Down
4 changes: 2 additions & 2 deletions src/CustomMapper/Implementation/ObjectMapperTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
/**
* @internal
*/
final class ObjectMapperTableFactory implements ObjectMapperTableFactoryInterface
final readonly class ObjectMapperTableFactory implements ObjectMapperTableFactoryInterface
{
private readonly ObjectMapperTable $objectMapperTable;
private ObjectMapperTable $objectMapperTable;

public function __construct()
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Common/IterableMapperDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
use Rekalogika\Mapper\Context\Context;
use Rekalogika\Mapper\IterableMapperInterface;

final class IterableMapperDecorator implements IterableMapperInterface
final readonly class IterableMapperDecorator implements IterableMapperInterface
{
public function __construct(
private readonly IterableMapperInterface $decorated,
private readonly Context $defaultContext
private IterableMapperInterface $decorated,
private Context $defaultContext
) {
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Common/MapperDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
use Rekalogika\Mapper\Context\Context;
use Rekalogika\Mapper\MapperInterface;

final class MapperDecorator implements MapperInterface
final readonly class MapperDecorator implements MapperInterface
{
public function __construct(
private readonly MapperInterface $decorated,
private readonly Context $defaultContext
private MapperInterface $decorated,
private Context $defaultContext
) {
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Fixtures/MethodMapper/MoneyDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
* @deprecated
* @psalm-suppress DeprecatedInterface
*/
final class MoneyDto implements MapToObjectInterface, MapFromObjectInterface
final readonly class MoneyDto implements MapToObjectInterface, MapFromObjectInterface
{
public function __construct(
private readonly string $amount,
private readonly string $currency,
private string $amount,
private string $currency,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Fixtures/ObjectMapper/MoneyDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace Rekalogika\Mapper\Tests\Fixtures\ObjectMapper;

final class MoneyDto
final readonly class MoneyDto
{
public function __construct(
private readonly string $amount,
private readonly string $currency,
private string $amount,
private string $currency,
) {
}

Expand Down

0 comments on commit dd17dee

Please sign in to comment.