Skip to content

Commit b0667a6

Browse files
authored
[11.x] Use constructor property promotion for database query condition expression (#54302)
* Use constructor property promotion for database query condition expression * StyleCI
1 parent dbe6b14 commit b0667a6

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/Illuminate/Database/Query/Expression.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,27 @@
55
use Illuminate\Contracts\Database\Query\Expression as ExpressionContract;
66
use Illuminate\Database\Grammar;
77

8+
/**
9+
* @template TValue of string|int|float
10+
*/
811
class Expression implements ExpressionContract
912
{
10-
/**
11-
* The value of the expression.
12-
*
13-
* @var string|int|float
14-
*/
15-
protected $value;
16-
1713
/**
1814
* Create a new raw query expression.
1915
*
20-
* @param string|int|float $value
16+
* @param TValue $value
2117
* @return void
2218
*/
23-
public function __construct($value)
24-
{
25-
$this->value = $value;
19+
public function __construct(
20+
protected $value
21+
) {
2622
}
2723

2824
/**
2925
* Get the value of the expression.
3026
*
3127
* @param \Illuminate\Database\Grammar $grammar
32-
* @return string|int|float
28+
* @return TValue
3329
*/
3430
public function getValue(Grammar $grammar)
3531
{

0 commit comments

Comments
 (0)