Skip to content

Commit

Permalink
Fix: Run 'make coding-standards'
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Feb 10, 2023
1 parent 34c7033 commit 8b1ed85
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
32 changes: 18 additions & 14 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,63 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.30.0@d0bc6e25d89f649e4f36a534f330f8bb4643dd69">
<files psalm-version="5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5">
<file src="src/Template.php">
<DocblockTypeContradiction occurrences="2">
<DocblockTypeContradiction>
<code>return !\is_string($key);</code>
<code>return !\is_string($value);</code>
</DocblockTypeContradiction>
</file>
<file src="test/Unit/Exception/InvalidFileTest.php">
<MixedArgument occurrences="2">
<MixedArgument>
<code>$faker-&gt;fileExtension()</code>
<code>$faker-&gt;fileExtension()</code>
</MixedArgument>
</file>
<file src="test/Unit/HolderTest.php">
<MixedArgument occurrences="1">
<MixedArgument>
<code>$value</code>
</MixedArgument>
<MixedAssignment occurrences="2">
<MixedAssignment>
<code>$value</code>
<code>$value</code>
</MixedAssignment>
<MixedInferredReturnType occurrences="3">
<MixedInferredReturnType>
<code>\Generator</code>
<code>\Generator</code>
<code>\Generator</code>
</MixedInferredReturnType>
</file>
<file src="test/Unit/RangeTest.php">
<MixedInferredReturnType occurrences="1">
<MixedInferredReturnType>
<code>\Generator</code>
</MixedInferredReturnType>
</file>
<file src="test/Unit/TemplateTest.php">
<InvalidArrayOffset occurrences="1"/>
<MixedArgumentTypeCoercion occurrences="2">
<InvalidArrayOffset>
<code>[
$value =&gt; 'foo',
]</code>
</InvalidArrayOffset>
<MixedArgumentTypeCoercion>
<code>$replacements</code>
<code>$replacements</code>
</MixedArgumentTypeCoercion>
<MixedInferredReturnType occurrences="2">
<MixedInferredReturnType>
<code>\Generator</code>
<code>\Generator</code>
</MixedInferredReturnType>
</file>
<file src="test/Unit/UrlTest.php">
<MixedArgument occurrences="1">
<MixedArgument>
<code>$value</code>
</MixedArgument>
<MixedAssignment occurrences="2">
<MixedAssignment>
<code>$value</code>
<code>$value</code>
</MixedAssignment>
<MixedInferredReturnType occurrences="3">
<MixedInferredReturnType>
<code>\Generator</code>
<code>\Generator</code>
<code>\Generator</code>
</MixedInferredReturnType>
</file>
<file src="test/Unit/YearTest.php">
<MixedInferredReturnType occurrences="2">
<MixedInferredReturnType>
<code>\Generator</code>
<code>\Generator</code>
</MixedInferredReturnType>
Expand Down
6 changes: 3 additions & 3 deletions test/Unit/HolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testFromStringRejectsMultilineValue(string $value): void
Holder::fromString($value);
}

public function provideMultilineValue(): \Generator
public static function provideMultilineValue(): \Generator
{
$newLineCharacters = [
"\n",
Expand Down Expand Up @@ -90,7 +90,7 @@ public function testFromStringReturnsHolder(string $value): void
self::assertSame($value, $holder->toString());
}

public function provideValidValue(): \Generator
public static function provideValidValue(): \Generator
{
foreach (self::validValues() as $key => $value) {
yield $key => [
Expand All @@ -109,7 +109,7 @@ public function testFromStringReturnsHolderWithTrimmedValue(string $value): void
self::assertSame(\trim($value), $holder->toString());
}

public function provideUntrimmedValue(): \Generator
public static function provideUntrimmedValue(): \Generator
{
foreach (self::validValues() as $key => $value) {
yield $key => [
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/RangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testSinceReturnsRangeWhenStartYearIsLessThanCurrentYear(\DateTim
self::assertSame($expected, $range->toString());
}

public function provideTimeZone(): \Generator
public static function provideTimeZone(): \Generator
{
$values = [
'America/New_York',
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testToStringRejectsReplacementsWithInvalidKeys(array $replacemen
$template->toString($replacements);
}

public function provideReplacementsWithInvalidKeys(): \Generator
public static function provideReplacementsWithInvalidKeys(): \Generator
{
$faker = self::faker();

Expand Down Expand Up @@ -154,7 +154,7 @@ public function testToStringRejectsReplacementsWithInvalidValues(array $replacem
$template->toString($replacements);
}

public function provideReplacementsWithInvalidValues(): \Generator
public static function provideReplacementsWithInvalidValues(): \Generator
{
$faker = self::faker();

Expand Down
6 changes: 3 additions & 3 deletions test/Unit/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testFromStringRejectsInvalidValue(string $value): void
Url::fromString($value);
}

public function provideInvalidValue(): \Generator
public static function provideInvalidValue(): \Generator
{
$values = [
'string-arbitrary' => self::faker()->sentence(),
Expand All @@ -64,7 +64,7 @@ public function testFromStringReturnsUrl(string $value): void
self::assertSame($value, $url->toString());
}

public function provideValidValue(): \Generator
public static function provideValidValue(): \Generator
{
foreach (self::validValues() as $key => $value) {
yield $key => [
Expand All @@ -83,7 +83,7 @@ public function testFromStringReturnsUrlWithTrimmedValue(string $value): void
self::assertSame(\trim($value), $url->toString());
}

public function provideUntrimmedValue(): \Generator
public static function provideUntrimmedValue(): \Generator
{
foreach (self::validValues() as $key => $value) {
yield $key => [
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/YearTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testFromStringRejectsInvalidValue(string $value): void
Year::fromString($value);
}

public function provideInvalidValue(): \Generator
public static function provideInvalidValue(): \Generator
{
$faker = self::faker();

Expand Down Expand Up @@ -72,7 +72,7 @@ public function testFromStringReturnsYear(string $value): void
self::assertSame($value, $year->toString());
}

public function provideValidValue(): \Generator
public static function provideValidValue(): \Generator
{
$values = [
'string-end' => '0000',
Expand Down

0 comments on commit 8b1ed85

Please sign in to comment.