From dffde747d8fcc0da9a945e7b54c383af91c6db6f Mon Sep 17 00:00:00 2001 From: Rasmus <2124386+rasmusbe@users.noreply.github.com> Date: Tue, 19 Nov 2019 17:36:20 +0100 Subject: [PATCH] Travis improvements (#90) * Travis improvements - Test php 7.4 (nightly) - Use bionic * PHP 7.4 fixes * Fix coverage file --- .editorconfig | 3 +++ .travis.yml | 16 ++++++++++++++-- src/Response.php | 6 +++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index cd8eb86..c451dda 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 diff --git a/.travis.yml b/.travis.yml index bcf280f..8027628 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/src/Response.php b/src/Response.php index 08a3f63..1760643 100644 --- a/src/Response.php +++ b/src/Response.php @@ -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'] ?? ''; } /** @@ -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 ''; } @@ -244,7 +244,7 @@ public function getStatusCode(): int */ public function getReasonPhrase(): string { - return self::$reasonPhrases[$this->statusCode] ?: ''; + return self::$reasonPhrases[$this->statusCode] ?? ''; } /**