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 #99

Open
wants to merge 5 commits 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
18 changes: 3 additions & 15 deletions Bin/Pp.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 @@ -45,9 +47,6 @@
* Class Hoa\Compiler\Bin\Pp.
*
* Play with PP.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Pp extends Console\Dispatcher\Kit
{
Expand All @@ -69,8 +68,6 @@ class Pp extends Console\Dispatcher\Kit

/**
* The entry method.
*
* @return int
*/
public function main()
{
Expand Down Expand Up @@ -163,9 +160,6 @@ public function main()

/**
* Print trace.
*
* @param \Hoa\Compiler\Llk\Parser $compiler Compiler.
* @return void
*/
protected function printTrace(Compiler\Llk\Parser $compiler)
{
Expand Down Expand Up @@ -200,12 +194,8 @@ protected function printTrace(Compiler\Llk\Parser $compiler)

/**
* Print token sequence.
*
* @param \Hoa\Compiler\Llk\Parser $compiler Compiler.
* @param string $data Data to lex.
* @return void
*/
protected function printTokenSequence(Compiler\Llk\Parser $compiler, $data)
protected function printTokenSequence(Compiler\Llk\Parser $compiler, string $data)
{
$lexer = new Compiler\Llk\Lexer();
$sequence = $lexer->lexMe($data, $compiler->getTokens());
Expand Down Expand Up @@ -244,8 +234,6 @@ protected function printTokenSequence(Compiler\Llk\Parser $compiler, $data)

/**
* The command usage.
*
* @return int
*/
public function usage()
{
Expand Down
7 changes: 3 additions & 4 deletions Exception/Exception.php → Source/Exception/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 @@ -43,9 +45,6 @@
* Class \Hoa\Compiler\Exception.
*
* Extending the \Hoa\Exception\Exception class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Exception extends HoaException
{
Expand All @@ -54,4 +53,4 @@ class Exception extends HoaException
/**
* Flex entity.
*/
Consistency::flexEntity('Hoa\Compiler\Exception\Exception');
Consistency::flexEntity(Exception::class);
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -40,9 +42,6 @@
* Class \Hoa\Compiler\Exception\FinalStateHasNotBeenReached.
*
* Extending the \Hoa\Compiler\Exception class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class FinalStateHasNotBeenReached extends Exception
{
Expand Down
17 changes: 4 additions & 13 deletions Exception/IllegalToken.php → Source/Exception/IllegalToken.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 @@ -40,9 +42,6 @@
* Class \Hoa\Compiler\Exception\IllegalToken.
*
* Extending the \Hoa\Compiler\Exception class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class IllegalToken extends Exception
{
Expand All @@ -57,14 +56,8 @@ class IllegalToken extends Exception

/**
* Override line and add column support.
*
* @param string $message Formatted message.
* @param int $code Code (the ID).
* @param array $arg RaiseError string arguments.
* @param int $line Line.
* @param int $column Column.
*/
public function __construct($message, $code, $arg, $line, $column)
public function __construct(string $message, int $code, $arg, int $line, int $column)
{
parent::__construct($message, $code, $arg);

Expand All @@ -76,10 +69,8 @@ public function __construct($message, $code, $arg, $line, $column)

/**
* Get column.
*
* @return int
*/
public function getColumn()
public function getColumn(): int
{
return $this->column;
}
Expand Down
5 changes: 2 additions & 3 deletions Exception/Lexer.php → Source/Exception/Lexer.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 @@ -40,9 +42,6 @@
* Class \Hoa\Compiler\Exception\Lexer.
*
* Extending the \Hoa\Compiler\Exception class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Lexer extends Exception
{
Expand Down
5 changes: 2 additions & 3 deletions Exception/Rule.php → Source/Exception/Rule.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 @@ -40,9 +42,6 @@
* Class \Hoa\Compiler\Exception\FinalStateHasNotBeenReached.
*
* Extending the \Hoa\Compiler\Exception class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Rule extends Exception
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -40,9 +42,6 @@
* Class \Hoa\Compiler\Exception\UnexpectedToken.
*
* Extending the \Hoa\Compiler\Exception\UnrecognizedToken class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class UnexpectedToken extends UnrecognizedToken
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -40,9 +42,6 @@
* Class \Hoa\Compiler\Exception\UnrecognizedToken.
*
* Extending the \Hoa\Compiler\Exception class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class UnrecognizedToken extends Exception
{
Expand All @@ -57,14 +56,8 @@ class UnrecognizedToken extends Exception

/**
* Override line and add column support.
*
* @param string $message Formatted message.
* @param int $code Code (the ID).
* @param array $arg RaiseError string arguments.
* @param int $line Line.
* @param int $column Column.
*/
public function __construct($message, $code, $arg, $line, $column)
public function __construct(string $message, int $code, $arg, int $line, int $column)
{
parent::__construct($message, $code, $arg);

Expand All @@ -76,10 +69,8 @@ public function __construct($message, $code, $arg, $line, $column)

/**
* Get column.
*
* @return int
*/
public function getColumn()
public function getColumn(): int
{
return $this->column;
}
Expand Down
Loading