diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c56eae..126e30d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ jobs: include: - php-versions: '7.1' cs-fixer: false + - php-versions: '8.1' + cs-fixer: false steps: - name: Checkout uses: actions/checkout@v2 diff --git a/Core/Frameworks/Flake/Core/Collection.php b/Core/Frameworks/Flake/Core/Collection.php index 09ead65..0a5c490 100644 --- a/Core/Frameworks/Flake/Core/Collection.php +++ b/Core/Frameworks/Flake/Core/Collection.php @@ -39,15 +39,15 @@ class Collection extends \Flake\Core\FLObject implements \Iterator { return key($this->aCollection); } - function next() { - return next($this->aCollection); + function next(): void { + next($this->aCollection); } - function rewind() { + function rewind(): void { $this->reset(); } - function valid() { + function valid(): bool { $key = key($this->aCollection); return ($key !== null && $key !== false); diff --git a/Core/Frameworks/Flake/Core/Datastructure/Chain.php b/Core/Frameworks/Flake/Core/Datastructure/Chain.php index 1f1b54b..28cee23 100644 --- a/Core/Frameworks/Flake/Core/Datastructure/Chain.php +++ b/Core/Frameworks/Flake/Core/Datastructure/Chain.php @@ -31,12 +31,12 @@ namespace Flake\Core\Datastructure; * @extends \SplDoublyLinkedList<\Flake\Core\Datastructure\Chainable> */ class Chain extends \SplDoublyLinkedList { - function push($value) { + function push($value): void { $value->chain($this, $this->count()); parent::push($value); } - function offsetUnset($offset) { + function offsetUnset($offset): void { throw new \Exception("Cannot delete Chainable in Chain"); } diff --git a/Core/Frameworks/Flake/Core/Datastructure/ChainLink.php b/Core/Frameworks/Flake/Core/Datastructure/ChainLink.php index cc046d3..313569f 100644 --- a/Core/Frameworks/Flake/Core/Datastructure/ChainLink.php +++ b/Core/Frameworks/Flake/Core/Datastructure/ChainLink.php @@ -36,7 +36,7 @@ abstract class ChainLink implements \Flake\Core\Datastructure\Chainable { $this->__key = $key; } - function offsetSet($offset, $value) { + function offsetSet($offset, $value): void { if (is_null($this->__container)) { return; } @@ -44,7 +44,7 @@ abstract class ChainLink implements \Flake\Core\Datastructure\Chainable { $this->__container->offsetSet($offset, $value); } - function offsetExists($offset) { + function offsetExists($offset): bool { if (is_null($this->__container)) { return false; } @@ -52,7 +52,7 @@ abstract class ChainLink implements \Flake\Core\Datastructure\Chainable { return $this->__container->offsetExists($offset); } - function offsetUnset($offset) { + function offsetUnset($offset): void { if (is_null($this->__container)) { return; } @@ -70,7 +70,7 @@ abstract class ChainLink implements \Flake\Core\Datastructure\Chainable { return $oRes; } - function rewind() { + function rewind(): void { $this->__container->rewind(); } @@ -82,10 +82,8 @@ abstract class ChainLink implements \Flake\Core\Datastructure\Chainable { return $this->__container->key(); } - function &next() { - $oRes = $this->__container->next(); - - return $oRes; + function &next(): void { + $this->__container->next(); } function &prev() { @@ -94,11 +92,11 @@ abstract class ChainLink implements \Flake\Core\Datastructure\Chainable { return $oPrev; } - function valid() { + function valid(): bool { return $this->__container->valid(); } - function count() { + function count(): int { return $this->__container->count(); }