Skip to content

Commit 95ba046

Browse files
committed
chore: new code styling rules
1 parent f6a3fc3 commit 95ba046

31 files changed

+31
-61
lines changed

src/Function/Aggregate/AggregateExpression.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ abstract class AggregateExpression implements Expression
1717

1818
public function __construct(
1919
private readonly string|Expression $value,
20-
) {
21-
}
20+
) {}
2221

2322
public function getValue(Grammar $grammar): string
2423
{

src/Function/Aggregate/Count.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ class Count implements Expression
1515
public function __construct(
1616
private readonly string|Expression $value,
1717
private readonly bool $distinct = false,
18-
) {
19-
}
18+
) {}
2019

2120
public function getValue(Grammar $grammar): string
2221
{

src/Function/Aggregate/CountFilter.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class CountFilter implements Expression
1616

1717
public function __construct(
1818
private readonly Expression $filter,
19-
) {
20-
}
19+
) {}
2120

2221
public function getValue(Grammar $grammar): string
2322
{

src/Function/Aggregate/SumFilter.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class SumFilter implements Expression
1717
public function __construct(
1818
private readonly string|Expression $value,
1919
private readonly Expression $filter,
20-
) {
21-
}
20+
) {}
2221

2322
public function getValue(Grammar $grammar): string
2423
{

src/Function/Comparison/StrListContains.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class StrListContains implements ConditionExpression
1818
public function __construct(
1919
private readonly string|Expression $strList,
2020
private readonly string|Expression $str,
21-
) {
22-
}
21+
) {}
2322

2423
public function getValue(Grammar $grammar)
2524
{

src/Function/Conditional/ManyArgumentsExpression.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ abstract class ManyArgumentsExpression implements Expression
2020
*/
2121
public function __construct(
2222
private readonly array $expressions,
23-
) {
24-
}
23+
) {}
2524

2625
/**
2726
* @return non-empty-array<int, float|int|string>

src/Function/Math/Abs.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Abs implements Expression
1616

1717
public function __construct(
1818
private readonly string|Expression $expression,
19-
) {
20-
}
19+
) {}
2120

2221
public function getValue(Grammar $grammar): string
2322
{

src/Function/String/Lower.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Lower implements Expression
1616

1717
public function __construct(
1818
private readonly string|Expression $expression,
19-
) {
20-
}
19+
) {}
2120

2221
public function getValue(Grammar $grammar): string
2322
{

src/Function/String/Upper.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Upper implements Expression
1616

1717
public function __construct(
1818
private readonly string|Expression $expression,
19-
) {
20-
}
19+
) {}
2120

2221
public function getValue(Grammar $grammar): string
2322
{

src/Language/Alias.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class Alias implements Expression
1717
public function __construct(
1818
private readonly string|Expression $expression,
1919
private readonly string $name,
20-
) {
21-
}
20+
) {}
2221

2322
public function getValue(Grammar $grammar): string
2423
{

src/Language/CaseGroup.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class CaseGroup implements Expression
2020
public function __construct(
2121
private readonly array $when,
2222
private readonly string|Expression|null $else = null,
23-
) {
24-
}
23+
) {}
2524

2625
public function getValue(Grammar $grammar): string
2726
{

src/Language/CaseRule.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class CaseRule implements Expression
1616
public function __construct(
1717
private readonly string|Expression $result,
1818
private readonly ConditionExpression $condition,
19-
) {
20-
}
19+
) {}
2120

2221
public function getValue(Grammar $grammar): string
2322
{

src/Language/Cast.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ class Cast implements Expression
2424
public function __construct(
2525
private readonly string|Expression $expression,
2626
private readonly string $type,
27-
) {
28-
}
27+
) {}
2928

3029
public function getValue(Grammar $grammar): string
3130
{

src/Operator/Bitwise/BitNot.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class BitNot implements Expression
1414

1515
public function __construct(
1616
private readonly string|Expression $value,
17-
) {
18-
}
17+
) {}
1918

2019
public function getValue(Grammar $grammar)
2120
{

src/Operator/Bitwise/BitXor.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class BitXor implements Expression
1717
public function __construct(
1818
private readonly string|Expression $value1,
1919
private readonly string|Expression $value2,
20-
) {
21-
}
20+
) {}
2221

2322
public function getValue(Grammar $grammar)
2423
{

src/Operator/Bitwise/ShiftLeft.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class ShiftLeft implements Expression
1717
public function __construct(
1818
private readonly string|Expression $value,
1919
private readonly string|Expression $times,
20-
) {
21-
}
20+
) {}
2221

2322
public function getValue(Grammar $grammar)
2423
{

src/Operator/Bitwise/ShiftRight.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class ShiftRight implements Expression
1717
public function __construct(
1818
private readonly string|Expression $value,
1919
private readonly string|Expression $times,
20-
) {
21-
}
20+
) {}
2221

2322
public function getValue(Grammar $grammar)
2423
{

src/Operator/Comparison/Between.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ public function __construct(
1818
private readonly string|Expression $min,
1919
private readonly string|Expression $max,
2020

21-
) {
22-
}
21+
) {}
2322

2423
public function getValue(Grammar $grammar)
2524
{

src/Operator/Comparison/DistinctFrom.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class DistinctFrom implements ConditionExpression
1818
public function __construct(
1919
private readonly string|Expression $value1,
2020
private readonly string|Expression $value2,
21-
) {
22-
}
21+
) {}
2322

2423
public function getValue(Grammar $grammar)
2524
{

src/Operator/Comparison/IsNull.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class IsNull implements ConditionExpression
1616
public function __construct(
1717
private readonly string|Expression $value,
1818

19-
) {
20-
}
19+
) {}
2120

2221
public function getValue(Grammar $grammar)
2322
{

src/Operator/Comparison/NotDistinctFrom.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class NotDistinctFrom implements ConditionExpression
1818
public function __construct(
1919
private readonly string|Expression $value1,
2020
private readonly string|Expression $value2,
21-
) {
22-
}
21+
) {}
2322

2423
public function getValue(Grammar $grammar)
2524
{

src/Operator/Comparison/NotIsNull.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class NotIsNull implements ConditionExpression
1616
public function __construct(
1717
private readonly string|Expression $value,
1818

19-
) {
20-
}
19+
) {}
2120

2221
public function getValue(Grammar $grammar)
2322
{

src/Operator/Logical/CondNot.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ class CondNot implements ConditionExpression
1515

1616
public function __construct(
1717
private readonly Expression $value,
18-
) {
19-
}
18+
) {}
2019

2120
public function getValue(Grammar $grammar)
2221
{

src/Operator/Logical/CondXor.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public function __construct(
1919
private readonly Expression $value1,
2020
private readonly Expression $value2,
2121

22-
) {
23-
}
22+
) {}
2423

2524
public function getValue(Grammar $grammar)
2625
{

src/Operator/Logical/LogicalExpression.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ abstract class LogicalExpression implements ConditionExpression
1919
public function __construct(
2020
private readonly Expression $value1,
2121
private readonly Expression $value2,
22-
) {
23-
}
22+
) {}
2423

2524
public function getValue(Grammar $grammar): string
2625
{

src/Operator/OperatorExpression.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ abstract class OperatorExpression implements Expression
1818
public function __construct(
1919
private readonly string|Expression $value1,
2020
private readonly string|Expression $value2,
21-
) {
22-
}
21+
) {}
2322

2423
public function getValue(Grammar $grammar): string
2524
{

src/Value/Number.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class Number implements Expression
1111
{
1212
public function __construct(
1313
private readonly int|float $value,
14-
) {
15-
}
14+
) {}
1615

1716
public function getValue(Grammar $grammar): string
1817
{

src/Value/Value.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class Value implements Expression
1212
public function __construct(
1313
private readonly string|int|float|bool|null $value,
1414
private readonly bool $binary = false,
15-
) {
16-
}
15+
) {}
1716

1817
public function getValue(Grammar $grammar): string
1918
{

tests/ConditionExpression.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@
77
use Illuminate\Contracts\Database\Query\ConditionExpression as ConditionExpressionContract;
88
use Illuminate\Database\Query\Expression;
99

10-
class ConditionExpression extends Expression implements ConditionExpressionContract
11-
{
12-
}
10+
class ConditionExpression extends Expression implements ConditionExpressionContract {}

tests/Function/String/Uuid4Test.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
it('can generate UUIDv4 values')
88
->skipOnMariaBefore('10.10')
99
->skipOnPgsqlBefore('13')
10-
->expect(new Uuid4())
10+
->expect(new Uuid4)
1111
->toBeExecutable()
1212
->toBeMysql("(lower(concat(hex(random_bytes(4)),'-',hex(random_bytes(2)),'-4',substr(hex(random_bytes(2)), -3),'-',hex((ascii(random_bytes(1))>>6)+8),substr(hex(random_bytes(2)),-3),'-',hex(random_bytes(6)))))")
1313
->toBePgsql('gen_random_uuid()')

tests/Function/Time/NowTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Tpetry\QueryExpressions\Function\Time\Now;
66

77
it('can generate the current time')
8-
->expect(new Now())
8+
->expect(new Now)
99
->toBeExecutable()
1010
->toBeMysql('(current_timestamp)')
1111
->toBePgsql('statement_timestamp()')

0 commit comments

Comments
 (0)