Skip to content

Commit ac4de98

Browse files
Update travis config, test php 8 versions, fix php 8/8.1 errors (#13)
* Update travis config, test php 8 versions * Update the way php is defined, put in place structure to allow testing laravel 9 * Forgot to remove matrix * Fix up travis config, esp envs global vs jobs * Just add a comment for future reference * Fix sorting for php 8 * Use bionic for php 8.1 * After looking at the test, we want the highest limit * Try 8.1.0 based on suggestions on travisci forums * Try and cast nulls to string for php 8.1 compact * Drop 8.1 for now (too many fixes)
1 parent 0aed272 commit ac4de98

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

.travis.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1+
# Test any changes here to see the impact - https://config.travis-ci.com/explore
2+
dist: bionic
13
language: php
24

3-
sudo: false
4-
dist: trusty
5+
php:
6+
- 7.4
7+
- 8.0
58

69
env:
710
global:
811
- setup=basic
9-
- xdebug=true
12+
- xdebug=false
13+
jobs:
14+
- LARAVEL_VERSION=8.*
1015

1116
cache:
1217
directories:
1318
- $HOME/.composer/cache
1419

15-
matrix:
16-
include:
17-
- php: 7.4
18-
env: xdebug=false
19-
# - php: 8.0
20-
# env: xdebug=false
21-
# - php: 8.1
22-
# env: xdebug=false
23-
2420
before_install:
2521
- if [[ $xdebug = 'true' ]] ; then phpenv config-rm xdebug.ini; fi
22+
- composer self-update --2
2623

2724
install:
2825
- if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction --no-suggest; fi
2926
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable; fi
3027
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable --prefer-lowest; fi
3128

29+
before_script:
30+
- travis_retry composer install --prefer-source --no-interaction
31+
- if [ "$LARAVEL_VERSION" != "" ]; then composer require --dev "illuminate/routing:${LARAVEL_VERSION}" --no-update; fi;
32+
- if [ "$LARAVEL_VERSION" != "" ]; then composer require --dev "illuminate/support:${LARAVEL_VERSION}" --no-update; fi;
33+
- composer update
34+
3235
script:
3336
- vendor/bin/phpunit

src/Auth/Provider/Authorization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class Authorization implements \Dingo\Api\Contract\Auth\Provider
2525
*/
2626
public function validateAuthorizationHeader(Request $request)
2727
{
28-
if (Str::startsWith(strtolower($request->headers->get('authorization')), $this->getAuthorizationMethod())) {
28+
if (Str::startsWith(strtolower((string) $request->headers->get('authorization')), $this->getAuthorizationMethod())) {
2929
return true;
3030
}
3131

src/Http/RateLimit/Handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ public function rateLimitRequest(Request $request, $limit = 0, $expires = 0)
105105
// limiting will not be imposed for the request.
106106
} else {
107107
$this->throttle = $this->getMatchingThrottles()->sort(function ($a, $b) {
108-
return $a->getLimit() < $b->getLimit();
109-
})->first();
108+
return $a->getLimit() <=> $b->getLimit();
109+
})->last();
110110
}
111111

112112
if (is_null($this->throttle)) {

src/Routing/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ protected function formatNamespace(array $new, array $old)
470470
protected function formatPrefix($new, $old)
471471
{
472472
if (isset($new['prefix'])) {
473-
return trim(Arr::get($old, 'prefix'), '/').'/'.trim($new['prefix'], '/');
473+
return trim((string) Arr::get($old, 'prefix'), '/').'/'.trim((string) $new['prefix'], '/');
474474
}
475475

476476
return Arr::get($old, 'prefix', '');

0 commit comments

Comments
 (0)