Skip to content

Commit

Permalink
nitpick pdo
Browse files Browse the repository at this point in the history
  • Loading branch information
divinity76 committed Dec 13, 2023
1 parent c6da258 commit e94d65f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Dom/Selector/XPathSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ public function expressionFindOne(int $position): string
*
* @author Robert Rossney ( https://stackoverflow.com/users/19403/robert-rossney )
*
* @param string $value
* @param string $string
*
* @return string
*/
public static function quote(string $value): string
public static function quote(string $string): string
{
if (false === \strpos($value, '"')) {
return '"'.$value.'"';
if (false === \strpos($string, '"')) {
return '"'.$string.'"';
}
if (false === \strpos($value, '\'')) {
return '\''.$value.'\'';
if (false === \strpos($string, '\'')) {
return '\''.$string.'\'';
}
// if the value contains both single and double quotes, construct an
// if the string contains both single and double quotes, construct an
// expression that concatenates all non-double-quote substrings with
// the quotes, e.g.:
// concat("'foo'", '"', "bar")
$sb = 'concat(';
$substrings = \explode('"', $value);
$substrings = \explode('"', $string);
for ($i = 0; $i < \count($substrings); ++$i) {
$needComma = ($i > 0);
if ('' !== $substrings[$i]) {
Expand Down

0 comments on commit e94d65f

Please sign in to comment.