Skip to content

Commit 42ea548

Browse files
committed
Add single command for local tests
1 parent 07611b4 commit 42ea548

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
}
3232
},
3333
"scripts": {
34+
"actions": "composer test && composer analyse && composer check-style",
3435
"test": "phpunit",
3536
"analyse": "phpstan analyse src tests --level=9",
3637
"check-style": "phpcs -p --standard=PSR12 --exclude=Generic.Files.LineLength --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",

src/CorsService.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ class CorsService
6363
* @param CorsInputOptions $options
6464
*/
6565
public function __construct(array $options = [])
66+
{
67+
if ($options) {
68+
$this->setOptions($options);
69+
}
70+
}
71+
72+
/**
73+
* @param CorsInputOptions $options
74+
*/
75+
public function setOptions(array $options): void
6676
{
6777
$this->allowedOrigins = $options['allowedOrigins'] ?? $options['allowed_origins'] ?? $this->allowedOrigins;
6878
$this->allowedOriginsPatterns =

0 commit comments

Comments
 (0)