Skip to content

Commit 8c3224f

Browse files
author
MartkCz
committed
Replaced new self with new static
1 parent 0a6690b commit 8c3224f

22 files changed

+35
-35
lines changed

src/Components/AlterOperation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function __construct(
181181
*/
182182
public static function parse(Parser $parser, TokensList $list, array $options = [])
183183
{
184-
$ret = new self();
184+
$ret = new static();
185185

186186
/**
187187
* Counts brackets.

src/Components/ArrayObj.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(array $raw = [], array $values = [])
5555
*/
5656
public static function parse(Parser $parser, TokensList $list, array $options = [])
5757
{
58-
$ret = empty($options['type']) ? new self() : [];
58+
$ret = empty($options['type']) ? new static() : [];
5959

6060
/**
6161
* The last raw expression.

src/Components/CaseExpression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct()
8686
*/
8787
public static function parse(Parser $parser, TokensList $list, array $options = [])
8888
{
89-
$ret = new self();
89+
$ret = new static();
9090

9191
/**
9292
* State of parser.

src/Components/Condition.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
101101
{
102102
$ret = [];
103103

104-
$expr = new self();
104+
$expr = new static();
105105

106106
/**
107107
* Counts brackets.
@@ -159,12 +159,12 @@ public static function parse(Parser $parser, TokensList $list, array $options =
159159
}
160160

161161
// Adding the operator.
162-
$expr = new self($token->value);
162+
$expr = new static($token->value);
163163
$expr->isOperator = true;
164164
$ret[] = $expr;
165165

166166
// Preparing to parse another condition.
167-
$expr = new self();
167+
$expr = new static();
168168
continue;
169169
}
170170
}

src/Components/CreateDefinition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
176176
{
177177
$ret = [];
178178

179-
$expr = new self();
179+
$expr = new static();
180180

181181
/**
182182
* The state of the parser.
@@ -285,7 +285,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
285285
if (! empty($expr->type) || ! empty($expr->key)) {
286286
$ret[] = $expr;
287287
}
288-
$expr = new self();
288+
$expr = new static();
289289
if ($token->value === ',') {
290290
$state = 1;
291291
} elseif ($token->value === ')') {

src/Components/DataType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function __construct(
9898
*/
9999
public static function parse(Parser $parser, TokensList $list, array $options = [])
100100
{
101-
$ret = new self();
101+
$ret = new static();
102102

103103
/**
104104
* The state of the parser.

src/Components/Expression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function __construct($database = null, $table = null, $column = null, $al
157157
*/
158158
public static function parse(Parser $parser, TokensList $list, array $options = [])
159159
{
160-
$ret = new self();
160+
$ret = new static();
161161

162162
/**
163163
* Whether current tokens make an expression or a table reference.

src/Components/FunctionCall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct($name = null, $parameters = null)
5959
*/
6060
public static function parse(Parser $parser, TokensList $list, array $options = [])
6161
{
62-
$ret = new self();
62+
$ret = new static();
6363

6464
/**
6565
* The state of the parser.

src/Components/GroupKeyword.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
4848
{
4949
$ret = [];
5050

51-
$expr = new self();
51+
$expr = new static();
5252

5353
/**
5454
* The state of the parser.
@@ -96,7 +96,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
9696
if (! empty($expr->expr)) {
9797
$ret[] = $expr;
9898
}
99-
$expr = new self();
99+
$expr = new static();
100100
$state = 0;
101101
} else {
102102
break;

src/Components/IndexHint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function __construct(string $type = null, string $indexOrKey = null, stri
7474
public static function parse(Parser $parser, TokensList $list, array $options = [])
7575
{
7676
$ret = [];
77-
$expr = new self();
77+
$expr = new static();
7878
$expr->type = isset($options['type']) ? $options['type'] : null;
7979
/**
8080
* The state of the parser.
@@ -143,7 +143,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
143143
$expr->indexes = ExpressionArray::parse($parser, $list);
144144
$state = 0;
145145
$ret[] = $expr;
146-
$expr = new self();
146+
$expr = new static();
147147
}
148148
break;
149149
case 3:
@@ -163,7 +163,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
163163
$expr->indexes = ExpressionArray::parse($parser, $list);
164164
$state = 0;
165165
$ret[] = $expr;
166-
$expr = new self();
166+
$expr = new static();
167167
break;
168168
}
169169
}

0 commit comments

Comments
 (0)