Development

- Fixed issue causing default-namespace to add duplicate namespace when using type-hints (issue: #561).
- Fixed phpstan issues.
- Tests: Fixed TestRouter not resetting namespace upon reset.
- Tests: Added NSController (namespace controller) class.
- Tests: added test for class hint + default namespace case.
- Composer: added phpstan support + configuration.
- Composer: updated phpunit version.
This commit is contained in:
Simon Sessingø
2021-06-09 08:54:24 +02:00
parent 4dff4006bf
commit 5cd6cab801
16 changed files with 107 additions and 57 deletions
+4 -4
View File
@@ -387,7 +387,7 @@ class Url implements JsonSerializable
{
$encodedUrl = preg_replace_callback(
'/[^:\/@?&=#]+/u',
static function ($matches) {
static function ($matches): string {
return urlencode($matches[0]);
},
$url
@@ -414,7 +414,7 @@ class Url implements JsonSerializable
if (count($getParams) !== 0) {
if ($includeEmpty === false) {
$getParams = array_filter($getParams, static function ($item) {
$getParams = array_filter($getParams, static function ($item): bool {
return (trim($item) !== '');
});
}
@@ -458,7 +458,7 @@ class Url implements JsonSerializable
$port = $this->port !== null ? ':' . $this->port : '';
$user = $this->username ?? '';
$pass = $this->password !== null ? ':' . $this->password : '';
$pass = ($user || $pass) ? $pass . '@' : '';
$pass = ($user !== '' || $pass !== '') ? $pass . '@' : '';
return $scheme . $user . $pass . $host . $port . $this->getRelativeUrl($includeParams);
}
@@ -466,7 +466,7 @@ class Url implements JsonSerializable
/**
* Specify data which should be serialized to JSON
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* @return string data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
*/