Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

chore(php) Move to PHP 7.1 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .State

This file was deleted.

5 changes: 2 additions & 3 deletions Exception.php → Source/Exception.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -42,9 +44,6 @@
* Class \Hoa\Zombie\Exception.
*
* Extending the \Hoa\Exception\Exception class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Exception extends HoaException
{
Expand Down
31 changes: 6 additions & 25 deletions Zombie.php → Source/Zombie.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -42,28 +44,21 @@
* Class \Hoa\Zombie.
*
* Zombie!
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Zombie
{
/**
* Test if we can start a zombie.
*
* @return bool
*/
public static function test()
public static function test(): bool
{
return true === function_exists('fastcgi_finish_request');
}

/**
* Try to create a zombie.
*
* @return bool
*/
public static function fork()
public static function fork(): bool
{
if (true !== static::test()) {
throw new Exception(
Expand All @@ -77,8 +72,6 @@ public static function fork()

/**
* Oh, why not decapitate?
*
* @return void
*/
public static function decapitate()
{
Expand All @@ -89,8 +82,6 @@ public static function decapitate()

/**
* Maybe, we can bludgeon the zombie?
*
* @return void
*/
public static function bludgeon()
{
Expand All @@ -101,8 +92,6 @@ public static function bludgeon()

/**
* Grilled zombies, hummm!
*
* @return void
*/
public static function burn()
{
Expand All @@ -113,8 +102,6 @@ public static function burn()

/**
* One… two… three… … splash!
*
* @return void
*/
public static function explode()
{
Expand All @@ -125,8 +112,6 @@ public static function explode()

/**
* Would like a slice?
*
* @return void
*/
public static function cutOff()
{
Expand All @@ -137,8 +122,6 @@ public static function cutOff()

/**
* Whatever, really kill the zombie.
*
* @return void
*/
protected static function _kill()
{
Expand All @@ -147,10 +130,8 @@ protected static function _kill()

/**
* Get PHP's process ID.
*
* @return int
*/
public static function getPid()
public static function getPid(): int
{
return getmypid();
}
Expand All @@ -159,4 +140,4 @@ public static function getPid()
/**
* Flex entity.
*/
Consistency::flexEntity('Hoa\Zombie\Zombie');
Consistency::flexEntity(Zombie::class);
5 changes: 2 additions & 3 deletions Test/Unit/Zombie.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -43,9 +45,6 @@
* Class \Hoa\Zombie\Test\Unit\Documentation.
*
* Test suite of the zombie class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Zombie extends Test\Unit\Suite
{
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@
"source": "https://central.hoa-project.net/Resource/Library/Zombie"
},
"require": {
"php" : ">=5.5.0",
"hoa/consistency": "~1.0",
"hoa/exception" : "~1.0"
"php" : ">=7.1",
"hoa/consistency": "dev-master",
"hoa/exception" : "dev-master"
},
"require-dev": {
"hoa/test": "~2.0"
"hoa/test": "dev-master"
},
"autoload": {
"psr-4": {
"Hoa\\Zombie\\": "."
"Hoa\\Zombie\\" : "Source",
"Hoa\\Zombie\\Test\\": "Test"
}
},
"extra": {
Expand Down