Skip to content

Commit

Permalink
Update for PHP 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kokororin committed Dec 24, 2021
1 parent 03d9f55 commit aca662e
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ composer.lock

## coverage
coverage/

## PHPUnit
.phpunit.*.cache
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: php
matrix:
include:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: 8.0
- php: 8.1

services:
- mysql
Expand All @@ -18,7 +18,8 @@ cache:

before_install:
- composer self-update
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- phpenv config-rm xdebug.ini
- before_script: echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

before_script:
- composer install
Expand All @@ -27,4 +28,4 @@ script:
- composer test

after_script:
- if [[ "$TRAVIS_PHP_VERSION" == '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage/coverage.clover ; fi
- if [[ "$TRAVIS_PHP_VERSION" == '8.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage/coverage.clover ; fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://api.travis-ci.org/kokororin/Kotori.php.svg)](https://travis-ci.org/kokororin/Kotori.php)
[![Version](https://badge.fury.io/ph/kokororin%2Fkotori-php.svg)](https://packagist.org/packages/kokororin/kotori-php)
[![Packagist](https://img.shields.io/packagist/dt/kokororin/kotori-php.svg?maxAge=2592000)](https://packagist.org/packages/kokororin/kotori-php)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.5-8892BF.svg)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.3-8892BF.svg)](https://php.net/)
[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/kokororin/Kotori.php/blob/master/LICENSE)
[![Code Coverage](https://scrutinizer-ci.com/g/kokororin/Kotori.php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/kokororin/Kotori.php/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kokororin/Kotori.php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kokororin/Kotori.php/?branch=master)
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"email": "ritsuka.sunny@gmail.com"
}],
"require": {
"php": ">=5.5.0",
"php": ">=7.3.0",
"catfan/medoo": "~1.5",
"psr/container": "^1.0",
"psr/log": "^1.0",
Expand All @@ -27,7 +27,7 @@
},
"require-dev": {
"guzzlehttp/guzzle": "~6.0",
"phpunit/phpunit": "^5.0",
"phpunit/phpunit": "^9.5",
"scrutinizer/ocular": "^1.4",
"squizlabs/php_codesniffer": "^3.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class App
*/
public function __construct($config = [])
{
if (version_compare(PHP_VERSION, '5.5.0', '<')) {
exit('Kotori.php requires PHP >= 5.5.0 !');
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
exit('Kotori.php requires PHP >= 7.3.0 !');
}

ini_set('display_errors', 'off');
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function server($key = null, $default = null)
* @param mixed $options
* @return mixed
*/
public function cookie($key = '', $value = '', $options = null)
public function cookie($key = '', $value = '', $options = [])
{
$defaultOptions = [
'prefix' => '',
Expand Down
2 changes: 1 addition & 1 deletion tests/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Kotori\Tests;

use Kotori\App;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class AppTest extends TestCase
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Core/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

use Kotori\Facade\Cache;
use Kotori\Facade\Config;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class CacheTest extends TestCase
{

protected static $cache = null;

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
Config::initialize([
'app_debug' => false,
'cache' => [
'adapter' => 'memcached',
'adapter' => 'redis',
'prefix' => '',
'host' => '127.0.0.1',
'port' => 11211,
'port' => 6379,
'weight' => 1,
],
]);
Expand Down
2 changes: 1 addition & 1 deletion tests/Core/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Kotori\Tests\Core;

use Kotori\Core\Config;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class ConfigTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Core/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Kotori\Tests\Core;

use Kotori\Core\Container;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class ContainerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Core/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Kotori\Tests\Core;

use Kotori\Core\Controller;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class ControllerTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Core/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

use Kotori\Core\Database;
use Kotori\Facade\Config;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class DatabaseTest extends TestCase
{
protected static $db = null;

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
Config::initialize([
'app_debug' => false,
Expand Down
2 changes: 1 addition & 1 deletion tests/Core/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Kotori\Tests\Core;

use Kotori\Core\Helper;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class HelperTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Debug/HookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Kotori\Tests\Hook;

use Kotori\Debug\Hook;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class HookTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
use Kotori\Facade\Config;
use Kotori\Facade\Request;
use Kotori\Tests\Util;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class RequestTest extends TestCase
{

protected static $END_POINT = null;

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$END_POINT = 'http://' . getenv('WEB_SERVER_HOST') . ':' . getenv('WEB_SERVER_PORT') . '/test';
Config::initialize([
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
namespace Kotori\Tests\Http;

use Exception;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class RouteTest extends TestCase
{
protected static $END_POINT = null;

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$END_POINT = 'http://' . getenv('WEB_SERVER_HOST') . ':' . getenv('WEB_SERVER_PORT') . '/';
}
Expand Down

0 comments on commit aca662e

Please sign in to comment.