Skip to content

Commit 5194f18

Browse files
derrabusnicolas-grekas
authored andcommitted
Leverage str_contains/str_starts_with
Signed-off-by: Alexander M. Turek <[email protected]>
1 parent 8da05a9 commit 5194f18

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Diff for: Parser/Parser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static function parseSeries(array $tokens): array
7979
return [2, 0];
8080
case 'n' === $joined:
8181
return [1, 0];
82-
case false === strpos($joined, 'n'):
82+
case !str_contains($joined, 'n'):
8383
return [0, $int($joined)];
8484
}
8585

Diff for: XPath/Translator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ public function __construct(ParserInterface $parser = null)
6363

6464
public static function getXpathLiteral(string $element): string
6565
{
66-
if (false === strpos($element, "'")) {
66+
if (!str_contains($element, "'")) {
6767
return "'".$element."'";
6868
}
6969

70-
if (false === strpos($element, '"')) {
70+
if (!str_contains($element, '"')) {
7171
return '"'.$element.'"';
7272
}
7373

Diff for: composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=7.1.3"
23+
"php": ">=7.1.3",
24+
"symfony/polyfill-php80": "^1.16"
2425
},
2526
"autoload": {
2627
"psr-4": { "Symfony\\Component\\CssSelector\\": "" },

0 commit comments

Comments
 (0)