Skip to content
Merged
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"type": "library",
"require": {
"php": ">=7.4"
"php": "~8.1"
},
"require-dev": {
"mockery/mockery": "^1.3",
Expand Down
70 changes: 31 additions & 39 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Delimiters">
<directory suffix=".php">tests/Delimiters</directory>
</testsuite>
<testsuite name="Diff">
<directory suffix=".php">tests/Diff</directory>
</testsuite>
<testsuite name="Granularity">
<directory suffix=".php">tests/Granularity</directory>
</testsuite>
<testsuite name="Parser">
<directory suffix=".php">tests/Parser</directory>
</testsuite>
<testsuite name="Render">
<directory suffix=".php">tests/Render</directory>
</testsuite>
<testsuite name="Usage">
<directory suffix=".php">tests/Usage</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">PEAR_INSTALL_DIR</directory>
<directory suffix=".php">PHP_LIBDIR</directory>
<directory suffix=".php">vendor</directory>
</exclude>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory suffix=".php">PEAR_INSTALL_DIR</directory>
<directory suffix=".php">PHP_LIBDIR</directory>
<directory suffix=".php">vendor</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Delimiters">
<directory suffix=".php">tests/Delimiters</directory>
</testsuite>
<testsuite name="Diff">
<directory suffix=".php">tests/Diff</directory>
</testsuite>
<testsuite name="Granularity">
<directory suffix=".php">tests/Granularity</directory>
</testsuite>
<testsuite name="Parser">
<directory suffix=".php">tests/Parser</directory>
</testsuite>
<testsuite name="Render">
<directory suffix=".php">tests/Render</directory>
</testsuite>
<testsuite name="Usage">
<directory suffix=".php">tests/Usage</directory>
</testsuite>
</testsuites>
</phpunit>
12 changes: 6 additions & 6 deletions src/Granularity/Granularity.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ trait Granularity
/**
* @inheritdoc
*/
public function offsetExists($offset)
public function offsetExists(mixed $offset): bool
{
return isset($this->delimiters[$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;
Expand All @@ -35,7 +35,7 @@ public function offsetSet($offset, $value)
/**
* @inheritdoc
*/
public function offsetUnset($offset)
public function offsetUnset(mixed $offset): void
{
unset($this->delimiters[$offset]);
}
Expand All @@ -45,7 +45,7 @@ public function offsetUnset($offset)
*
* @return int
*/
public function count()
public function count(): int
{
return count($this->delimiters);
}
Expand Down