From 69627855e33549939659121da16127119ab63bd2 Mon Sep 17 00:00:00 2001 From: W0rma Date: Thu, 31 Oct 2024 20:38:02 +0100 Subject: [PATCH] Apply cs fixer v2.19.3 --- .github/workflows/cs.yaml | 2 +- .php_cs.dist | 1 + src/HTML5.php | 1 - src/HTML5/Parser/DOMTreeBuilder.php | 2 -- src/HTML5/Parser/Tokenizer.php | 1 + src/HTML5/Parser/TreeBuildingRules.php | 1 - test/HTML5/Parser/DOMTreeBuilderTest.php | 2 +- test/HTML5/Parser/ScannerTest.php | 2 +- test/HTML5/Parser/TokenizerTest.php | 2 +- test/HTML5/Parser/TreeBuildingRulesTest.php | 6 +++--- test/HTML5/Serializer/OutputRulesTest.php | 2 +- 11 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cs.yaml b/.github/workflows/cs.yaml index 38d6364d..266666de 100644 --- a/.github/workflows/cs.yaml +++ b/.github/workflows/cs.yaml @@ -28,5 +28,5 @@ jobs: - name: cs fix run: | - wget -q https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.13.1/php-cs-fixer.phar + wget -q https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.19.3/php-cs-fixer.phar php php-cs-fixer.phar fix --dry-run --diff diff --git a/.php_cs.dist b/.php_cs.dist index d5e49183..f6abb593 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -7,6 +7,7 @@ $finder = PhpCsFixer\Finder::create() return PhpCsFixer\Config::create() ->setRules(array( '@Symfony' => true, + 'array_syntax' => false, 'concat_space' => array('spacing' => 'one'), 'phpdoc_annotation_without_dot' => false, )) diff --git a/src/HTML5.php b/src/HTML5.php index c857145f..49a90daf 100644 --- a/src/HTML5.php +++ b/src/HTML5.php @@ -146,7 +146,6 @@ public function hasErrors() * Parse an input string. * * @param string $input - * @param array $options * * @return \DOMDocument */ diff --git a/src/HTML5/Parser/DOMTreeBuilder.php b/src/HTML5/Parser/DOMTreeBuilder.php index d165b66b..85651179 100644 --- a/src/HTML5/Parser/DOMTreeBuilder.php +++ b/src/HTML5/Parser/DOMTreeBuilder.php @@ -231,8 +231,6 @@ public function fragment() * * This is used for handling Processor Instructions as they are * inserted. If omitted, PI's are inserted directly into the DOM tree. - * - * @param InstructionProcessor $proc */ public function setInstructionProcessor(InstructionProcessor $proc) { diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php index 0699cf1b..feb9a66e 100644 --- a/src/HTML5/Parser/Tokenizer.php +++ b/src/HTML5/Parser/Tokenizer.php @@ -729,6 +729,7 @@ protected function isCommentEnd() // Test for '!>' if ('!' == $this->scanner->current() && '>' == $this->scanner->peek()) { $this->scanner->consume(); // Consume the last '>' + return true; } // Unread '-' and one of '!' or '>'; diff --git a/src/HTML5/Parser/TreeBuildingRules.php b/src/HTML5/Parser/TreeBuildingRules.php index 00d3951f..4c6983b2 100644 --- a/src/HTML5/Parser/TreeBuildingRules.php +++ b/src/HTML5/Parser/TreeBuildingRules.php @@ -80,7 +80,6 @@ public function evaluate($new, $current) case 'thead': case 'tfoot': case 'table': // Spec isn't explicit about this, but it's necessary. - return $this->closeIfCurrentMatches($new, $current, array( 'thead', 'tfoot', diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php index 659378c6..1e1898c9 100644 --- a/test/HTML5/Parser/DOMTreeBuilderTest.php +++ b/test/HTML5/Parser/DOMTreeBuilderTest.php @@ -6,9 +6,9 @@ namespace Masterminds\HTML5\Tests\Parser; +use Masterminds\HTML5\Parser\DOMTreeBuilder; use Masterminds\HTML5\Parser\Scanner; use Masterminds\HTML5\Parser\Tokenizer; -use Masterminds\HTML5\Parser\DOMTreeBuilder; /** * These tests are functional, not necessarily unit tests. diff --git a/test/HTML5/Parser/ScannerTest.php b/test/HTML5/Parser/ScannerTest.php index 9f75c4db..a181c1ba 100644 --- a/test/HTML5/Parser/ScannerTest.php +++ b/test/HTML5/Parser/ScannerTest.php @@ -6,8 +6,8 @@ namespace Masterminds\HTML5\Tests\Parser; -use Masterminds\HTML5\Parser\StringInputStream; use Masterminds\HTML5\Parser\Scanner; +use Masterminds\HTML5\Parser\StringInputStream; class ScannerTest extends \Masterminds\HTML5\Tests\TestCase { diff --git a/test/HTML5/Parser/TokenizerTest.php b/test/HTML5/Parser/TokenizerTest.php index c9643c52..374896f6 100644 --- a/test/HTML5/Parser/TokenizerTest.php +++ b/test/HTML5/Parser/TokenizerTest.php @@ -2,9 +2,9 @@ namespace Masterminds\HTML5\Tests\Parser; -use Masterminds\HTML5\Parser\UTF8Utils; use Masterminds\HTML5\Parser\Scanner; use Masterminds\HTML5\Parser\Tokenizer; +use Masterminds\HTML5\Parser\UTF8Utils; class TokenizerTest extends \Masterminds\HTML5\Tests\TestCase { diff --git a/test/HTML5/Parser/TreeBuildingRulesTest.php b/test/HTML5/Parser/TreeBuildingRulesTest.php index 45c68bcf..ae17a349 100644 --- a/test/HTML5/Parser/TreeBuildingRulesTest.php +++ b/test/HTML5/Parser/TreeBuildingRulesTest.php @@ -6,10 +6,10 @@ namespace Masterminds\HTML5\Tests\Parser; -use Masterminds\HTML5\Parser\TreeBuildingRules; -use Masterminds\HTML5\Parser\Tokenizer; -use Masterminds\HTML5\Parser\Scanner; use Masterminds\HTML5\Parser\DOMTreeBuilder; +use Masterminds\HTML5\Parser\Scanner; +use Masterminds\HTML5\Parser\Tokenizer; +use Masterminds\HTML5\Parser\TreeBuildingRules; /** * These tests are functional, not necessarily unit tests. diff --git a/test/HTML5/Serializer/OutputRulesTest.php b/test/HTML5/Serializer/OutputRulesTest.php index 57415797..bb098533 100644 --- a/test/HTML5/Serializer/OutputRulesTest.php +++ b/test/HTML5/Serializer/OutputRulesTest.php @@ -2,9 +2,9 @@ namespace Masterminds\HTML5\Tests\Serializer; +use Masterminds\HTML5; use Masterminds\HTML5\Serializer\OutputRules; use Masterminds\HTML5\Serializer\Traverser; -use Masterminds\HTML5; class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase {