Skip to content

Commit 7e97bfe

Browse files
committed
Remove static closure declarations
1 parent 5467fbb commit 7e97bfe

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Search/Aggregation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function buckets(): array
2525
{
2626
$buckets = $this->aggregation['buckets'] ?? [];
2727

28-
return array_map(static fn (array $bucket) => new Bucket($bucket), $buckets);
28+
return array_map(fn (array $bucket) => new Bucket($bucket), $buckets);
2929
}
3030

3131
/**

src/Search/SearchResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function hits(): array
2525
{
2626
$hits = $this->response['hits']['hits'];
2727

28-
return array_map(static fn (array $hit) => new Hit($hit), $hits);
28+
return array_map(fn (array $hit) => new Hit($hit), $hits);
2929
}
3030

3131
/**
@@ -82,8 +82,8 @@ public function suggestions(): array
8282
$suggest = $this->response['suggest'] ?? [];
8383

8484
return array_map(
85-
static fn (array $suggestions) => array_map(
86-
static fn (array $suggestion) => new Suggestion($suggestion),
85+
fn (array $suggestions) => array_map(
86+
fn (array $suggestion) => new Suggestion($suggestion),
8787
$suggestions,
8888
),
8989
$suggest,
@@ -99,7 +99,7 @@ public function aggregations(): array
9999
{
100100
$aggregations = $this->response['aggregations'] ?? [];
101101

102-
return array_map(static fn (array $aggregation) => new Aggregation($aggregation), $aggregations);
102+
return array_map(fn (array $aggregation) => new Aggregation($aggregation), $aggregations);
103103
}
104104

105105
/**

src/Search/Suggestion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function length(): int
4848
public function options(): array
4949
{
5050
return array_map(
51-
static fn (array $option) => new SuggestionOption($option),
51+
fn (array $option) => new SuggestionOption($option),
5252
$this->suggestion['options'],
5353
);
5454
}

tests/Unit/Indices/MappingPropertiesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
})->with('mapping property setters');
9999

100100
test('object properties may be configured with a closure', function () {
101-
$actual = (new MappingProperties)->object('user', static function (MappingProperties $properties) {
101+
$actual = (new MappingProperties)->object('user', function (MappingProperties $properties) {
102102
$properties->integer('age');
103103

104104
return [
@@ -121,7 +121,7 @@
121121
});
122122

123123
test('nested properties may be configured with a closure', function () {
124-
$actual = (new MappingProperties)->nested('user', static function (MappingProperties $properties) {
124+
$actual = (new MappingProperties)->nested('user', function (MappingProperties $properties) {
125125
$properties->keyword('age');
126126

127127
return [

0 commit comments

Comments
 (0)