Skip to content

Commit

Permalink
Merge pull request #369 from cakephp/update-travis
Browse files Browse the repository at this point in the history
Updated travis and fixed CS errors.
  • Loading branch information
markstory authored Apr 20, 2020
2 parents ef51314 + c699310 commit fd853b4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: clover.xml
json_path: coveralls-upload.json
27 changes: 0 additions & 27 deletions .scrutinizer.yml

This file was deleted.

24 changes: 20 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
language: php

dist: xenial

cache:
directories:
- $HOME/.composer/cache

php:
- 7.2
- 7.4
Expand Down Expand Up @@ -29,7 +35,12 @@ matrix:
env: PREFER_LOWEST=1

before_install:
- echo 'extension = ldap.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- phpenv config-rm xdebug.ini
- |
if [[ $COVERAGE == 1 ]]; then
pecl channel-update pecl.php.net
pecl install pcov
fi
install:
- if [[ $PREFER_LOWEST != 1 ]]; then composer install --prefer-dist --no-interaction; fi
Expand All @@ -41,14 +52,19 @@ before_script:
- if [[ $STATIC_ANALYSIS == 1 ]]; then composer stan-setup; fi

script:
- if [[ $COVERAGE == 1 ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml; fi
- if [[ $COVERAGE != 1 ]]; then vendor/bin/phpunit; fi
- if [[ $COVERAGE == 1 ]]; then vendor/bin/phpunit --verbose --coverage-clover=clover.xml; fi
- if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit --verbose; fi

- if [[ $PHPCS == 1 ]]; then composer cs-check; fi
- if [[ $STATIC_ANALYSIS == 1 ]]; then composer stan; fi

after_success:
- if [[ $COVERAGE == 1 ]]; then bash <(curl -s https://codecov.io/bash); fi
- |
if [[ $COVERAGE == 1 ]]; then
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
chmod +x php-coveralls.phar
./php-coveralls.phar
fi
notifications:
email: false
3 changes: 3 additions & 0 deletions src/AuthenticationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ public function getUnauthenticatedRedirectUrl(ServerRequestInterface $request):
}
$query = urlencode($param) . '=' . urlencode($redirect);

/** @var array $url */
$url = parse_url($target);
if (isset($url['query']) && strlen($url['query'])) {
$url['query'] .= '&' . $query;
Expand Down Expand Up @@ -413,9 +414,11 @@ public function getLoginRedirect(ServerRequestInterface $request): ?string
return null;
}
$parsed += ['path' => '/', 'query' => ''];
/** @psalm-suppress PossiblyUndefinedArrayOffset */
if (strlen($parsed['path']) && $parsed['path'][0] !== '/') {
$parsed['path'] = "/{$parsed['path']}";
}
/** @psalm-suppress PossiblyUndefinedArrayOffset */
if ($parsed['query']) {
$parsed['query'] = "?{$parsed['query']}";
}
Expand Down

0 comments on commit fd853b4

Please sign in to comment.