Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tools #453

Merged
merged 2 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ parameters:
path: tests/Bridge/Symfony/App/TwigExtensionIntegrationTest.php

-
message: "#^Method Nucleos\\\\Twig\\\\Tests\\\\Runtime\\\\RouterRuntimeTest\\:\\:getSplitList\\(\\) return type has no value type specified in iterable type iterable\\.$#"
message: "#^Method Nucleos\\\\Twig\\\\Tests\\\\Runtime\\\\RouterRuntimeTest\\:\\:provideSplitTagCases\\(\\) return type has no value type specified in iterable type iterable\\.$#"
count: 1
path: tests/Runtime/RouterRuntimeTest.php

Expand All @@ -41,12 +41,12 @@ parameters:
path: tests/Runtime/RouterRuntimeTest.php

-
message: "#^Method Nucleos\\\\Twig\\\\Tests\\\\Runtime\\\\UrlAutoConverterRuntimeTest\\:\\:getLinkText\\(\\) return type has no value type specified in iterable type iterable\\.$#"
message: "#^Method Nucleos\\\\Twig\\\\Tests\\\\Runtime\\\\UrlAutoConverterRuntimeTest\\:\\:provideConvertLinksWithLinksCases\\(\\) return type has no value type specified in iterable type iterable\\.$#"
count: 1
path: tests/Runtime/UrlAutoConverterRuntimeTest.php

-
message: "#^Method Nucleos\\\\Twig\\\\Tests\\\\Util\\\\StringUtilsTest\\:\\:getObfuscatedStrings\\(\\) return type has no value type specified in iterable type iterable\\.$#"
message: "#^Method Nucleos\\\\Twig\\\\Tests\\\\Util\\\\StringUtilsTest\\:\\:provideObfuscateCases\\(\\) return type has no value type specified in iterable type iterable\\.$#"
count: 1
path: tests/Util/StringUtilsTest.php

4 changes: 2 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="v4.14.0@14dcbc908ab2625cd7a74258ee6c740cbecc6140">
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<file src="src/Runtime/StringRuntime.php">
<InvalidArrayOffset occurrences="1">
<InvalidArrayOffset>
<code>$prefixes[$exp - 1]</code>
</InvalidArrayOffset>
</file>
Expand Down
4 changes: 2 additions & 2 deletions tests/Runtime/RouterRuntimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public function testRouteExists(): void
}

/**
* @dataProvider getSplitList
* @dataProvider provideSplitTagCases
*/
public function testSplitTag(string $input, string $tag, array $output): void
{
self::assertSame($output, $this->extension->splitTag($input, $tag));
}

public static function getSplitList(): iterable
public static function provideSplitTagCases(): iterable
{
return [
['<h1>Foo</h1><p>Bar</p><h1>Baz</h1>Bar', 'h1', ['<h1>Foo</h1><p>Bar</p>', '<h1>Baz</h1>Bar']],
Expand Down
8 changes: 4 additions & 4 deletions tests/Runtime/StringRuntimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function setUp(): void
}

/**
* @dataProvider getBase10
* @dataProvider provideFormatBytesBase10Cases
*
* @param float|int $bits
*/
Expand All @@ -38,7 +38,7 @@ public function testFormatBytesBase10(string $expected, $bits): void
}

/**
* @dataProvider getBase2
* @dataProvider provideFormatBytesBase2Cases
*
* @param float|int $bits
*/
Expand All @@ -55,7 +55,7 @@ public function testFormatBytesBase2(string $expected, $bits): void
/**
* @return int[][]|string[][]
*/
public static function getBase10(): iterable
public static function provideFormatBytesBase10Cases(): iterable
{
return [
['500,0 B', 500],
Expand All @@ -73,7 +73,7 @@ public static function getBase10(): iterable
/**
* @return int[][]|string[][]
*/
public static function getBase2(): iterable
public static function provideFormatBytesBase2Cases(): iterable
{
return [
['512,0 B', 512],
Expand Down
12 changes: 6 additions & 6 deletions tests/Runtime/UrlAutoConverterRuntimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testConvertLinksWithPlanText(): void
}

/**
* @dataProvider getLinkText
* @dataProvider provideConvertLinksWithLinksCases
*/
public function testConvertLinksWithLinks(string $input, string $output): void
{
Expand All @@ -34,7 +34,7 @@ public function testConvertLinksWithLinks(string $input, string $output): void
}

/**
* @dataProvider getMailText
* @dataProvider provideConvertLinksWithMailsCases
*/
public function testConvertLinksWithMails(string $input, string $output): void
{
Expand All @@ -44,7 +44,7 @@ public function testConvertLinksWithMails(string $input, string $output): void
}

/**
* @dataProvider getLinkTargetText
* @dataProvider provideConvertLinksWithOptionsCases
*/
public function testConvertLinksWithOptions(string $input, string $output): void
{
Expand All @@ -53,7 +53,7 @@ public function testConvertLinksWithOptions(string $input, string $output): void
self::assertSame($output, $extension->convertLinks($input, ['target' => '_blank']));
}

public static function getLinkText(): iterable
public static function provideConvertLinksWithLinksCases(): iterable
{
// @noinspection JSUnusedLocalSymbols
return [
Expand Down Expand Up @@ -87,7 +87,7 @@ public static function getLinkText(): iterable
/**
* @return string[][]
*/
public static function getLinkTargetText(): iterable
public static function provideConvertLinksWithOptionsCases(): iterable
{
// @noinspection JSUnusedLocalSymbols
return [
Expand All @@ -109,7 +109,7 @@ public static function getLinkTargetText(): iterable
/**
* @return string[][]
*/
public static function getMailText(): iterable
public static function provideConvertLinksWithMailsCases(): iterable
{
// @noinspection JSUnusedLocalSymbols
return [
Expand Down
4 changes: 2 additions & 2 deletions tests/Util/StringUtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
final class StringUtilsTest extends TestCase
{
/**
* @dataProvider getObfuscatedStrings
* @dataProvider provideObfuscateCases
*/
public function testObfuscate(string $input, int $start, int $end, string $replacement, string $output): void
{
self::assertSame($output, StringUtils::obfuscate($input, $start, $end, $replacement));
}

public static function getObfuscatedStrings(): iterable
public static function provideObfuscateCases(): iterable
{
return [
['Foo Bar Baz', 'start' => -3, 'end' => 1, 'replacement' => ' ', 'Foo Bar z'],
Expand Down
5 changes: 5 additions & 0 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@
"phpstan/extension-installer": true
},
"bin-dir": "../../vendor/bin"
},
"extra": {
"symfony": {
"require": "6.4.*"
}
}
}