diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 00000000..ab4d68ba --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,29 @@ +name: Static analysis + +on: + pull_request: + +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + extensions: mbstring + + - name: Download dependencies + run: composer update --no-interaction --no-progress + + - name: Download PHP CS Fixer + run: composer require "friendsofphp/php-cs-fixer:2.18.4" + + - name: Execute PHP CS Fixer + run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run diff --git a/src/Uri.php b/src/Uri.php index ab201c1d..0f9f020d 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -109,7 +109,7 @@ static function ($matches) { $url ); - $result = parse_url($prefix.$encodedUrl); + $result = parse_url($prefix . $encodedUrl); if ($result === false) { return false; diff --git a/src/Utils.php b/src/Utils.php index 7c7cc3eb..f4e48640 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -217,7 +217,7 @@ public static function modifyRequest(RequestInterface $request, array $changes) ->withQueryParams($request->getQueryParams()) ->withCookieParams($request->getCookieParams()) ->withUploadedFiles($request->getUploadedFiles()); - + foreach ($request->getAttributes() as $key => $value) { $new = $new->withAttribute($key, $value); }