Skip to content

Commit d30d363

Browse files
authored
Do not test deprecated fixers from main repo (#1018)
1 parent 88248c4 commit d30d363

11 files changed

+19
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Latest stable version](https://img.shields.io/packagist/v/kubawerlos/php-cs-fixer-custom-fixers.svg?label=current%20version)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
66
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
77
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
8-
![Tests](https://img.shields.io/badge/tests-3613-brightgreen.svg)
8+
![Tests](https://img.shields.io/badge/tests-3607-brightgreen.svg)
99
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
1010

1111
[![CI status](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml/badge.svg)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions/workflows/ci.yaml)

src/Fixer/ConstructorEmptyBracesFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
}
4242

4343
/**
44-
* Must run after BracesFixer, CurlyBracesPositionFixer, PromotedConstructorPropertyFixer.
44+
* Must run after BracesPositionFixer, PromotedConstructorPropertyFixer.
4545
*/
4646
public function getPriority(): int
4747
{

src/Fixer/MultilinePromotedPropertiesFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ public function setWhitespacesConfig(WhitespacesFixerConfig $config): void
8888
}
8989

9090
/**
91-
* Must run before BracesFixer.
91+
* Must run before BracesPositionFixer.
9292
* Must run after PromotedConstructorPropertyFixer.
9393
*/
9494
public function getPriority(): int
9595
{
96-
return 36;
96+
return 0;
9797
}
9898

9999
public function isCandidate(Tokens $tokens): bool

src/Fixer/NoDoctrineMigrationsGeneratedCommentFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ public function down(Schema $schema)
4848
}
4949

5050
/**
51-
* Must run before BracesFixer.
51+
* Must run before NoExtraBlankLinesFixer.
5252
*/
5353
public function getPriority(): int
5454
{
55-
return 36;
55+
return 0;
5656
}
5757

5858
public function isCandidate(Tokens $tokens): bool

src/Fixer/PromotedConstructorPropertyFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function configure(array $configuration): void
8484
}
8585

8686
/**
87-
* Must run before BracesFixer, ClassAttributesSeparationFixer, ConstructorEmptyBracesFixer, MultilinePromotedPropertiesFixer, NoExtraBlankLinesFixer, ReadonlyPromotedPropertiesFixer.
87+
* Must run before ClassAttributesSeparationFixer, ConstructorEmptyBracesFixer, MultilinePromotedPropertiesFixer, NoExtraBlankLinesFixer, ReadonlyPromotedPropertiesFixer.
8888
*/
8989
public function getPriority(): int
9090
{

tests/PriorityTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Tests;
1313

14+
use PhpCsFixer\AbstractFixer;
15+
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
1416
use PhpCsFixer\Fixer\FixerInterface;
1517
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
1618
use PhpCsFixer\FixerFactory;
@@ -45,6 +47,13 @@ public function testPriorities(FixerInterface $firstFixer, FixerInterface $secon
4547
*/
4648
public function testInOrder(FixerInterface $firstFixer, FixerInterface $secondFixer, string $expected, string $input): void
4749
{
50+
if ($firstFixer instanceof AbstractFixer) {
51+
self::assertNotInstanceOf(DeprecatedFixerInterface::class, $firstFixer);
52+
}
53+
if ($secondFixer instanceof AbstractFixer) {
54+
self::assertNotInstanceOf(DeprecatedFixerInterface::class, $secondFixer);
55+
}
56+
4857
Tokens::clearCache();
4958
$tokens = Tokens::fromCode($input);
5059

tests/priority_fixtures/Custom_multiline_promoted_properties,braces.test renamed to tests/priority_fixtures/Custom_multiline_promoted_properties,braces_position.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--CONFIGURATION--
2-
{ "PhpCsFixerCustomFixers/multiline_promoted_properties": true, "braces": true }
2+
{ "PhpCsFixerCustomFixers/multiline_promoted_properties": true, "braces_position": true }
33
--EXPECTED--
44
<?php class Foo
55
{

tests/priority_fixtures/Custom_no_doctrine_migrations_generated_comment,braces.test renamed to tests/priority_fixtures/Custom_no_doctrine_migrations_generated_comment,no_extra_blank_lines.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--CONFIGURATION--
2-
{ "PhpCsFixerCustomFixers/no_doctrine_migrations_generated_comment": true, "braces": true }
2+
{ "PhpCsFixerCustomFixers/no_doctrine_migrations_generated_comment": true, "no_extra_blank_lines": {"tokens": ["curly_brace_block"]} }
33
--EXPECTED--
44
<?php
55
use Doctrine\Migrations\AbstractMigration;

tests/priority_fixtures/Custom_promoted_constructor_property,braces.test

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/priority_fixtures/braces,Custom_constructor_empty_braces.test renamed to tests/priority_fixtures/braces_position,Custom_constructor_empty_braces.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--CONFIGURATION--
2-
{ "braces": true, "PhpCsFixerCustomFixers/constructor_empty_braces": true }
2+
{ "braces_position": true, "PhpCsFixerCustomFixers/constructor_empty_braces": true }
33
--EXPECTED--
44
<?php class Foo
55
{

0 commit comments

Comments
 (0)