Skip to content

Commit

Permalink
fix PHP 8.1 implicit conversion deprecation
Browse files Browse the repository at this point in the history
upgraded dev to php unit 9
  • Loading branch information
proggeler committed Dec 1, 2022
1 parent 7f82a66 commit fac09e7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^8.5 | ^9.5",
"phpunit/phpunit": "^9.5",
"guzzlehttp/guzzle": "^7.4",
"http-interop/http-factory-guzzle": "^1.2"
}
Expand Down
19 changes: 10 additions & 9 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src/</directory>
</whitelist>
</filter>
</phpunit>
</phpunit>
2 changes: 1 addition & 1 deletion src/Middleware/RateLimitMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function process(RequestInterface $request, RequestHandlerInterface $hand

private function getCounter(): Counter
{
$default = new Counter(new DateTime(date('Y-m-d H:i:s.u', microtime(true) + $this->duration)));
$default = new Counter(DateTime::createFromFormat('U', $this->duration + time()));

/** @var Counter $counter */
$counter = $this->cache->get($this->cacheKey, $default);
Expand Down

0 comments on commit fac09e7

Please sign in to comment.