Skip to content

Commit 6bd2ff8

Browse files
committed
Update container to use PSR 2.0
1 parent 8a9665e commit 6bd2ff8

File tree

5 files changed

+36
-15
lines changed

5 files changed

+36
-15
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.0",
13+
"php": "^8.1",
1414
"phpactor/map-resolver": "^1.4",
15-
"psr/container": "^1.0"
15+
"psr/container": "^2.0"
1616
},
1717
"require-dev": {
1818
"ergebnis/composer-normalize": "^2.0",
1919
"friendsofphp/php-cs-fixer": "^3.0",
2020
"phpstan/phpstan": "^1.0",
21-
"phpunit/phpunit": "^9.0",
21+
"phpunit/phpunit": "^11.0",
2222
"phpspec/prophecy-phpunit": "^2.0"
2323
},
2424
"extra": {

lib/PhpactorContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function get($id)
8686
}
8787

8888

89-
public function has($id)
89+
public function has($id): bool
9090
{
9191
return array_key_exists($id, $this->factories);
9292
}

phpunit.xml.dist

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
4-
<coverage includeUncoveredFiles="true">
5-
<include>
6-
<directory>.</directory>
7-
</include>
8-
<exclude>
9-
<directory>vendor/</directory>
10-
</exclude>
11-
</coverage>
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd">
124
<testsuites>
135
<testsuite name="PhpActor Test Suite">
146
<directory>./tests</directory>
@@ -17,4 +9,12 @@
179
<php>
1810
<env name="PHPACTOR_ALLOW_XDEBUG" value="1"/>
1911
</php>
12+
<source>
13+
<include>
14+
<directory>.</directory>
15+
</include>
16+
<exclude>
17+
<directory>vendor/</directory>
18+
</exclude>
19+
</source>
2020
</phpunit>

phpunit.xml.dist.bak

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
4+
<coverage includeUncoveredFiles="true">
5+
<include>
6+
<directory>.</directory>
7+
</include>
8+
<exclude>
9+
<directory>vendor/</directory>
10+
</exclude>
11+
</coverage>
12+
<testsuites>
13+
<testsuite name="PhpActor Test Suite">
14+
<directory>./tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<php>
18+
<env name="PHPACTOR_ALLOW_XDEBUG" value="1"/>
19+
</php>
20+
</phpunit>

tests/Unit/ParameterTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Closure;
66
use Generator;
7+
use PHPUnit\Framework\Attributes\DataProvider;
78
use PHPUnit\Framework\TestCase;
89
use Phpactor\Container\Parameter;
910
use RuntimeException;
@@ -21,9 +22,9 @@ public function testCast(): void
2122
}
2223

2324
/**
24-
* @dataProvider provideCastException
2525
* @param Closure(Parameter): mixed $invoker
2626
*/
27+
#[DataProvider('provideCastException')]
2728
public function testCastException(mixed $value, Closure $invoker, string $message): void
2829
{
2930
$this->expectException(RuntimeException::class);
@@ -35,7 +36,7 @@ public function testCastException(mixed $value, Closure $invoker, string $messag
3536
/**
3637
* @return Generator<string,array{mixed,Closure(Parameter): mixed,string}>
3738
*/
38-
public function provideCastException(): Generator
39+
public static function provideCastException(): Generator
3940
{
4041
yield 'not an int' => [
4142
'12',

0 commit comments

Comments
 (0)