Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/Adapter/BaseAdapter.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

namespace ipl\Sql\Adapter;
Expand All @@ -24,7 +24,7 @@
protected array $quoteCharacter = ['"', '"'];

/** @var string Character to use for escaping quote characters */
protected string $escapeCharacter = '\\"';
protected string $escapeCharacter = '""';

/** @var array Default PDO connect options */
protected array $options = [
Expand Down Expand Up @@ -52,7 +52,7 @@

public function getOptions(Config $config): array
{
if (is_array($config->options)) {

Check failure on line 55 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Call to function is_array() with array will always evaluate to true.

Check failure on line 55 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Call to function is_array() with array will always evaluate to true.

Check failure on line 55 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Call to function is_array() with array will always evaluate to true.

Check failure on line 55 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Call to function is_array() with array will always evaluate to true.
return $config->options + $this->options;
}

Expand All @@ -75,8 +75,8 @@
continue;
}

$identifiers[$i] = $this->quoteCharacter[0]

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Binary operation "." between string and mixed results in an error.

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Binary operation "." between mixed and string results in an error.

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Binary operation "." between string and mixed results in an error.

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Binary operation "." between mixed and string results in an error.

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Binary operation "." between string and mixed results in an error.

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Binary operation "." between mixed and string results in an error.

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Binary operation "." between string and mixed results in an error.

Check failure on line 78 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Binary operation "." between mixed and string results in an error.
. str_replace($this->quoteCharacter[0], $this->escapeCharacter, $identifier)

Check failure on line 79 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #1 $search of function str_replace expects array<string>|string, mixed given.

Check failure on line 79 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #1 $search of function str_replace expects array<string>|string, mixed given.

Check failure on line 79 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #1 $search of function str_replace expects array<string>|string, mixed given.

Check failure on line 79 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #1 $search of function str_replace expects array<string>|string, mixed given.
. $this->quoteCharacter[1];
}

Expand All @@ -87,15 +87,15 @@
{
$queryBuilder->on(QueryBuilder::ON_ASSEMBLE_SELECT, function (Select $select): void {
if ($select->hasOrderBy()) {
foreach ($select->getOrderBy() as [$_, $direction]) {

Check failure on line 90 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot use array destructuring on mixed.

Check failure on line 90 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot use array destructuring on mixed.

Check failure on line 90 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Cannot use array destructuring on mixed.

Check failure on line 90 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot use array destructuring on mixed.
switch (strtolower($direction ?? '')) {

Check failure on line 91 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #1 $string of function strtolower expects string, mixed given.

Check failure on line 91 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #1 $string of function strtolower expects string, mixed given.

Check failure on line 91 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #1 $string of function strtolower expects string, mixed given.

Check failure on line 91 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #1 $string of function strtolower expects string, mixed given.
case '':
case 'asc':
case 'desc':
break;
default:
throw new UnexpectedValueException(
sprintf('Invalid direction "%s" in ORDER BY', $direction)

Check failure on line 98 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.

Check failure on line 98 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.

Check failure on line 98 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.

Check failure on line 98 in src/Adapter/BaseAdapter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
);
}
}
Expand Down
Loading