Skip to content

Commit 05c40f0

Browse files
nicolas-grekasfabpot
authored andcommitted
Bump minimum version of PHP to 8.1
1 parent f2bc51d commit 05c40f0

9 files changed

+45
-47
lines changed

Diff for: Tests/Parser/Handler/AbstractHandlerTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ abstract protected function generateHandler();
5252
protected function assertStreamEmpty(TokenStream $stream)
5353
{
5454
$property = new \ReflectionProperty($stream, 'tokens');
55-
$property->setAccessible(true);
5655

5756
$this->assertEquals([], $property->getValue($stream));
5857
}

Diff for: Tests/Parser/ReaderTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public function testToEnd()
9696
private function assignPosition(Reader $reader, int $value)
9797
{
9898
$position = new \ReflectionProperty($reader, 'position');
99-
$position->setAccessible(true);
10099
$position->setValue($reader, $value);
101100
}
102101
}

Diff for: XPath/Extension/AttributeMatchingExtension.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ class AttributeMatchingExtension extends AbstractExtension
3232
public function getAttributeMatchingTranslators(): array
3333
{
3434
return [
35-
'exists' => [$this, 'translateExists'],
36-
'=' => [$this, 'translateEquals'],
37-
'~=' => [$this, 'translateIncludes'],
38-
'|=' => [$this, 'translateDashMatch'],
39-
'^=' => [$this, 'translatePrefixMatch'],
40-
'$=' => [$this, 'translateSuffixMatch'],
41-
'*=' => [$this, 'translateSubstringMatch'],
42-
'!=' => [$this, 'translateDifferent'],
35+
'exists' => $this->translateExists(...),
36+
'=' => $this->translateEquals(...),
37+
'~=' => $this->translateIncludes(...),
38+
'|=' => $this->translateDashMatch(...),
39+
'^=' => $this->translatePrefixMatch(...),
40+
'$=' => $this->translateSuffixMatch(...),
41+
'*=' => $this->translateSubstringMatch(...),
42+
'!=' => $this->translateDifferent(...),
4343
];
4444
}
4545

Diff for: XPath/Extension/CombinationExtension.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class CombinationExtension extends AbstractExtension
3131
public function getCombinationTranslators(): array
3232
{
3333
return [
34-
' ' => [$this, 'translateDescendant'],
35-
'>' => [$this, 'translateChild'],
36-
'+' => [$this, 'translateDirectAdjacent'],
37-
'~' => [$this, 'translateIndirectAdjacent'],
34+
' ' => $this->translateDescendant(...),
35+
'>' => $this->translateChild(...),
36+
'+' => $this->translateDirectAdjacent(...),
37+
'~' => $this->translateIndirectAdjacent(...),
3838
];
3939
}
4040

Diff for: XPath/Extension/FunctionExtension.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class FunctionExtension extends AbstractExtension
3636
public function getFunctionTranslators(): array
3737
{
3838
return [
39-
'nth-child' => [$this, 'translateNthChild'],
40-
'nth-last-child' => [$this, 'translateNthLastChild'],
41-
'nth-of-type' => [$this, 'translateNthOfType'],
42-
'nth-last-of-type' => [$this, 'translateNthLastOfType'],
43-
'contains' => [$this, 'translateContains'],
44-
'lang' => [$this, 'translateLang'],
39+
'nth-child' => $this->translateNthChild(...),
40+
'nth-last-child' => $this->translateNthLastChild(...),
41+
'nth-of-type' => $this->translateNthOfType(...),
42+
'nth-last-of-type' => $this->translateNthLastOfType(...),
43+
'contains' => $this->translateContains(...),
44+
'lang' => $this->translateLang(...),
4545
];
4646
}
4747

Diff for: XPath/Extension/HtmlExtension.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ public function __construct(Translator $translator)
4242
public function getPseudoClassTranslators(): array
4343
{
4444
return [
45-
'checked' => [$this, 'translateChecked'],
46-
'link' => [$this, 'translateLink'],
47-
'disabled' => [$this, 'translateDisabled'],
48-
'enabled' => [$this, 'translateEnabled'],
49-
'selected' => [$this, 'translateSelected'],
50-
'invalid' => [$this, 'translateInvalid'],
51-
'hover' => [$this, 'translateHover'],
52-
'visited' => [$this, 'translateVisited'],
45+
'checked' => $this->translateChecked(...),
46+
'link' => $this->translateLink(...),
47+
'disabled' => $this->translateDisabled(...),
48+
'enabled' => $this->translateEnabled(...),
49+
'selected' => $this->translateSelected(...),
50+
'invalid' => $this->translateInvalid(...),
51+
'hover' => $this->translateHover(...),
52+
'visited' => $this->translateVisited(...),
5353
];
5454
}
5555

@@ -59,7 +59,7 @@ public function getPseudoClassTranslators(): array
5959
public function getFunctionTranslators(): array
6060
{
6161
return [
62-
'lang' => [$this, 'translateLang'],
62+
'lang' => $this->translateLang(...),
6363
];
6464
}
6565

Diff for: XPath/Extension/NodeExtension.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public function hasFlag(int $flag): bool
6565
public function getNodeTranslators(): array
6666
{
6767
return [
68-
'Selector' => [$this, 'translateSelector'],
69-
'CombinedSelector' => [$this, 'translateCombinedSelector'],
70-
'Negation' => [$this, 'translateNegation'],
71-
'Function' => [$this, 'translateFunction'],
72-
'Pseudo' => [$this, 'translatePseudo'],
73-
'Attribute' => [$this, 'translateAttribute'],
74-
'Class' => [$this, 'translateClass'],
75-
'Hash' => [$this, 'translateHash'],
76-
'Element' => [$this, 'translateElement'],
68+
'Selector' => $this->translateSelector(...),
69+
'CombinedSelector' => $this->translateCombinedSelector(...),
70+
'Negation' => $this->translateNegation(...),
71+
'Function' => $this->translateFunction(...),
72+
'Pseudo' => $this->translatePseudo(...),
73+
'Attribute' => $this->translateAttribute(...),
74+
'Class' => $this->translateClass(...),
75+
'Hash' => $this->translateHash(...),
76+
'Element' => $this->translateElement(...),
7777
];
7878
}
7979

Diff for: XPath/Extension/PseudoClassExtension.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ class PseudoClassExtension extends AbstractExtension
3232
public function getPseudoClassTranslators(): array
3333
{
3434
return [
35-
'root' => [$this, 'translateRoot'],
36-
'first-child' => [$this, 'translateFirstChild'],
37-
'last-child' => [$this, 'translateLastChild'],
38-
'first-of-type' => [$this, 'translateFirstOfType'],
39-
'last-of-type' => [$this, 'translateLastOfType'],
40-
'only-child' => [$this, 'translateOnlyChild'],
41-
'only-of-type' => [$this, 'translateOnlyOfType'],
42-
'empty' => [$this, 'translateEmpty'],
35+
'root' => $this->translateRoot(...),
36+
'first-child' => $this->translateFirstChild(...),
37+
'last-child' => $this->translateLastChild(...),
38+
'first-of-type' => $this->translateFirstOfType(...),
39+
'last-of-type' => $this->translateLastOfType(...),
40+
'only-child' => $this->translateOnlyChild(...),
41+
'only-of-type' => $this->translateOnlyOfType(...),
42+
'empty' => $this->translateEmpty(...),
4343
];
4444
}
4545

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=8.0.2"
23+
"php": ">=8.1"
2424
},
2525
"autoload": {
2626
"psr-4": { "Symfony\\Component\\CssSelector\\": "" },

0 commit comments

Comments
 (0)