Skip to content

Commit 57a68c2

Browse files
authored
Merge pull request #31 from samsonasik/apply-php80
Apply PHP 8.0 Syntax and constructor promotion
2 parents af19dce + 050ce42 commit 57a68c2

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

src/ParameterNotFoundException.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212

1313
class ParameterNotFoundException extends InvalidArgumentException
1414
{
15-
private string $key;
16-
17-
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null, string $key = '')
18-
{
15+
public function __construct(
16+
string $message = "",
17+
int $code = 0,
18+
?Throwable $previous = null,
19+
private string $key = ''
20+
) {
1921
parent::__construct($message, $code, $previous);
20-
$this->key = $key;
2122
}
2223

2324
public static function fromException(BaseException $e): self

src/ParameterPostProcessor.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,13 @@
1717
*/
1818
class ParameterPostProcessor
1919
{
20-
/**
21-
* @var array<string,mixed>
22-
* @psalm-var TParameters
23-
*/
24-
private array $parameters;
25-
2620
/**
2721
* @param array<string,mixed> $parameters
2822
* @psalm-param TParameters $parameters
2923
*/
30-
public function __construct(array $parameters)
31-
{
32-
$this->parameters = $parameters;
24+
public function __construct(
25+
private array $parameters
26+
) {
3327
}
3428

3529
/**

0 commit comments

Comments
 (0)