Skip to content

Commit ed5d479

Browse files
committed
Revert "Tweaks after backport to CSL"
This reverts commit 1e80d47.
1 parent f4113f5 commit ed5d479

File tree

6 files changed

+19
-20
lines changed

6 files changed

+19
-20
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
### 3.0.4
4+
Reverted: Breaking changes which can be done more neatly with current request middleware
5+
36
### 3.0.3
47
Added: Current Request middleware. Provides a singleton that can be used to get the current request, similar to rhubarb's `Request::current()`
58

src/Adapters/BaseEntityAdapter.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,23 @@ abstract protected function updateEntityWithPayload($entity, $payload);
2121
abstract protected function storeEntity($entity);
2222

2323
abstract protected function getEntityList(
24+
Request $request,
2425
int $offset,
2526
int $pageSize,
26-
?string $sort = null,
27-
Request $request = null,
28-
$arguments = []
27+
?string $sort = null
2928
): SearchResponseEntity;
3029

31-
final public function list(Request $request, Response $response, $arguments = []): Response
30+
final public function list(Request $request, Response $response): Response
3231
{
3332
$offset = (int)$request->getQueryParam('offset', $request->getQueryParam('from', 1) - 1);
3433
$pageSize = (int)$request->getQueryParam('pageSize', $request->getQueryParam('to', 10 - $offset));
3534
$sort = $request->getQueryParam('sort');
3635

3736
$list = $this->getEntityList(
37+
$request,
3838
$offset,
3939
$pageSize,
40-
$sort,
41-
$request,
42-
$arguments
40+
$sort
4341
);
4442
return $response
4543
->withJson(array_map(

src/Adapters/DIEntityAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function __construct()
1616
$this->entityAdapter = Container::instance(static::class);
1717
}
1818

19-
final public function list(Request $request, Response $response, $arguments = []): Response
19+
final public function list(Request $request, Response $response): Response
2020
{
2121
return $this->entityAdapter->list(...func_get_args());
2222
}

src/Adapters/EntityAdapter.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@ protected function getSearchResponseEntity(SearchCriteriaEntity $criteria): Sear
1616
}
1717

1818
protected function getSearchCriteriaEntity(
19+
Request $request,
1920
int $offset,
2021
int $pageSize,
21-
?string $sort = null,
22-
Request $request = null,
23-
$arguments = []
22+
string $sort = null
2423
): SearchCriteriaEntity {
2524
return new SearchCriteriaEntity($offset, $pageSize, $sort);
2625
}
2726

2827
final protected function getEntityList(
28+
Request $request,
2929
int $offset,
3030
int $pageSize,
31-
?string $sort = null,
32-
Request $request = null,
33-
$arguments = []
31+
?string $sort = null
3432
): SearchResponseEntity {
35-
$response = new SearchResponseEntity($this->getSearchCriteriaEntity($offset, $pageSize, $sort, $request, $arguments));
33+
$response = new SearchResponseEntity($this->getSearchCriteriaEntity($request, $offset, $pageSize, $sort));
3634
$this->performSearch($response);
3735
return $response;
3836
}

src/Adapters/EntityAdapterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
interface EntityAdapterInterface
99
{
10-
public function list(Request $request, Response $response, $arguments = []): Response;
10+
public function list(Request $request, Response $response): Response;
1111

1212
public function get(Request $request, Response $response, $id): Response;
1313

src/Adapters/Stem/LegacyStemEntityAdapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ protected function getListFilterForRequest(Request $request): array
8484
}
8585

8686
/**
87+
* @param Request $request
8788
* @param int $offset
8889
* @param int $pageSize
89-
* @param Request $request
90+
* @param string|null $sort
9091
* @return Collection
9192
*/
9293
final protected function getEntityList(
94+
Request $request,
9395
int $offset,
9496
int $pageSize,
95-
?string $sort = null,
96-
Request $request = null,
97-
$arguments = []
97+
?string $sort = null
9898
): SearchResponseEntity {
9999
$criteria = new SearchCriteriaEntity($offset, $pageSize, $sort);
100100
$response = new SearchResponseEntity($criteria);

0 commit comments

Comments
 (0)