Skip to content

Commit

Permalink
Merge pull request #29 from samsonasik/apply-php74
Browse files Browse the repository at this point in the history
Apply PHP 7.4 syntax and typed property
  • Loading branch information
Ocramius authored Sep 18, 2022
2 parents deecb3c + d06d931 commit f60fa21
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/ParameterNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

class ParameterNotFoundException extends InvalidArgumentException
{
/** @var string */
private $key;
private string $key;

public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null, string $key = '')
{
Expand Down
4 changes: 2 additions & 2 deletions src/ParameterPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ParameterPostProcessor
* @var array<string,mixed>
* @psalm-var TParameters
*/
private $parameters;
private array $parameters;

/**
* @param array<string,mixed> $parameters
Expand All @@ -44,7 +44,7 @@ public function __invoke(array $config): array
$parameters = $this->getResolvedParameters();

/** @psalm-suppress MissingClosureParamType */
array_walk_recursive($config, static function (&$value) use ($parameters) {
array_walk_recursive($config, static function (&$value) use ($parameters): void {
/** @psalm-suppress MixedAssignment */
$value = $parameters->unescapeValue($parameters->resolveValue($value));
});
Expand Down
4 changes: 1 addition & 3 deletions test/LazyParameterPostProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public function testParameterProviderNotCalledDuringInstantiation(): void

public function testParametersAreBeingProcessed(): void
{
$provider = static function (): array {
return ['foo' => 'bar'];
};
$provider = static fn(): array => ['foo' => 'bar'];

$config = [
'foo' => '%foo%',
Expand Down

0 comments on commit f60fa21

Please sign in to comment.