Skip to content

Commit

Permalink
Travis improvements (#90)
Browse files Browse the repository at this point in the history
* Travis improvements

- Test php 7.4 (nightly)
- Use bionic

* PHP 7.4 fixes

* Fix coverage file
  • Loading branch information
rasmusbe authored and edamov committed Nov 19, 2019
1 parent f24889f commit dffde74
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
language: php
dist: xenial
dist: bionic
os: linux

php:
- 7.2
- 7.3

jobs:
include:
- php: 7.4snapshot
before_install:
- pecl install xdebug
- php: nightly
allow_failures:
- php: 7.4snapshot
- php: nightly

# Make sure all dev dependencies are installed, ignore platform requirements because Travis is missing the xdebug on some images
before_script:
- composer install --no-interaction --prefer-dist
- composer install --no-interaction --prefer-dist --ignore-platform-reqs

script:
- mkdir -p build/logs
Expand Down
6 changes: 3 additions & 3 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static function fetchApnsId(string $headers): string
*/
private static function fetchErrorReason(string $body): string
{
return json_decode($body, true)['reason'] ?: '';
return json_decode($body, true)['reason'] ?? '';
}

/**
Expand All @@ -202,7 +202,7 @@ private static function fetchErrorReason(string $body): string
private static function fetch410Timestamp(int $statusCode, string $body): string
{
if ($statusCode === 410) {
return (string)(json_decode($body, true)['timestamp'] ?: '');
return (string)(json_decode($body, true)['timestamp'] ?? '');
}
return '';
}
Expand Down Expand Up @@ -244,7 +244,7 @@ public function getStatusCode(): int
*/
public function getReasonPhrase(): string
{
return self::$reasonPhrases[$this->statusCode] ?: '';
return self::$reasonPhrases[$this->statusCode] ?? '';
}

/**
Expand Down

0 comments on commit dffde74

Please sign in to comment.