From 46b68af9bbf988ab82a341ae4fc8bd982c70da8a Mon Sep 17 00:00:00 2001 From: Mateo O <68271130+Mateodioev@users.noreply.github.com> Date: Sat, 4 May 2024 07:40:53 -0500 Subject: [PATCH] Use constructor property promotion in ConfigurationBuilder::build (#38) * Use constructor property promotion in ConfigurationBuilder::build * Use constructor property promotion --- src/ConfigurationBuilder.php | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/ConfigurationBuilder.php b/src/ConfigurationBuilder.php index f13feac..d9b61bb 100644 --- a/src/ConfigurationBuilder.php +++ b/src/ConfigurationBuilder.php @@ -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; } /**