Skip to content

Commit

Permalink
Merge pull request #31 from samsonasik/apply-php80
Browse files Browse the repository at this point in the history
Apply PHP 8.0 Syntax and constructor promotion
  • Loading branch information
Ocramius committed Oct 11, 2022
2 parents af19dce + 050ce42 commit 57a68c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
11 changes: 6 additions & 5 deletions src/ParameterNotFoundException.php
Expand Up @@ -12,12 +12,13 @@

class ParameterNotFoundException extends InvalidArgumentException
{
private string $key;

public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null, string $key = '')
{
public function __construct(
string $message = "",
int $code = 0,
?Throwable $previous = null,
private string $key = ''
) {
parent::__construct($message, $code, $previous);
$this->key = $key;
}

public static function fromException(BaseException $e): self
Expand Down
12 changes: 3 additions & 9 deletions src/ParameterPostProcessor.php
Expand Up @@ -17,19 +17,13 @@
*/
class ParameterPostProcessor
{
/**
* @var array<string,mixed>
* @psalm-var TParameters
*/
private array $parameters;

/**
* @param array<string,mixed> $parameters
* @psalm-param TParameters $parameters
*/
public function __construct(array $parameters)
{
$this->parameters = $parameters;
public function __construct(
private array $parameters
) {
}

/**
Expand Down

0 comments on commit 57a68c2

Please sign in to comment.