Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Dec 11, 2024
1 parent 2436e5a commit e83d257
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"require": {
"php": ">=8.1",
"psr/container": "^1.1|^2.0",
"spiral/security": "^3.15"
"spiral/security": "^3.14.8"
},
"require-dev": {
"mockery/mockery": "^1.5",
Expand Down
2 changes: 1 addition & 1 deletion src/ConfigsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ interface ConfigsInterface extends InjectorInterface
*
* @throws ConfiguratorException
*/
public function getConfig(string $section = null): array;
public function getConfig(?string $section = null): array;
}
4 changes: 2 additions & 2 deletions src/Internal/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ private function resolveObject(
private function processArgument(
ResolvingState $state,
mixed &$value,
ReflectionParameter $validateWith = null,
int|string $key = null
?ReflectionParameter $validateWith = null,
int|string|null $key = null
): void {
// Resolve Autowire objects
if ($value instanceof Autowire) {
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/Resolver/ResolvingState.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
$this->modeNamed = $this->isNamedMode();
}

public function addResolvedValue(mixed &$value, string $key = null): void
public function addResolvedValue(mixed &$value, ?string $key = null): void
{
if ($key === null) {
$this->resolvedValues[] = &$value;
Expand Down
2 changes: 1 addition & 1 deletion tests/ExceptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testInjectionUsingIntersectionTypes(): void
$container->resolveArguments(new \ReflectionMethod(IntersectionTypes::class, 'example'));
}

public function testArgumentException(string $param = null): void
public function testArgumentException(?string $param = null): void
{
$method = new \ReflectionMethod($this, 'testArgumentException');

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/DatetimeInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class DatetimeInjector implements InjectorInterface
{
public function createInjection(\ReflectionClass $class, string $context = null): object
public function createInjection(\ReflectionClass $class, ?string $context = null): object
{
return match ($class->getName()) {
DateTime::class => new DateTime(),
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/SoftDependedClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SoftDependedClass
* @param string $name
* @param SampleClass $sample
*/
public function __construct(string $name, SampleClass $sample = null)
public function __construct(string $name, ?SampleClass $sample = null)
{
$this->name = $name;
$this->sample = $sample;
Expand Down
4 changes: 3 additions & 1 deletion tests/InjectableConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Spiral\Tests\Core\Fixtures\IntKeysConfig;
use Spiral\Tests\Core\Fixtures\TestConfig;

#[\PHPUnit\Framework\Attributes\CoversClass(\Spiral\Core\InjectableConfig::class)]
class InjectableConfigTest extends TestCase
{
use AliasTrait;
Expand Down Expand Up @@ -102,6 +101,9 @@ public function testGetError(): void
$config['keyC'];
}

/**
* @covers \Spiral\Core\InjectableConfig::__set_state()
*/
public function testSerialize(): void
{
$config = new TestConfig([
Expand Down
2 changes: 1 addition & 1 deletion tests/Internal/Factory/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

abstract class BaseTestCase extends \Spiral\Tests\Core\Internal\BaseTestCase
{
protected function make(string $class, array $args = [], string $context = null): mixed
protected function make(string $class, array $args = [], ?string $context = null): mixed
{
return $this->createFactory()->make($class, $args, $context);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Internal/Proxy/ProxyClassRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public static function provideRenderParameter(): iterable
yield [$from(fn(float $string = 42) => 0), 'mixed $string = 42.0'];
yield [$from(fn(?bool $string = false) => 0), 'mixed $string = false'];
yield [$from(fn(bool|null $string = true) => 0), 'mixed $string = true'];
yield [$from(fn(object $string = null) => 0), 'mixed $string = NULL'];
yield [$from(fn(iterable $string = null) => 0), 'mixed $string = NULL'];
yield [$from(fn(?object $string = null) => 0), 'mixed $string = NULL'];
yield [$from(fn(?iterable $string = null) => 0), 'mixed $string = NULL'];
yield [$from(fn(Countable&ArrayAccess $val) => 0), 'mixed $val'];
yield [$from(fn(string ...$val) => 0), 'mixed ...$val'];
yield [$from(fn(string|int ...$val) => 0), 'mixed ...$val'];
Expand Down
2 changes: 1 addition & 1 deletion tests/Internal/Resolver/PositionArgumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testSecondPositionArgument(): void
public function testFirstIsOptionalSecondPassedAsArgument(): void
{
$result = $this->resolveClosure(
static fn(int $foo = 42, EngineInterface $engine2 = null) => null,
static fn(int $foo = 42, ?EngineInterface $engine2 = null) => null,
[1 => ($engineB = new EngineZIL130())]
);

Expand Down

0 comments on commit e83d257

Please sign in to comment.