Skip to content

Commit fe1923f

Browse files
authored
NoDoctrineMigrationsGeneratedCommentFixer - fix priority (#739)
1 parent f274c08 commit fe1923f

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
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-3367-brightgreen.svg)
6+
![Tests](https://img.shields.io/badge/tests-3370-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/NoDoctrineMigrationsGeneratedCommentFixer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ public function down(Schema $schema)
4646
);
4747
}
4848

49+
/**
50+
* Must run before BracesFixer.
51+
*/
4952
public function getPriority(): int
5053
{
51-
return 0;
54+
return 36;
5255
}
5356

5457
public function isCandidate(Tokens $tokens): bool
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--CONFIGURATION--
2+
{ "PhpCsFixerCustomFixers/no_doctrine_migrations_generated_comment": true, "braces": true }
3+
--EXPECTED--
4+
<?php
5+
use Doctrine\Migrations\AbstractMigration;
6+
final class Version1234 extends AbstractMigration
7+
{
8+
public function up(Schema $schema) : void
9+
{
10+
$this->addSql("UPDATE t1 SET col1 = col1 + 1");
11+
}
12+
}
13+
14+
--INPUT--
15+
<?php
16+
use Doctrine\Migrations\AbstractMigration;
17+
final class Version1234 extends AbstractMigration
18+
{
19+
public function up(Schema $schema) : void
20+
{
21+
// this up() migration is auto-generated, please modify it to your needs
22+
23+
$this->addSql("UPDATE t1 SET col1 = col1 + 1");
24+
}
25+
}

0 commit comments

Comments
 (0)