Skip to content

Commit 96e3e29

Browse files
committed
Remove default values and psalm-pure annotation (by PHPStan)
Cleaned up code by removing the default value for `Named::$value` and `Inject::$optional`, ensuring they must be explicitly set upon instantiation. The `psalm-pure` annotation was also removed from the `getStringName` function, reflecting the function's possible side effects or method calls. These changes improve code clarity and enforce proper initialization practices.
1 parent 35f6fc5 commit 96e3e29

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/di/Bind.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ private function isRegistered(string $interface): bool
206206
* output: "varA=nameA,varB=nameB"
207207
*
208208
* @param array<string, string> $name
209-
*
210-
* @psalm-pure
211209
*/
212210
private function getStringName(array $name): string
213211
{

src/di/Di/Inject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class Inject implements InjectInterface
2323
*
2424
* @var bool
2525
*/
26-
public $optional = false;
26+
public $optional;
2727

2828
/**
2929
* @SuppressWarnings(PHPMD.BooleanArgumentFlag) // @phpstan-ignore-line

src/di/Di/Named.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
final class Named
2020
{
2121
/** @var string */
22-
public $value = '';
22+
public $value;
2323

2424
public function __construct(string $value)
2525
{

0 commit comments

Comments
 (0)