From e672a8744a9331b80f0a98a96d8f284fb3c87c4d Mon Sep 17 00:00:00 2001 From: Configuration Manager Date: Mon, 23 Sep 2019 10:09:40 +0200 Subject: [PATCH] Used coleshing opeartor --- CHANGELOG.md | 1 + src/UrlRewriter.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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);