Skip to content

[CssSelector] [5.0] Add type-hint whenever possible #32328

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/Symfony/Component/CssSelector/CssSelectorConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,9 @@ public function __construct(bool $html = true)
* Optionally, a prefix can be added to the resulting XPath
* expression with the $prefix parameter.
*
* @param string $cssExpr The CSS expression
* @param string $prefix An optional prefix for the XPath expression
*
* @return string
*/
public function toXPath($cssExpr, $prefix = 'descendant-or-self::')
public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
{
return $this->translator->cssToXPath($cssExpr, $prefix);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SyntaxErrorException extends ParseException
*
* @return self
*/
public static function unexpectedToken($expectedValue, Token $foundToken)
public static function unexpectedToken(string $expectedValue, Token $foundToken)
{
return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
}
Expand All @@ -40,7 +40,7 @@ public static function unexpectedToken($expectedValue, Token $foundToken)
*
* @return self
*/
public static function pseudoElementFound($pseudoElement, $unexpectedLocation)
public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation)
{
return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
}
Expand All @@ -50,7 +50,7 @@ public static function pseudoElementFound($pseudoElement, $unexpectedLocation)
*
* @return self
*/
public static function unclosedString($position)
public static function unclosedString(int $position)
{
return new self(sprintf('Unclosed/invalid string at %s.', $position));
}
Expand Down