Skip to content

Commit

Permalink
test priority
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Nov 18, 2024
1 parent fd2508d commit 23d2222
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public function isCandidate(Tokens $tokens): bool
/**
* {@inheritdoc}
*
* Must run before NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer.
* Must run before FullyQualifiedStrictTypesFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer.
* Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocTypesFixer.
*/
public function getPriority(): int
{
return 7;
return 8;
}

protected function isSkippedType(string $type): bool
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/Import/FullyQualifiedStrictTypesFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function foo(): \Other\FunctionReturnType
* {@inheritdoc}
*
* Must run before NoSuperfluousPhpdocTagsFixer, OrderedAttributesFixer, OrderedImportsFixer, OrderedInterfacesFixer, StatementIndentationFixer.
* Must run after ClassKeywordFixer, PhpUnitAttributesFixer, PhpdocToReturnTypeFixer.
* Must run after ClassKeywordFixer, PhpUnitAttributesFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer.
*/
public function getPriority(): int
{
Expand Down
1 change: 1 addition & 0 deletions tests/AutoReview/FixerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ private static function getFixersPriorityGraph(): array
'no_superfluous_phpdoc_tags',
],
'phpdoc_to_property_type' => [
'fully_qualified_strict_types',
'no_superfluous_phpdoc_tags',
],
'phpdoc_to_return_type' => [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--TEST--
Integration of fixers: phpdoc_to_property_type,fully_qualified_strict_types.
--RULESET--
{"phpdoc_to_property_type":{"map_types":{"TFixer":"\\PhpCsFixer\\AbstractFixer"}},"fully_qualified_strict_types":{"import_symbols":true}}
--EXPECT--
<?php

use PhpCsFixer\AbstractFixer;
class Foo {
/**
* @var null|TFixer
*/
public ?AbstractFixer $fixerWithAliasedConfig = null;
}

--INPUT--
<?php

class Foo {
/**
* @var null|TFixer
*/
public $fixerWithAliasedConfig = null;
}

0 comments on commit 23d2222

Please sign in to comment.