Skip to content

Commit

Permalink
Use constructor property promotion in ConfigurationBuilder::build (#38)
Browse files Browse the repository at this point in the history
* Use constructor property promotion in ConfigurationBuilder::build

* Use constructor property promotion
  • Loading branch information
Mateodioev authored May 4, 2024
1 parent cff881f commit 46b68af
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/ConfigurationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,15 @@ public function build() : Configuration {
$this->allowedHeaders,
$this->exposableHeaders,
$this->allowCredentials) implements Configuration {
private $origins;
private $methods;
private $maxAge;
private $allowedHeaders;
private $exposableHeaders;
private $allowCredentials;

public function __construct(
array $origins,
array $methods,
?int $maxAge,
array $allowedHeaders,
array $exposableHeaders,
bool $allowCredentials
private array $origins,
private array $methods,
private ?int $maxAge,
private array $allowedHeaders,
private array $exposableHeaders,
private bool $allowCredentials
) {
$this->origins = $origins;
$this->methods = $methods;
$this->maxAge = $maxAge;
$this->allowedHeaders = $allowedHeaders;
$this->exposableHeaders = $exposableHeaders;
$this->allowCredentials = $allowCredentials;
}

/**
Expand Down

0 comments on commit 46b68af

Please sign in to comment.