Skip to content

Commit 80b04a8

Browse files
authored
Merge pull request #4 from trickeyone/php81
2 parents ca7aa58 + 89ae975 commit 80b04a8

File tree

3 files changed

+38
-46
lines changed

3 files changed

+38
-46
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
],
2222
"type": "library",
2323
"require": {
24-
"php": ">=7.4"
24+
"php": "~8.1"
2525
},
2626
"require-dev": {
2727
"mockery/mockery": "^1.3",

phpunit.xml.dist

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
colors="true"
4-
convertNoticesToExceptions="true"
5-
convertWarningsToExceptions="true"
6-
stopOnError="false"
7-
stopOnFailure="false"
8-
stopOnIncomplete="false"
9-
bootstrap="vendor/autoload.php"
10-
>
11-
<testsuites>
12-
<testsuite name="Delimiters">
13-
<directory suffix=".php">tests/Delimiters</directory>
14-
</testsuite>
15-
<testsuite name="Diff">
16-
<directory suffix=".php">tests/Diff</directory>
17-
</testsuite>
18-
<testsuite name="Granularity">
19-
<directory suffix=".php">tests/Granularity</directory>
20-
</testsuite>
21-
<testsuite name="Parser">
22-
<directory suffix=".php">tests/Parser</directory>
23-
</testsuite>
24-
<testsuite name="Render">
25-
<directory suffix=".php">tests/Render</directory>
26-
</testsuite>
27-
<testsuite name="Usage">
28-
<directory suffix=".php">tests/Usage</directory>
29-
</testsuite>
30-
</testsuites>
31-
<filter>
32-
<whitelist>
33-
<directory suffix=".php">src</directory>
34-
<exclude>
35-
<directory suffix=".php">PEAR_INSTALL_DIR</directory>
36-
<directory suffix=".php">PHP_LIBDIR</directory>
37-
<directory suffix=".php">vendor</directory>
38-
</exclude>
39-
</whitelist>
40-
</filter>
2+
<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">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src</directory>
6+
</include>
7+
<exclude>
8+
<directory suffix=".php">PEAR_INSTALL_DIR</directory>
9+
<directory suffix=".php">PHP_LIBDIR</directory>
10+
<directory suffix=".php">vendor</directory>
11+
</exclude>
12+
</coverage>
13+
<testsuites>
14+
<testsuite name="Delimiters">
15+
<directory suffix=".php">tests/Delimiters</directory>
16+
</testsuite>
17+
<testsuite name="Diff">
18+
<directory suffix=".php">tests/Diff</directory>
19+
</testsuite>
20+
<testsuite name="Granularity">
21+
<directory suffix=".php">tests/Granularity</directory>
22+
</testsuite>
23+
<testsuite name="Parser">
24+
<directory suffix=".php">tests/Parser</directory>
25+
</testsuite>
26+
<testsuite name="Render">
27+
<directory suffix=".php">tests/Render</directory>
28+
</testsuite>
29+
<testsuite name="Usage">
30+
<directory suffix=".php">tests/Usage</directory>
31+
</testsuite>
32+
</testsuites>
4133
</phpunit>

src/Granularity/Granularity.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ trait Granularity
77
/**
88
* @inheritdoc
99
*/
10-
public function offsetExists($offset)
10+
public function offsetExists(mixed $offset): bool
1111
{
1212
return isset($this->delimiters[$offset]);
1313
}
1414

1515
/**
1616
* @inheritdoc
1717
*/
18-
public function offsetGet($offset)
18+
public function offsetGet(mixed $offset): mixed
1919
{
20-
return isset($this->delimiters[$offset]) ? $this->delimiters[$offset] : null;
20+
return $this->delimiters[$offset] ?? null;
2121
}
2222

2323
/**
2424
* @inheritdoc
2525
*/
26-
public function offsetSet($offset, $value)
26+
public function offsetSet(mixed $offset, mixed $value): void
2727
{
2828
if ($offset === null) {
2929
$this->delimiters[] = $value;
@@ -35,7 +35,7 @@ public function offsetSet($offset, $value)
3535
/**
3636
* @inheritdoc
3737
*/
38-
public function offsetUnset($offset)
38+
public function offsetUnset(mixed $offset): void
3939
{
4040
unset($this->delimiters[$offset]);
4141
}
@@ -45,7 +45,7 @@ public function offsetUnset($offset)
4545
*
4646
* @return int
4747
*/
48-
public function count()
48+
public function count(): int
4949
{
5050
return count($this->delimiters);
5151
}

0 commit comments

Comments
 (0)