From ac0aac69cf37c6746d09ffa0671844dd3ad21105 Mon Sep 17 00:00:00 2001 From: Josh Anderson Date: Fri, 17 Dec 2021 20:18:49 +0000 Subject: [PATCH 1/2] Return type hints for JsonSerializable --- lib/model/Tweet.php | 4 ++-- lib/model/User.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/model/Tweet.php b/lib/model/Tweet.php index 7f48c19..42ab626 100644 --- a/lib/model/Tweet.php +++ b/lib/model/Tweet.php @@ -35,7 +35,7 @@ public function __construct(array $array) { $this->user = new User($array); } - function jsonSerialize() { + function jsonSerialize(): array { return [ 'id' => $this->id, 'createdAt' => $this->createdAt, @@ -165,4 +165,4 @@ public function getUser() { public function setUser(User $user) { $this->user = $user; } -} \ No newline at end of file +} diff --git a/lib/model/User.php b/lib/model/User.php index 3165654..d5c81bc 100644 --- a/lib/model/User.php +++ b/lib/model/User.php @@ -15,7 +15,7 @@ public function __construct(array $array) { $this->screenName = $array['screen_name']; } - public function jsonSerialize() { + public function jsonSerialize(): array { return [ 'id' => $this->id, 'name' => $this->name, @@ -56,4 +56,4 @@ public function setScreenName($screenName) { $this->screenName = $screenName; } -} \ No newline at end of file +} From 5f92ee4c38143a54c4977eb6ffaf4b33647164f1 Mon Sep 17 00:00:00 2001 From: Josh Anderson Date: Fri, 17 Dec 2021 20:20:36 +0000 Subject: [PATCH 2/2] Test with php8 --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84acabe..578e324 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ before_install: - git submodule update --init --recursive language: php php: - - 7.1 - - 7.2 - - 7.3 + - 7.x + - 8.x script: phpunit tests/AllTests.php