Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
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
2 changes: 1 addition & 1 deletion 2 composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "phpmyadmin/sql-parser",
"name": "wpml/sql-parser",
"description": "A validating SQL lexer and parser with a focus on MySQL dialect.",
"license": "GPL-2.0-or-later",
"keywords": ["sql", "lexer", "parser", "analysis"],
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Components/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Condition extends Component
*/
public function __construct($expr = null)
{
$this->expr = trim($expr);
$this->expr = trim((string) $expr);
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

And is quite okay on 6.0

public function __construct(string|null $expr = null)
{
$this->expr = trim((string) $expr);

}

/**
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,12 @@ public function parse()
* Creates a new error log.
*
* @param string $msg the error message
* @param Token $token the token that produced the error
* @param Token|null $token the token that produced the error
* @param int $code the code of the error
*
* @throws ParserException throws the exception, if strict mode is enabled
*/
public function error($msg, Token $token = null, $code = 0)
public function error($msg, ?Token $token = null, $code = 0)
Copy link
Member

Choose a reason for hiding this comment

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

same, this is okay on both currently released versions

{
$error = new ParserException(
Translator::gettext($msg),
Expand Down
6 changes: 3 additions & 3 deletions 6 src/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ abstract class Statement
/**
* Constructor.
*
* @param Parser $parser the instance that requests parsing
* @param TokensList $list the list of tokens to be parsed
* @param Parser|null $parser the instance that requests parsing
* @param TokensList|null $list the list of tokens to be parsed
*/
public function __construct(Parser $parser = null, TokensList $list = null)
public function __construct(?Parser $parser = null, ?TokensList $list = null)
Copy link
Member

Choose a reason for hiding this comment

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

Same

public function __construct(Parser|null $parser = null, TokensList|null $list = null)

{
if (($parser !== null) && ($list !== null)) {
$this->parse($parser, $list);
Expand Down
4 changes: 4 additions & 0 deletions 4 src/TokensList.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public function getNextOfTypeAndValue($type, $value)
* @param int $offset the offset to be set
* @param Token $value the token to be saved
*/
#[\ReturnTypeWillChange]
Copy link
Member

Choose a reason for hiding this comment

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

Already done:

#[\ReturnTypeWillChange]

And return type changed in 6.0 versions

public function offsetSet($offset, $value)
{
if ($offset === null) {
Expand All @@ -169,6 +170,7 @@ public function offsetSet($offset, $value)
*
* @return Token
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $offset < $this->count ? $this->tokens[$offset] : null;
Expand All @@ -181,6 +183,7 @@ public function offsetGet($offset)
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return $offset < $this->count;
Expand All @@ -191,6 +194,7 @@ public function offsetExists($offset)
*
* @param int $offset the offset to be unset
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->tokens[$offset]);
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.