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

Commit

Permalink
feat(kitab) Be compatible with PHP 7.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Jul 5, 2017
1 parent f1fc6d8 commit 5eba85e
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"php" : ">=7.1",
"php" : ">=7.0",
"atoum/atoum" : "~3.0",
"hoa/console" : "~3.0",
"hoa/dispatcher" : "~1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Bin/Bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function main()
self::exitWith($message, $code);
}

protected static function setErrorHandler(): void
protected static function setErrorHandler()
{
Exception\Error::enableErrorHandler();
Exception::enableUncaughtHandler();
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/IntermediateRepresentation/Class_.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function __construct(string $name)
/**
* Return all methods declared for this entity.
*/
public function getMethods(): iterable
public function getMethods(): array
{
return $this->methods;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/IntermediateRepresentation/HasMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ interface HasMethods
/**
* Return all methods declared for this entity.
*/
public function getMethods(): iterable;
public function getMethods(): array;
}
2 changes: 1 addition & 1 deletion src/Compiler/IntermediateRepresentation/Interface_.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct(string $name)
/**
* Return all methods declared for this entity.
*/
public function getMethods(): iterable
public function getMethods(): array
{
return $this->methods;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/IntermediateRepresentation/Into.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function __construct(string $filename)
* This method returns nothing because it is called several times by the
* traverser API. To get the final result, see the `collect` method.
*/
public function leaveNode(Node $node): void
public function leaveNode(Node $node)
{
if ($node instanceof Node\Stmt\Class_) {
$classNode = $node;
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/IntermediateRepresentation/Trait_.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function __construct(string $name)
/**
* Return all methods declared for this entity.
*/
public function getMethods(): iterable
public function getMethods(): array
{
return $this->methods;
}
Expand Down
5 changes: 3 additions & 2 deletions src/Compiler/Target/DocTest/DocTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

namespace Kitab\Compiler\Target\DocTest;

use Generator;
use Hoa\File\Directory;
use Hoa\File\Write;
use Kitab\Compiler\IntermediateRepresentation;
Expand Down Expand Up @@ -130,7 +131,7 @@ public function assemble(array $symbols)
return;
}

protected function getCodeBlocks(IntermediateRepresentation\Documentation $documentation = null): iterable
protected function getCodeBlocks(IntermediateRepresentation\Documentation $documentation = null): Generator
{
if (empty($documentation) ||
empty($documentation->documentation)) {
Expand All @@ -142,7 +143,7 @@ protected function getCodeBlocks(IntermediateRepresentation\Documentation $docum
);
}

protected function parseCodeBlocks(CommonMark\Node\NodeWalker $walker): iterable
protected function parseCodeBlocks(CommonMark\Node\NodeWalker $walker): Generator
{
$hashes = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Target/Templater.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getOutputStream(): Out
return $this->_out;
}

public function getData(): ?StdClass
public function getData(): StdClass
{
return $this->_data;
}
Expand All @@ -92,7 +92,7 @@ public function render()
return;
}

public function getRouter(): ?Router
public function getRouter()
{
return $this->_router;
}
Expand Down

0 comments on commit 5eba85e

Please sign in to comment.