Skip to content

Commit

Permalink
Drop support for php 7.4 (#6)
Browse files Browse the repository at this point in the history
* Drop support for php 7.4

* Reformat phpunit config
  • Loading branch information
akondas authored Jan 23, 2024
1 parent b092b27 commit c4a5b12
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"

runs-on: ubuntu-latest

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Exspecto

[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)

Small PHP DSL for synchronizing asynchronous operations (busy-waiting).

Expand All @@ -21,6 +21,11 @@ await()->atMost(3)->pollInterval(200)->until(function() {
});
```

You can also await for given value in case the returning method (closure) could throw an exception:
```php
$value = await()->atMost(3)->pollInterval(200)->on(fn() => getValue());
```

---

*exspecto* - from latin: *wait for*, *await*
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
}
],
"require": {
"php": ">=7.4"
"php": ">=8.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.2",
"php-cs-fixer/shim": "^3.48",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5"
},
"autoload": {
"psr-4": {
Expand All @@ -37,6 +37,9 @@
"Akondas\\Exspecto\\Tests\\": "tests/"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"build": [
"@check-cs",
Expand Down
12 changes: 4 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
verbose="true"
colors="true"
cacheDirectory=".phpunit.cache"
>
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>

<coverage cacheDirectory=".phpunit.cache/code-coverage"
processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
</source>
</phpunit>
4 changes: 1 addition & 3 deletions tests/AwaitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public function testAwaitTimeout(): void
{
$this->expectException(TimeoutException::class);

await()->atMost(100, Duration::MILLISECONDS)->pollInterval(30)->until(function (): bool {
return false;
});
await()->atMost(100, Duration::MILLISECONDS)->pollInterval(30)->until(fn (): bool => false);
}

public function testReturnValue(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/DurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testFromUnit($duration, string $unit, int $expected): void
/**
* @return array<mixed>
*/
public function durationsProvider(): array
public static function durationsProvider(): array
{
return [
[1, Duration::SECONDS, 1_000_000],
Expand Down

0 comments on commit c4a5b12

Please sign in to comment.