Skip to content

Commit 4fac22f

Browse files
authored
CurlyBracesPositionFixer must run before ConstructorEmptyBracesFixer (#906)
1 parent 8ac286d commit 4fac22f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![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)
44
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
55
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
6-
![Tests](https://img.shields.io/badge/tests-3441-brightgreen.svg)
6+
![Tests](https://img.shields.io/badge/tests-3444-brightgreen.svg)
77
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
88

99
[![CI Status](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/workflows/CI/badge.svg?branch=main)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions)

src/Fixer/ConstructorEmptyBracesFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public function __construct(
4040
}
4141

4242
/**
43-
* Must run after BracesFixer, PromotedConstructorPropertyFixer.
43+
* Must run after BracesFixer, CurlyBracesPositionFixer, PromotedConstructorPropertyFixer.
4444
*/
4545
public function getPriority(): int
4646
{
47-
return 0;
47+
return -3;
4848
}
4949

5050
public function isCandidate(Tokens $tokens): bool
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--CONFIGURATION--
2+
{ "curly_braces_position": true, "PhpCsFixerCustomFixers/constructor_empty_braces": true }
3+
--EXPECTED--
4+
<?php class Foo
5+
{
6+
public function __construct() {}
7+
}
8+
9+
--INPUT--
10+
<?php class Foo
11+
{
12+
public function __construct(){}
13+
}

0 commit comments

Comments
 (0)