Skip to content

Commit

Permalink
cs: Update PHP-CS-Fixer (#1169)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Feb 6, 2024
1 parent 9434d28 commit 2ef5ccf
Show file tree
Hide file tree
Showing 36 changed files with 277 additions and 268 deletions.
2 changes: 1 addition & 1 deletion src/Generator/Resolver/ParameterResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Nelmio\Alice\Throwable\ResolutionThrowable;

/**
* More specific version of {@see \Nelmio\Alice\Generator\Resolver\ParameterBagResolverInterface} to resolve a specific
* More specific version of {@see ParameterBagResolverInterface} to resolve a specific
* parameter.
*/
interface ParameterResolverInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Loader/NativeLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@

/**
* Loader implementation made to be usable without any dependency injection for quick and easy usage. For more advanced
* usages, use {@see \Nelmio\Alice\Loader\SimpleFileLoader} instead or implement your own loader.
* usages, use {@see SimpleFileLoader} instead or implement your own loader.
*
* WARNING: because this class is wrapping the whole configuration, the BC break policy is not fully ensured here. Not
* methods can be added in minor versions, which could make your application break if you are extending this class and
Expand Down
2 changes: 1 addition & 1 deletion tests/DeepCloneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testDeepCloneClosure(): void
self::assertSame($bar, $fooClone->bar);
}

public function provideScalarValues(): iterable
public static function provideScalarValues(): iterable
{
return [
[null],
Expand Down
16 changes: 8 additions & 8 deletions tests/Definition/Fixture/TemplatingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testDetectTemplateFlags(SimpleFixtureWithFlags $fixture, bool $i
public function testExtendedFixturesOrderIsInversed(): void
{
$templating = new Templating(
$this->createFixtureWithFlags(
self::createFixtureWithFlags(
(new FlagBag(''))
->withFlag(new ExtendFlag(new FixtureReference('user_base0')))
->withFlag(new ExtendFlag(new FixtureReference('user_base1'))),
Expand All @@ -75,27 +75,27 @@ public function testExtendedFixturesOrderIsInversed(): void
}
}

public function provideFlags(): iterable
public static function provideFlags(): iterable
{
$emptyFlagBag = new FlagBag('user0');
yield 'empty flagbag' => [
$this->createFixtureWithFlags($emptyFlagBag),
self::createFixtureWithFlags($emptyFlagBag),
false,
false,
[],
];

$flagBagWithNonTemplateFlag = $emptyFlagBag->withFlag(new DummyFlag());
yield 'flagbag with non-templating element' => [
$this->createFixtureWithFlags($flagBagWithNonTemplateFlag),
self::createFixtureWithFlags($flagBagWithNonTemplateFlag),
false,
false,
[],
];

$templateFlagBag = $emptyFlagBag->withFlag(new TemplateFlag());
yield 'flagbag with template' => [
$this->createFixtureWithFlags($templateFlagBag),
self::createFixtureWithFlags($templateFlagBag),
true,
false,
[],
Expand All @@ -105,7 +105,7 @@ public function provideFlags(): iterable
->withFlag(new ExtendFlag(new FixtureReference('user_base0')))
->withFlag(new ExtendFlag(new FixtureReference('user_base1')));
yield 'flagbag with extends' => [
$this->createFixtureWithFlags($extendsFlagBag),
self::createFixtureWithFlags($extendsFlagBag),
false,
true,
[
Expand All @@ -120,7 +120,7 @@ public function provideFlags(): iterable
->withFlag(new ExtendFlag(new FixtureReference('user_base1')))
->withFlag(new DummyFlag());
yield 'flagbag with template, extends and non templating flags' => [
$this->createFixtureWithFlags($templateAndExtendsFlagBag),
self::createFixtureWithFlags($templateAndExtendsFlagBag),
true,
true,
[
Expand All @@ -130,7 +130,7 @@ public function provideFlags(): iterable
];
}

private function createFixtureWithFlags(FlagBag $flags): SimpleFixtureWithFlags
private static function createFixtureWithFlags(FlagBag $flags): SimpleFixtureWithFlags
{
return new SimpleFixtureWithFlags(
new SimpleFixture(
Expand Down
2 changes: 1 addition & 1 deletion tests/Definition/Flag/OptionalFlagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testThrowsExceptionIfPercentageValueIsInvalid(int $percentage, ?
}
}

public function providePercentageValues(): iterable
public static function providePercentageValues(): iterable
{
yield 'negative value' => [
-1,
Expand Down
2 changes: 1 addition & 1 deletion tests/Definition/RangeNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testReadAccessorsReturnPropertiesValues(array $input, array $exp
self::assertEquals($expected[1], $range->getTo());
}

public function provideRanges(): iterable
public static function provideRanges(): iterable
{
yield [
[10, 11],
Expand Down
4 changes: 2 additions & 2 deletions tests/Definition/Value/DynamicArrayValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testCanBeCastedIntoAString(): void
self::assertEquals('10x foo', (string) $value);
}

public function provideInputTypes(): iterable
public static function provideInputTypes(): iterable
{
yield 'null/array' => [
null,
Expand Down Expand Up @@ -192,7 +192,7 @@ static function (): void {
];
}

public function provideValues(): iterable
public static function provideValues(): iterable
{
yield 'int value' => [-1, 'string', -1];
yield 'object value' => [new FakeValue(), new FakeValue(), new FakeValue()];
Expand Down
2 changes: 1 addition & 1 deletion tests/Definition/Value/OptionalValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testCanBeCastedIntoAString(): void
self::assertEquals('10%? foo : null', (string) $value);
}

public function provideInputValues(): iterable
public static function provideInputValues(): iterable
{
yield 'null/string/string' => [
null,
Expand Down
2 changes: 1 addition & 1 deletion tests/Definition/Value/ParameterValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function testCanBeCastedIntoAString(): void
self::assertEquals('<{foo}>', $value);
}

public function provideInputValues(): iterable
public static function provideInputValues(): iterable
{
yield 'null' => [
null,
Expand Down
2 changes: 1 addition & 1 deletion tests/Definition/Value/UniqueValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testCanBeCastedIntoAString(): void
self::assertEquals('(unique) foo', (string) $value);
}

public function provideValues(): iterable
public static function provideValues(): iterable
{
yield 'null value' => [null];
yield 'string value' => ['azerty'];
Expand Down
2 changes: 1 addition & 1 deletion tests/FileLocator/DefaultFileLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function testLocatingFileThrowsExceptionIfTheFileDoesNotExistsInAbsoluteP
$this->locator->locate(__DIR__.'/Fixtures/foobar.xml');
}

public function provideAbsolutePaths(): iterable
public static function provideAbsolutePaths(): iterable
{
return [
['/foo.xml'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,47 +135,47 @@ public function markAsInvalidCase(): void
self::markTestSkipped('Invalid scenario.');
}

public function provideElements(): iterable
public static function provideElements(): iterable
{
return Reference::getElements();
}

public function provideMalformedElements(): iterable
public static function provideMalformedElements(): iterable
{
return Reference::getMalformedElements();
}

public function provideExtends(): iterable
public static function provideExtends(): iterable
{
return Reference::getExtends();
}

public function provideMalformedExtends(): iterable
public static function provideMalformedExtends(): iterable
{
return Reference::getMalformedExtends();
}

public function provideOptionals(): iterable
public static function provideOptionals(): iterable
{
return Reference::getOptionals();
}

public function provideMalformedOptionals(): iterable
public static function provideMalformedOptionals(): iterable
{
return Reference::getMalformedOptionals();
}

public function provideTemplates(): iterable
public static function provideTemplates(): iterable
{
return Reference::getTemplates();
}

public function provideUniques(): iterable
public static function provideUniques(): iterable
{
return Reference::getUniques();
}

public function provideConfigurators(): iterable
public static function provideConfigurators(): iterable
{
return Reference::getConfigurators();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testThrowsExceptionIfParametersKeyIsNotAnArray(array $data, stri
}
}

public function provideDataWithNoParameters(): iterable
public static function provideDataWithNoParameters(): iterable
{
yield 'no parameters' => [
[],
Expand All @@ -88,7 +88,7 @@ public function provideDataWithNoParameters(): iterable
];
}

public function provideDataWithInvalidParameterKeys(): iterable
public static function provideDataWithInvalidParameterKeys(): iterable
{
yield 'string value' => [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testTokenizeValues($value, $expected): void
}
}

public function provideValues(): iterable
public static function provideValues(): iterable
{
yield 'non function' => [
'foo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testCanLexValues(string $value, $expected): void
/**
* @see https://github.com/nelmio/alice/issues/377
*/
public function provideValues(): iterable
public static function provideValues(): iterable
{
// simple values
yield 'empty string' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testEscapesStringBeforeHandlingItOverToTheDecoratedLexer(string
$decoratedLexerProphecy->lex(Argument::any())->shouldHaveBeenCalledTimes(1);
}

public function provideValues(): iterable
public static function provideValues(): iterable
{
yield 'empty string' => [''];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testThrowsAnExceptionIfNoMatchingPatternFound(): void
$this->lexer->lex('foo');
}

public function provideValues(): iterable
public static function provideValues(): iterable
{
yield 'method reference' => [
$value = '@user->getUserName()',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function testThrowsAnExceptionWhenAnInvalidValueIsGiven(): void
$lexer->lex('<foo>');
}

public function lineBreaksProvider(): iterable
public static function lineBreaksProvider(): iterable
{
return [
['\n'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function testIfThereIsOnlyOneElementThenReturnTheElementInsteadOfAValueLi
self::assertEquals($expected, $actual);
}

public function provideOneElementValues(): iterable
public static function provideOneElementValues(): iterable
{
yield 'one value' => [
new FakeValue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function testParseValues(string $value, $expected): void
self::assertEquals($expected, $actual, var_export($actual, true));
}

public function provideValues(): iterable
public static function provideValues(): iterable
{
// Simple values
yield 'empty string' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function testIfThereIsOnlyOneElementThenReturnTheElementInsteadOfAValueLi
self::assertEquals($expected, $actual);
}

public function provideOneElementValues(): iterable
public static function provideOneElementValues(): iterable
{
yield 'one value' => [
new FakeValue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testTheEscapedValueIsDetokenizedBeforeBeingReturned(): void
self::assertEquals($expected, $actual);
}

public function provideTokens(): iterable
public static function provideTokens(): iterable
{
return [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function testReturnsListOfPossibleValues(): void
self::assertEquals($expected, $actual);
}

public function provideTokens(): iterable
public static function provideTokens(): iterable
{
return [
[
Expand Down
Loading

0 comments on commit 2ef5ccf

Please sign in to comment.