From f9f7bdbd8f18b023114f63a91be94b4633f6e7a0 Mon Sep 17 00:00:00 2001 From: Johanna Larsson Date: Thu, 25 Jul 2019 11:58:37 +0200 Subject: [PATCH] Drop support for PHP 5 (#30) PHP5 reached of life early this year and this enables us to comply with PHP7 requirements --- .travis.yml | 1 - composer.json | 2 +- test/AuthenticateTest.php | 2 +- test/Castle.php | 2 +- test/CastleTest.php | 4 ++-- test/ErrorsTest.php | 2 +- test/ModelTest.php | 4 ++-- test/RequestContextTest.php | 4 ++-- test/RequestTest.php | 6 +++--- 9 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b73910..cb60a3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: php php: -- 5.6 - 7.2 before_script: - curl -s http://getcomposer.org/installer | php diff --git a/composer.json b/composer.json index 524211c..0b1f73b 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ ] }, "require": { - "php": ">=5.6.0" + "php": ">=7.2.0" }, "require-dev": { "phpunit/phpunit": "*", diff --git a/test/AuthenticateTest.php b/test/AuthenticateTest.php index fb10915..4a379b8 100644 --- a/test/AuthenticateTest.php +++ b/test/AuthenticateTest.php @@ -2,7 +2,7 @@ class CastleAuthenticateTest extends Castle_TestCase { - public function tearDown() + public function tearDown(): void { Castle_RequestTransport::reset(); Castle_RequestTransport::setResponse(200, ''); diff --git a/test/Castle.php b/test/Castle.php index 062a6e7..82ecd58 100644 --- a/test/Castle.php +++ b/test/Castle.php @@ -2,7 +2,7 @@ abstract class Castle_TestCase extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { Castle::setApiKey('secret'); } diff --git a/test/CastleTest.php b/test/CastleTest.php index daa667a..0d28bd1 100644 --- a/test/CastleTest.php +++ b/test/CastleTest.php @@ -4,11 +4,11 @@ class CastleTest extends Castle_TestCase { protected $sessionToken; - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { Castle::setApiKey('secretkey'); } - public function setUp() + public function setUp(): void { $_SESSION = array(); $_COOKIE = array(); diff --git a/test/ErrorsTest.php b/test/ErrorsTest.php index c2e7bb7..8a50eae 100644 --- a/test/ErrorsTest.php +++ b/test/ErrorsTest.php @@ -3,7 +3,7 @@ class CastleErrorTest extends Castle_TestCase { - public function setUp() + public function setUp(): void { $_SERVER['HTTP_USER_AGENT'] = 'TestAgent'; $_SERVER['REMOTE_ADDR'] = '8.8.8.8'; diff --git a/test/ModelTest.php b/test/ModelTest.php index ca3339a..3375596 100644 --- a/test/ModelTest.php +++ b/test/ModelTest.php @@ -26,13 +26,13 @@ public function walk($response) class CastleModelTest extends Castle_TestCase { - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { $_SERVER['HTTP_USER_AGENT'] = 'TestAgent'; $_SERVER['REMOTE_ADDR'] = '8.8.8.8'; } - public function tearDown() + public function tearDown(): void { Castle_RequestTransport::reset(); } diff --git a/test/RequestContextTest.php b/test/RequestContextTest.php index 2f59dda..c6355f6 100644 --- a/test/RequestContextTest.php +++ b/test/RequestContextTest.php @@ -3,13 +3,13 @@ class CastleRequestContextTest extends \Castle_TestCase { - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { $_SERVER['HTTP_USER_AGENT'] = 'TestAgent'; $_SERVER['REMOTE_ADDR'] = '8.8.8.8'; unset($_SERVER['HTTP_X_FORWARDED_FOR']); } - public function setUp() { + public function setUp(): void { $_COOKIE = array(); } diff --git a/test/RequestTest.php b/test/RequestTest.php index 742482b..26b0c76 100644 --- a/test/RequestTest.php +++ b/test/RequestTest.php @@ -3,7 +3,7 @@ class CastleRequestTest extends \Castle_TestCase { - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { $_SERVER['HTTP_USER_AGENT'] = 'TestAgent'; $_SERVER['REMOTE_ADDR'] = '8.8.8.8'; @@ -12,13 +12,13 @@ public static function setUpBeforeClass() Castle::setUseWhitelist(false); } - public function setUp() + public function setUp(): void { $_COOKIE = array(); $_SESSION = array(); } - public function tearDown() + public function tearDown(): void { Castle_RequestTransport::setResponse(); }