aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2017-08-30 15:55:00 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2017-08-30 15:55:00 +0200
commitbb592143e10031416cad669b5ba6271355ca8fd1 (patch)
tree993f1b0675e943a16888bbb3c4a3561de0b3d0fd
parenta4d48d498b2c2d88ab8d8fed6f4085d4fa121855 (diff)
downloadCli-bb592143e10031416cad669b5ba6271355ca8fd1.zip
Cli-bb592143e10031416cad669b5ba6271355ca8fd1.tar.gz
Cli-bb592143e10031416cad669b5ba6271355ca8fd1.tar.bz2
chore(php) Move to PHP 7.
-rw-r--r--Bin/Hoa.php5
-rw-r--r--Bin/Welcome.php25
2 files changed, 9 insertions, 21 deletions
diff --git a/Bin/Hoa.php b/Bin/Hoa.php
index 0f1a633..0447baf 100644
--- a/Bin/Hoa.php
+++ b/Bin/Hoa.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -39,9 +41,6 @@ use Hoa\Dispatcher;
use Hoa\Exception;
use Hoa\Router;
-/**
- * @copyright Copyright © 2007-2017 Hoa community
- */
if (!defined('HOA')) {
$composer = [
dirname(__DIR__) . DIRECTORY_SEPARATOR .
diff --git a/Bin/Welcome.php b/Bin/Welcome.php
index a81b047..80dfa64 100644
--- a/Bin/Welcome.php
+++ b/Bin/Welcome.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -39,19 +41,12 @@ namespace Hoa\Cli\Bin;
use Hoa\Console;
/**
- * Class \Hoa\Cli\Bin\Welcome.
- *
* Welcome screen.
- *
- * @copyright Copyright © 2007-2017 Hoa community
- * @license New BSD License
*/
class Welcome extends Console\Dispatcher\Kit
{
/**
* Options description.
- *
- * @var array
*/
protected $options = [
['library', Console\GetOption::REQUIRED_ARGUMENT, 'l'],
@@ -64,10 +59,8 @@ class Welcome extends Console\Dispatcher\Kit
/**
* The entry method.
- *
- * @return int
*/
- public function main()
+ public function main(): ?int
{
$library = null;
$verbose = Console::isDirect(STDOUT);
@@ -127,7 +120,7 @@ class Welcome extends Console\Dispatcher\Kit
if (WITH_COMPOSER) {
$iterator->append(new \GlobIterator(
- dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'Bin' . DIRECTORY_SEPARATOR . '*.php'
+ dirname(__DIR__, 4) . DIRECTORY_SEPARATOR . 'Bin' . DIRECTORY_SEPARATOR . '*.php'
));
}
@@ -135,7 +128,7 @@ class Welcome extends Console\Dispatcher\Kit
foreach ($iterator as $entry) {
$pathname = $entry->getPathname();
- $lib = mb_strtolower(basename(dirname(dirname($pathname))));
+ $lib = mb_strtolower(basename(dirname($pathname, 2)));
$bin = mb_strtolower(
mb_substr($entry->getBasename(), 0, -4)
);
@@ -210,15 +203,13 @@ class Welcome extends Console\Dispatcher\Kit
echo $out;
}
- return;
+ return 0;
}
/**
* The command usage.
- *
- * @return int
*/
- public function usage()
+ public function usage(): void
{
echo
'Usage : cli:welcome <options>', "\n",
@@ -229,8 +220,6 @@ class Welcome extends Console\Dispatcher\Kit
'print essential informations.',
'help' => 'This help.'
]);
-
- return;
}
}