Skip to content

Commit b3ca2db

Browse files
committed
PHPCS - Required promoted property
PHPCS - Typehint -> native type PHPCS - delete empty commment
1 parent 73a12d3 commit b3ca2db

File tree

98 files changed

+310
-1335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+310
-1335
lines changed

ruleset.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,8 @@
113113
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
114114
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse"/>
115115
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
116+
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/>
117+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
118+
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
116119

117120
</ruleset>

src/Aggregation/AggregationCollection.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
class AggregationCollection implements LeafAggregationInterface
99
{
1010

11-
/**
12-
* @var \Spameri\ElasticQuery\Filter\FilterCollection
13-
*/
14-
private $filter;
11+
private \Spameri\ElasticQuery\Filter\FilterCollection $filter;
1512

1613
/**
1714
* @var array<\Spameri\ElasticQuery\Aggregation\LeafAggregationCollection>
1815
*/
19-
private $aggregations;
16+
private array $aggregations;
2017

2118

2219
public function __construct(

src/Aggregation/Avg.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@
1010
class Avg implements \Spameri\ElasticQuery\Aggregation\LeafAggregationInterface
1111
{
1212

13-
private string $field;
14-
15-
1613
public function __construct(
17-
string $field,
14+
private string $field,
1815
)
1916
{
20-
$this->field = $field;
2117
}
2218

2319

src/Aggregation/Histogram.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,11 @@
1111
class Histogram implements LeafAggregationInterface
1212
{
1313

14-
private string $field;
15-
16-
private int $interval;
17-
18-
1914
public function __construct(
20-
string $field,
21-
int $interval,
15+
private string $field,
16+
private int $interval,
2217
)
2318
{
24-
$this->field = $field;
25-
$this->interval = $interval;
2619
}
2720

2821

src/Aggregation/LeafAggregationCollection.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,16 @@
88
class LeafAggregationCollection implements LeafAggregationInterface, \IteratorAggregate
99
{
1010

11-
/**
12-
* @var string
13-
*/
14-
private $name;
15-
16-
/**
17-
* @var \Spameri\ElasticQuery\Filter\FilterCollection
18-
*/
19-
private $filter;
11+
private \Spameri\ElasticQuery\Filter\FilterCollection $filter;
2012

2113
/**
2214
* @var array<\Spameri\ElasticQuery\Aggregation\LeafAggregationInterface>
2315
*/
24-
private $aggregations;
16+
private array $aggregations;
2517

2618

2719
public function __construct(
28-
string $name,
20+
private string $name,
2921
\Spameri\ElasticQuery\Filter\FilterCollection|null $filter,
3022
\Spameri\ElasticQuery\Aggregation\LeafAggregationInterface ... $aggregations,
3123
)
@@ -34,7 +26,6 @@ public function __construct(
3426
$filter = new \Spameri\ElasticQuery\Filter\FilterCollection();
3527
}
3628

37-
$this->name = $name;
3829
$this->filter = $filter;
3930
$this->aggregations = $aggregations;
4031
}

src/Aggregation/Max.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
class Max implements \Spameri\ElasticQuery\Aggregation\LeafAggregationInterface
88
{
99

10-
private string $field;
11-
12-
1310
public function __construct(
14-
string $field,
11+
private string $field,
1512
)
1613
{
17-
$this->field = $field;
1814
}
1915

2016

src/Aggregation/Min.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
class Min implements \Spameri\ElasticQuery\Aggregation\LeafAggregationInterface
88
{
99

10-
private string $field;
11-
12-
1310
public function __construct(
14-
string $field,
11+
private string $field,
1512
) {
16-
$this->field = $field;
1713
}
1814

1915

src/Aggregation/Nested.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
class Nested implements \Spameri\ElasticQuery\Aggregation\LeafAggregationInterface
88
{
99

10-
private string $path;
11-
12-
1310
public function __construct(
14-
string $path,
11+
private string $path,
1512
) {
16-
$this->path = $path;
1713
}
1814

1915

src/Aggregation/Range.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,15 @@
1111
class Range implements LeafAggregationInterface
1212
{
1313

14-
/**
15-
* @var string
16-
*/
17-
private $field;
18-
19-
/**
20-
* @var bool
21-
*/
22-
private $keyed;
23-
24-
/**
25-
* @var \Spameri\ElasticQuery\Aggregation\RangeValueCollection
26-
*/
27-
private $ranges;
14+
private \Spameri\ElasticQuery\Aggregation\RangeValueCollection $ranges;
2815

2916

3017
public function __construct(
31-
string $field,
32-
bool $keyed = FALSE,
18+
private string $field,
19+
private bool $keyed = FALSE,
3320
\Spameri\ElasticQuery\Aggregation\RangeValueCollection $rangeValueCollection = NULL,
3421
)
3522
{
36-
$this->field = $field;
37-
$this->keyed = $keyed;
3823
$this->ranges = $rangeValueCollection ?: new \Spameri\ElasticQuery\Aggregation\RangeValueCollection();
3924
}
4025

src/Aggregation/RangeValue.php

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,18 @@
88
class RangeValue implements \Spameri\ElasticQuery\Entity\EntityInterface
99
{
1010

11-
private string $key;
12-
13-
/**
14-
* @var int|float|string|\DateTimeInterface|null
15-
*/
16-
private $from;
17-
18-
/**
19-
* @var int|float|string|\DateTimeInterface|null
20-
*/
21-
private $to;
22-
23-
private bool $fromEqual;
24-
25-
private bool $toEqual;
26-
2711
/**
2812
* @param int|float|string|\DateTimeInterface|null $from
2913
* @param int|float|string|\DateTimeInterface|null $to
3014
*/
3115
public function __construct(
32-
string $key,
33-
$from,
34-
$to,
35-
bool $fromEqual = TRUE,
36-
bool $toEqual = TRUE,
16+
private string $key,
17+
private $from,
18+
private $to,
19+
private bool $fromEqual = TRUE,
20+
private bool $toEqual = TRUE,
3721
)
3822
{
39-
$this->key = $key;
40-
$this->from = $from;
41-
$this->to = $to;
42-
$this->fromEqual = $fromEqual;
43-
$this->toEqual = $toEqual;
4423
}
4524

4625

0 commit comments

Comments
 (0)