Skip to content

Commit

Permalink
Drop support for PHP 5 (#30)
Browse files Browse the repository at this point in the history
PHP5 reached of life early this year and this enables us to comply with PHP7 requirements
  • Loading branch information
joladev committed Jul 25, 2019
1 parent 9744958 commit f9f7bdb
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: php
php:
- 5.6
- 7.2
before_script:
- curl -s http://getcomposer.org/installer | php
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
]
},
"require": {
"php": ">=5.6.0"
"php": ">=7.2.0"
},
"require-dev": {
"phpunit/phpunit": "*",
Expand Down
2 changes: 1 addition & 1 deletion test/AuthenticateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class CastleAuthenticateTest extends Castle_TestCase
{
public function tearDown()
public function tearDown(): void
{
Castle_RequestTransport::reset();
Castle_RequestTransport::setResponse(200, '');
Expand Down
2 changes: 1 addition & 1 deletion test/Castle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

abstract class Castle_TestCase extends \PHPUnit\Framework\TestCase
{
public function setUp()
public function setUp(): void
{
Castle::setApiKey('secret');
}
Expand Down
4 changes: 2 additions & 2 deletions test/CastleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion test/ErrorsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions test/RequestContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
6 changes: 3 additions & 3 deletions test/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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();
}
Expand Down

0 comments on commit f9f7bdb

Please sign in to comment.