Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
27285b19
Unverified
Commit
27285b19
authored
Jan 15, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an assertion for the preg_replace() result
parent
51a95ca6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+5
-1
phpstan.neon.dist
phpstan.neon.dist
+0
-3
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
27285b19
...
@@ -3141,11 +3141,15 @@ abstract class AbstractPlatform
...
@@ -3141,11 +3141,15 @@ abstract class AbstractPlatform
*/
*/
final
public
function
escapeStringForLike
(
string
$inputString
,
string
$escapeChar
)
:
string
final
public
function
escapeStringForLike
(
string
$inputString
,
string
$escapeChar
)
:
string
{
{
return
preg_replace
(
$sql
=
preg_replace
(
'~(['
.
preg_quote
(
$this
->
getLikeWildcardCharacters
()
.
$escapeChar
,
'~'
)
.
'])~u'
,
'~(['
.
preg_quote
(
$this
->
getLikeWildcardCharacters
()
.
$escapeChar
,
'~'
)
.
'])~u'
,
addcslashes
(
$escapeChar
,
'\\'
)
.
'$1'
,
addcslashes
(
$escapeChar
,
'\\'
)
.
'$1'
,
$inputString
$inputString
);
);
assert
(
is_string
(
$sql
));
return
$sql
;
}
}
protected
function
getLikeWildcardCharacters
()
:
string
protected
function
getLikeWildcardCharacters
()
:
string
...
...
phpstan.neon.dist
View file @
27285b19
...
@@ -19,9 +19,6 @@ parameters:
...
@@ -19,9 +19,6 @@ parameters:
# https://github.com/phpstan/phpstan/issues/1847
# https://github.com/phpstan/phpstan/issues/1847
- '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array<string>, array<int, int|string> given\.\z~'
- '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array<string>, array<int, int|string> given\.\z~'
# PHPStan is too strict about preg_replace(): https://phpstan.org/r/993dc99f-0d43-4b51-868b-d01f982c1463
- '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string\|null\.\z~'
# legacy remnants from doctrine/common
# legacy remnants from doctrine/common
- '~^Class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy) not found\.\z~'
- '~^Class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy) not found\.\z~'
- '~^.+ on an unknown class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy)\.\z~'
- '~^.+ on an unknown class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy)\.\z~'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment