Skip to content
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

support non-falsy-string in rex_sql::escape() #5350

Merged
merged 3 commits into from
Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions redaxo/src/core/lib/sql/sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,10 @@ private function fetchMeta()
* @param string $value den zu escapenden Wert
*
* @return string
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interessant dass der cs-fixer das @return string unten entfernt hat, hier aber nicht

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Einmal steht es ja als nativer Return type dran

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich meinte diesen commit 0174ae5

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja, da wurde es entfernt, weil string schon als nativer Return type an der Methode steht.
Hier bei der Methode gibt es hingegen keinen nativen return type.

* @psalm-return ($value is numeric-string ? numeric-string : ($value is non-empty-string ? non-empty-string : string))
* @psalm-return ($value is numeric-string ? numeric-string :
* ($value is non-falsy-string ? non-falsy-string :
* ($value is non-empty-string ? non-empty-string : string
* )))
*/
public function escape($value)
{
Expand All @@ -1429,7 +1432,10 @@ public function escapeIdentifier($name)
/**
* Escapes the `LIKE` wildcard chars "%" and "_" in given value.
*
* @psalm-return ($value is numeric-string ? numeric-string : ($value is non-empty-string ? non-empty-string : string))
* @psalm-return ($value is numeric-string ? numeric-string :
* ($value is non-falsy-string ? non-falsy-string :
* ($value is non-empty-string ? non-empty-string : string
* )))
*/
public function escapeLikeWildcards(string $value): string
{
Expand Down