Skip to content

Commit

Permalink
Merge pull request #129 from Jakub-Fajkus/php81
Browse files Browse the repository at this point in the history
PHP 8.1
  • Loading branch information
Spamercz authored Feb 4, 2022
2 parents b5a20b5 + bc554fe commit 7190f4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-package-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 7.4, 8.0 ]
php: [ 7.4, 8.0, 8.1 ]
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
Expand Down
12 changes: 6 additions & 6 deletions src/Events/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function unshift($listener)
/**
* @return int
*/
public function count()
public function count(): int
{
return count($this->listeners);
}
Expand All @@ -241,7 +241,7 @@ public function count()
/**
* @return \ArrayIterator|\Traversable
*/
public function getIterator()
public function getIterator(): \Traversable
{
return new ArrayIterator($this->getListeners());
}
Expand All @@ -252,7 +252,7 @@ public function getIterator()
* @param int|NULL $index
* @param callable $item
*/
public function offsetSet($index, $item)
public function offsetSet($index, $item): void
{
Callback::check($item, TRUE);

Expand All @@ -269,7 +269,7 @@ public function offsetSet($index, $item)
* @return callable
* @throws \Kdyby\Events\OutOfRangeException
*/
public function offsetGet($index)
public function offsetGet($index): mixed
{
if (!$this->offsetExists($index)) {
throw new \Kdyby\Events\OutOfRangeException();
Expand All @@ -282,15 +282,15 @@ public function offsetGet($index)
* @param int $index
* @return bool
*/
public function offsetExists($index)
public function offsetExists($index): bool
{
return isset($this->listeners[$index]);
}

/**
* @param int $index
*/
public function offsetUnset($index)
public function offsetUnset($index): void
{
unset($this->listeners[$index]);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/KdybyTests/Events/ExtensionTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ExtensionTest extends \Tester\TestCase
);

} catch (\Nette\DI\ServiceCreationException $e) {
Assert::match("Service 'events.subscriber.0': Class NonExistingClass_%a% not found%a?%.", $e->getMessage());
Assert::match("Service 'events.subscriber.0': Class 'NonExistingClass_%a%' not found%a?%.", $e->getMessage());

} catch (\Exception $e) {
Assert::fail($e->getMessage());
Expand Down

0 comments on commit 7190f4e

Please sign in to comment.