aboutsummaryrefslogtreecommitdiffstats
path: root/Bin/Tocode.php
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2017-08-30 16:13:33 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2017-08-30 16:13:33 +0200
commit417c86c5589d51223b95d19d709be6e623761fa2 (patch)
tree10897312dae24e62d061c763dc2d34f7bdf99664 /Bin/Tocode.php
parentb22ee139c2686174f8f1db6e74008fc693c0c92d (diff)
downloadUstring-417c86c5589d51223b95d19d709be6e623761fa2.zip
Ustring-417c86c5589d51223b95d19d709be6e623761fa2.tar.gz
Ustring-417c86c5589d51223b95d19d709be6e623761fa2.tar.bz2
chore(php) Move to PHP 7.
Diffstat (limited to 'Bin/Tocode.php')
-rw-r--r--Bin/Tocode.php21
1 files changed, 5 insertions, 16 deletions
diff --git a/Bin/Tocode.php b/Bin/Tocode.php
index 5cb8b05..88d5c5e 100644
--- a/Bin/Tocode.php
+++ b/Bin/Tocode.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -40,19 +42,12 @@ use Hoa\Console;
use Hoa\Ustring;
/**
- * Class Hoa\Ustring\Bin\Tocode.
- *
* Transform a character into its code. Please, see Hoa\Ustring\Ustring::toCode.
- *
- * @copyright Copyright © 2007-2017 Hoa community
- * @license New BSD License
*/
class Tocode extends Console\Dispatcher\Kit
{
/**
* Options description.
- *
- * @var array
*/
protected $options = [
['base', Console\GetOption::REQUIRED_ARGUMENT, 'b'],
@@ -64,10 +59,8 @@ class Tocode extends Console\Dispatcher\Kit
/**
* The entry method.
- *
- * @return int
*/
- public function main()
+ public function main(): ?int
{
$base = 16;
@@ -96,15 +89,13 @@ class Tocode extends Console\Dispatcher\Kit
echo $code, "\n";
- return;
+ return 0;
}
/**
* The command usage.
- *
- * @return int
*/
- public function usage()
+ public function usage(): void
{
echo
'Usage : ustring:tocode <char>', "\n",
@@ -113,8 +104,6 @@ class Tocode extends Console\Dispatcher\Kit
'b' => 'Get the code in a specific base (16 by default).',
'help' => 'This help.'
]), "\n";
-
- return;
}
}