Skip to content

Commit d6a0e01

Browse files
committed
Merge branch '5.0'
2 parents 88e8907 + 508446d commit d6a0e01

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Classes/Domain/Repository/RedirectRepository.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class RedirectRepository extends Repository
4949

5050
/**
5151
* @param string $sourceUriPath
52-
* @param string $host Full qualified host name
52+
* @param string|null $host Full qualified host name
5353
* @param boolean $fallback If not redirect found, match a redirect with host value as null
5454
* @return Redirect|null
5555
*/
@@ -79,7 +79,7 @@ public function findOneBySourceUriPathAndHost(string $sourceUriPath, ?string $ho
7979

8080
/**
8181
* @param string $targetUriPath
82-
* @param string $host Full qualified host name
82+
* @param string|null $host Full qualified host name
8383
* @return Redirect|null
8484
*/
8585
public function findOneByTargetUriPathAndHost(string $targetUriPath, ?string $host = null): ?Redirect
@@ -156,14 +156,14 @@ protected function buildQuery(bool $onlyActive = false, ?string $type = null): Q
156156
/**
157157
* Finds all redirects filtered by the parameters and returns an IterableResult
158158
*
159-
* @param string $host Fully qualified host name
159+
* @param string|null $host Fully qualified host name
160160
* @param bool $onlyActive Filters redirects which start and end datetime match the current datetime
161161
* @param string|null $type Filters redirects by their type
162-
* @param callable $callback
162+
* @param callable|null $callback
163163
* @return \Generator<Redirect>
164164
* @throws \Exception
165165
*/
166-
public function findAllWithParameters(?string $host = null, bool $onlyActive = false, ?string $type = null, callable $callback = null): \Generator
166+
public function findAllWithParameters(?string $host = null, bool $onlyActive = false, ?string $type = null, ?callable $callback = null): \Generator
167167
{
168168
$query = $this->buildQuery($onlyActive, $type);
169169

@@ -180,11 +180,11 @@ public function findAllWithParameters(?string $host = null, bool $onlyActive = f
180180
*
181181
* @param bool $onlyActive Filters redirects which start and end datetime match the current datetime
182182
* @param string|null $type Filters redirects by their type
183-
* @param callable $callback
183+
* @param callable|null $callback
184184
* @return \Generator<Redirect>
185185
* @throws \Exception
186186
*/
187-
public function findAllWithoutHost(bool $onlyActive = false, ?string $type = null, callable $callback = null): \Generator
187+
public function findAllWithoutHost(bool $onlyActive = false, ?string $type = null, ?callable $callback = null): \Generator
188188
{
189189
$query = $this->buildQuery($onlyActive, $type);
190190
$query->andWhere('r.host IS NULL');
@@ -254,10 +254,10 @@ public function incrementHitCount(RedirectInterface $redirect): void
254254
* Iterator over an IterableResult and return a Generator
255255
*
256256
* @param IterableResult $iterator
257-
* @param callable $callback
257+
* @param callable|null $callback
258258
* @return \Generator<RedirectDto>
259259
*/
260-
protected function iterate(IterableResult $iterator, callable $callback = null): \Generator
260+
protected function iterate(IterableResult $iterator, ?callable $callback = null): \Generator
261261
{
262262
$iteration = 0;
263263
foreach ($iterator as $object) {

Classes/RedirectStorage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ public function removeByHost(?string $host = null): void
144144
public function addRedirect(
145145
string $sourceUriPath,
146146
string $targetUriPath,
147-
int $statusCode = null,
147+
?int $statusCode = null,
148148
array $hosts = [],
149149
?string $creator = null,
150150
?string $comment = null,
151151
?string $type = null,
152-
DateTime $startDateTime = null,
153-
DateTime $endDateTime = null,
152+
?DateTime $startDateTime = null,
153+
?DateTime $endDateTime = null,
154154
): array {
155155
$statusCode = $statusCode ?: (int)$this->defaultStatusCode['redirect'];
156156
$redirects = [];
@@ -221,8 +221,8 @@ protected function addRedirectByHost(
221221
$creator = null,
222222
$comment = null,
223223
$type = null,
224-
DateTime $startDateTime = null,
225-
DateTime $endDateTime = null,
224+
?DateTime $startDateTime = null,
225+
?DateTime $endDateTime = null,
226226
): array {
227227
if ($startDateTime instanceof \DateTime) {
228228
$startDateTime->setTimezone(new \DateTimeZone(date_default_timezone_get()));

0 commit comments

Comments
 (0)