Skip to content

Commit d4de7fc

Browse files
authored
Merge pull request #556 from skipperbent/v4-development
Version 4.3.4.2
2 parents b7c31ae + 03ef9df commit d4de7fc

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

src/Pecee/Http/Input/InputItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function offsetSet($offset, $value): void
9797

9898
public function offsetUnset($offset): void
9999
{
100-
unset($this->data[$offset]);
100+
unset($this->value[$offset]);
101101
}
102102

103103
public function __toString(): string

src/Pecee/Http/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ public function getUserAgent(): ?string
264264
* Get header value by name
265265
*
266266
* @param string $name Name of the header.
267-
* @param string|null $defaultValue Value to be returned if header is not found.
267+
* @param string|mixed|null $defaultValue Value to be returned if header is not found.
268268
* @param bool $tryParse When enabled the method will try to find the header from both from client (http) and server-side variants, if the header is not found.
269269
*
270270
* @return string|null
271271
*/
272-
public function getHeader(string $name, $defaultValue = null, $tryParse = true): ?string
272+
public function getHeader(string $name, $defaultValue = null, bool $tryParse = true): ?string
273273
{
274274
$name = strtolower($name);
275275
$header = $this->headers[$name] ?? null;

src/Pecee/Http/Url.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ public static function arrayToParams(array $getParams = [], bool $includeEmpty =
431431
* @param bool $includeParams
432432
* @return string
433433
*/
434-
public function getRelativeUrl($includeParams = true): string
434+
public function getRelativeUrl(bool $includeParams = true): string
435435
{
436436
$path = $this->path ?? '/';
437437

@@ -451,7 +451,7 @@ public function getRelativeUrl($includeParams = true): string
451451
* @param bool $includeParams
452452
* @return string
453453
*/
454-
public function getAbsoluteUrl($includeParams = true): string
454+
public function getAbsoluteUrl(bool $includeParams = true): string
455455
{
456456
$scheme = $this->scheme !== null ? $this->scheme . '://' : '';
457457
$host = $this->host ?? '';

src/Pecee/SimpleRouter/Router.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,4 +944,10 @@ public function setRenderMultipleRoutes(bool $bool): self
944944
return $this;
945945
}
946946

947+
public function addExceptionHandler(IExceptionHandler $handler): self
948+
{
949+
$this->exceptionHandlers[] = $handler;
950+
return $this;
951+
}
952+
947953
}

src/Pecee/SimpleRouter/SimpleRouter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,7 @@ public static function error(Closure $callback): CallbackExceptionHandler
427427
{
428428
$callbackHandler = new CallbackExceptionHandler($callback);
429429

430-
static::router()->addRoute(
431-
(new RouteGroup())->addExceptionHandler($callbackHandler)
432-
);
430+
static::router()->addExceptionHandler($callbackHandler);
433431

434432
return $callbackHandler;
435433
}

0 commit comments

Comments
 (0)