Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
ci:
uses: ray-di/.github/.github/workflows/continuous-integration.yml@v1
with:
old_stable: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]'
current_stable: 8.3
old_stable: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]'
current_stable: 8.4
script: demo/run.php
2 changes: 1 addition & 1 deletion src/di/Argument.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getMeta(): string
/**
* {@inheritDoc}
*/
public function serialize(): ?string
public function serialize(): ?string // @phpstan-ignore-line
{
return serialize($this->__serialize());
}
Expand Down
2 changes: 1 addition & 1 deletion src/di/Di/Inject.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class Inject implements InjectInterface
public $optional = false;

/**
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
* @SuppressWarnings(PHPMD.BooleanArgumentFlag) // @phpstan-ignore-line
*/
public function __construct(bool $optional = false)
{
Expand Down
2 changes: 1 addition & 1 deletion src/di/InjectionPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function __unserialize(array $array): void
[$this->pClass, $this->pFunction, $this->pName] = $array;
}

public function serialize(): ?string
public function serialize(): ?string // @phpstan-ignore-line
{
return serialize($this->__serialize());
}
Expand Down
1 change: 0 additions & 1 deletion src/di/MultiBinding/LazyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Ray\Di\InjectorInterface;
use Ray\Di\ProviderInterface;

use function assert;

Check failure on line 10 in src/di/MultiBinding/LazyProvider.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type assert is not used in this file.

Check failure on line 10 in src/di/MultiBinding/LazyProvider.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type assert is not used in this file.

/**
* @template T of ProviderInterface
Expand All @@ -31,7 +31,6 @@
public function __invoke(InjectorInterface $injector)
{
$provider = $injector->getInstance($this->class);
assert($provider instanceof ProviderInterface);

return $provider->get();
}
Expand Down
1 change: 0 additions & 1 deletion src/di/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use ReflectionMethod;
use ReflectionParameter;

use function assert;

Check failure on line 15 in src/di/Name.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type assert is not used in this file.

Check failure on line 15 in src/di/Name.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type assert is not used in this file.
use function class_exists;
use function explode;
use function get_class;
Expand Down Expand Up @@ -150,12 +150,11 @@
$exploded = explode('=', $keyValue);
if (isset($exploded[1])) {
[$key, $value] = $exploded;
assert(is_string($key));
if (isset($key[0]) && $key[0] === '$') {
$key = substr($key, 1);

Check failure on line 154 in src/di/Name.php

View workflow job for this annotation

GitHub Actions / sa / Psalm

MixedArgument: Argument 1 of substr cannot be mixed, expecting string

Check failure on line 154 in src/di/Name.php

View workflow job for this annotation

GitHub Actions / sa / Psalm

MixedArgument: Argument 1 of substr cannot be mixed, expecting string
}

$names[trim($key)] = trim($value);

Check failure on line 157 in src/di/Name.php

View workflow job for this annotation

GitHub Actions / sa / Psalm

MixedArgument: Argument 1 of trim cannot be false|mixed|string, expecting string

Check failure on line 157 in src/di/Name.php

View workflow job for this annotation

GitHub Actions / sa / Psalm

MixedArgument: Argument 1 of trim cannot be false|mixed|string, expecting string
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/di/ArgumentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use ReflectionMethod;
use ReflectionParameter;

use function assert;

Check failure on line 11 in tests/di/ArgumentsTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type assert is not used in this file.

Check failure on line 11 in tests/di/ArgumentsTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type assert is not used in this file.
use function is_object;

Check failure on line 12 in tests/di/ArgumentsTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type is_object is not used in this file.

Check failure on line 12 in tests/di/ArgumentsTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type is_object is not used in this file.
use function spl_object_hash;

class ArgumentsTest extends TestCase
Expand All @@ -29,7 +29,6 @@
$this->assertInstanceOf(FakeTyre::class, $parameters[0]);
$this->assertInstanceOf(FakeTyre::class, $parameters[1]);
$param0 = $parameters[0];
assert(is_object($param0));
$this->assertNotSame(spl_object_hash($param0), $parameters[1]);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/di/Fake/FakePhp8Car.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function setQualiferMirrors(#[FakeRight] FakeMirrorInterface $rightMirror
}

#[Inject]
public function notQualifer(#[FakeNotQualifer] FakeMirrorInterface $rightMirror = null): void
public function notQualifer(#[FakeNotQualifer] ?FakeMirrorInterface $rightMirror = null): void
{
}

Expand Down
1 change: 0 additions & 1 deletion tests/di/GrapherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use function assert;
use function file_get_contents;
use function is_object;

Check failure on line 12 in tests/di/GrapherTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type is_object is not used in this file.

Check failure on line 12 in tests/di/GrapherTest.php

View workflow job for this annotation

GitHub Actions / cs / Coding Standards

Type is_object is not used in this file.
use function is_string;
use function passthru;
use function property_exists;
Expand All @@ -28,8 +28,7 @@
$grapher = new Grapher(new FakeUntargetModule(), __DIR__ . '/tmp');
$instance = $grapher->newInstanceArgs(FakeUntargetChild::class, ['1']);
$this->assertInstanceOf(FakeUntargetChild::class, $instance);
assert(is_object($instance));
assert(property_exists($instance, 'val'));

Check failure on line 31 in tests/di/GrapherTest.php

View workflow job for this annotation

GitHub Actions / sa / PHPStan

Call to function property_exists() with Ray\Di\FakeUntargetChild and 'val' will always evaluate to true.

Check failure on line 31 in tests/di/GrapherTest.php

View workflow job for this annotation

GitHub Actions / sa / PHPStan

Call to function property_exists() with Ray\Di\FakeUntargetChild and 'val' will always evaluate to true.
$this->assertSame('1', $instance->val);
}

Expand Down
4 changes: 2 additions & 2 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"doctrine/coding-standard": "^9.0",
"phpmd/phpmd": "^2.9",
"phpmetrics/phpmetrics": "^2.7",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan": "^2.0",
"squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.2",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-phpunit": "^2.0",
"psalm/plugin-phpunit": "^0.17.0"
},
"config": {
Expand Down
95 changes: 47 additions & 48 deletions vendor-bin/tools/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading