diff --git a/CHANGELOG.md b/CHANGELOG.md index 423b7f2..879c838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - update composer.json - using php 7.3 in travis and scrutinizer +- used php 7 null coalescing operator ## 0.1.0 diff --git a/src/UrlRewriter.php b/src/UrlRewriter.php index c0a953c..963c2db 100644 --- a/src/UrlRewriter.php +++ b/src/UrlRewriter.php @@ -49,9 +49,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface $parsedNewUrl = parse_url($invariantUriPart.$replacedUriPart ); $request = $request->withUri( - $uri->withPath($parsedNewUrl['path']?:'') - ->withQuery($parsedNewUrl['query']?:'') - ->withFragment($parsedNewUrl['fragment']?:'') + $uri->withPath($parsedNewUrl['path'] ?? '') + ->withQuery($parsedNewUrl['query'] ?? '') + ->withFragment($parsedNewUrl['fragment'] ?? '') ); return $handler->handle($request);