Skip to content

Commit

Permalink
ci+rector rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mathielen committed Dec 30, 2024
1 parent 14a7930 commit 52ff1a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
php-version: [
'8.2',
'8.3',
'8.4'
]

steps:
Expand Down
12 changes: 8 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withRules([
\Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector::class,
])
->withSets([
JMSSetList::ANNOTATIONS_TO_ATTRIBUTES,
PHPUnitSetList::PHPUNIT_100,
PHPUnitSetList::PHPUNIT_110,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
SetList::TYPE_DECLARATION,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::PHP_82,
\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_84,
SetList::PRIVATIZATION,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
Expand All @@ -33,9 +36,10 @@
\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class,
//allow to use promoted properties that only purpose is to get serialized
\Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector::class,
//this is stupid and makes code unreadable
//this makes code unreadable
\Rector\Strict\Rector\Ternary\BooleanInTernaryOperatorRuleFixerRector::class,
\Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector::class
\Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector::class,
\Rector\Php81\Rector\Property\ReadOnlyPropertyRector::class,
])
->withFileExtensions(['php'])
->withCache(
Expand Down
4 changes: 2 additions & 2 deletions src/CXml/Model/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class Tax
{
#[Serializer\SerializedName('Money')]
private Money $money;
private readonly Money $money;

/**
* @var TaxDetail[]
Expand All @@ -24,7 +24,7 @@ public function __construct(
int $value,
#[Serializer\SerializedName('Description')]
#[Serializer\XmlElement(cdata: false)]
private MultilanguageString $description,
private readonly MultilanguageString $description,
) {
$this->money = new Money($currency, $value);
}
Expand Down

0 comments on commit 52ff1a9

Please sign in to comment.