Skip to content

Commit

Permalink
Make DataProviderStaticFixer always risky (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Dec 23, 2023
1 parent 4721d3f commit a255c0e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@
[![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)
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
![Tests](https://img.shields.io/badge/tests-3511-brightgreen.svg)
![Tests](https://img.shields.io/badge/tests-3510-brightgreen.svg)
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)

[![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)
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/DataProviderStaticFixer.php
Expand Up @@ -90,7 +90,7 @@ public function isCandidate(Tokens $tokens): bool

public function isRisky(): bool
{
return $this->force;
return $this->phpUnitDataProviderStaticFixer->isRisky();
}

public function fix(\SplFileInfo $file, Tokens $tokens): void
Expand Down
2 changes: 0 additions & 2 deletions tests/Fixer/AbstractFixerTestCase.php
Expand Up @@ -37,9 +37,7 @@ abstract class AbstractFixerTestCase extends TestCase
'testFixPre80',
'testFix80',
'testFix82',
'testIsNotRiskyWithoutForceOption',
'testIsRisky',
'testIsRiskyWithForceOption',
'testReversingCodeSample',
'testStringIsTheSame',
'testSuccessorName',
Expand Down
8 changes: 1 addition & 7 deletions tests/Fixer/DataProviderStaticFixerTest.php
Expand Up @@ -23,17 +23,11 @@
*/
final class DataProviderStaticFixerTest extends AbstractFixerTestCase
{
public function testIsRiskyWithForceOption(): void
public function testIsRisky(): void
{
$this->fixer->configure(['force' => true]);
self::assertTrue($this->fixer->isRisky());
}

public function testIsNotRiskyWithoutForceOption(): void
{
self::assertFalse($this->fixer->isRisky());
}

public function testSuccessorName(): void
{
self::assertContains('php_unit_data_provider_static', $this->fixer->getSuccessorsNames());
Expand Down

0 comments on commit a255c0e

Please sign in to comment.