diff --git a/composer.json b/composer.json index ff76f98..b779736 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ ], "type": "library", "require": { - "php": ">=7.4" + "php": "~8.1" }, "require-dev": { "mockery/mockery": "^1.3", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f3f5ed1..78efea8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,41 +1,33 @@ - - - - tests/Delimiters - - - tests/Diff - - - tests/Granularity - - - tests/Parser - - - tests/Render - - - tests/Usage - - - - - src - - PEAR_INSTALL_DIR - PHP_LIBDIR - vendor - - - + + + + src + + + PEAR_INSTALL_DIR + PHP_LIBDIR + vendor + + + + + tests/Delimiters + + + tests/Diff + + + tests/Granularity + + + tests/Parser + + + tests/Render + + + tests/Usage + + diff --git a/src/Granularity/Granularity.php b/src/Granularity/Granularity.php index 6c754ce..6145a47 100644 --- a/src/Granularity/Granularity.php +++ b/src/Granularity/Granularity.php @@ -7,7 +7,7 @@ trait Granularity /** * @inheritdoc */ - public function offsetExists($offset) + public function offsetExists(mixed $offset): bool { return isset($this->delimiters[$offset]); } @@ -15,15 +15,15 @@ public function offsetExists($offset) /** * @inheritdoc */ - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { - return isset($this->delimiters[$offset]) ? $this->delimiters[$offset] : null; + return $this->delimiters[$offset] ?? null; } /** * @inheritdoc */ - public function offsetSet($offset, $value) + public function offsetSet(mixed $offset, mixed $value): void { if ($offset === null) { $this->delimiters[] = $value; @@ -35,7 +35,7 @@ public function offsetSet($offset, $value) /** * @inheritdoc */ - public function offsetUnset($offset) + public function offsetUnset(mixed $offset): void { unset($this->delimiters[$offset]); } @@ -45,7 +45,7 @@ public function offsetUnset($offset) * * @return int */ - public function count() + public function count(): int { return count($this->delimiters); }