Skip to content

[sonoff-connector] Refactoring sonoff process (#185) #255

[sonoff-connector] Refactoring sonoff process (#185)

[sonoff-connector] Refactoring sonoff process (#185) #255

Triggered via push November 23, 2023 10:46
Status Success
Total duration 2m 24s
Artifacts

ci.yaml

on: push
Matrix: Code quality assurance
Matrix: Code static analysis
Matrix: Code linting
Matrix: Test for mutants
Matrix: Code tests
Matrix: Code tests with code coverage
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L63
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L65
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(true)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L69
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(7999), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L69
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8001), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L74
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(true), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L78
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L85
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(false), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L87
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function getConfigSchema() : Schema\Schema { - return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Content-Type', 'Authorization', 'X-Requested-With'])])])]); + return Schema\Expect::structure(['static' => Schema\Expect::structure(['publicRoot' => Schema\Expect::string(null)->nullable(), 'enabled' => Schema\Expect::bool(false)]), 'server' => Schema\Expect::structure(['address' => Schema\Expect::string('127.0.0.1'), 'port' => Schema\Expect::int(8000), 'certificate' => Schema\Expect::string()->nullable()]), 'cors' => Schema\Expect::structure(['enabled' => Schema\Expect::bool(false), 'allow' => Schema\Expect::structure(['origin' => Schema\Expect::string('*'), 'methods' => Schema\Expect::arrayOf('string')->default([RequestMethodInterface::METHOD_GET, RequestMethodInterface::METHOD_POST, RequestMethodInterface::METHOD_PATCH, RequestMethodInterface::METHOD_DELETE, RequestMethodInterface::METHOD_OPTIONS]), 'credentials' => Schema\Expect::bool(true), 'headers' => Schema\Expect::arrayOf('string')->default(['Authorization', 'X-Requested-With'])])])]); } public function loadConfiguration() : void {
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L114
Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ assert($configuration instanceof stdClass); $builder->addDefinition($this->prefix('routing.responseFactory'), new DI\Definitions\ServiceDefinition())->setType(Http\ResponseFactory::class); $builder->addDefinition($this->prefix('routing.router'), new DI\Definitions\ServiceDefinition())->setType(Router\Router::class); - $builder->addDefinition($this->prefix('commands.server'), new DI\Definitions\ServiceDefinition())->setType(Commands\HttpServer::class)->setArguments(['serverAddress' => $configuration->server->address, 'serverPort' => $configuration->server->port, 'serverCertificate' => $configuration->server->certificate]); + $builder->addDefinition($this->prefix('commands.server'), new DI\Definitions\ServiceDefinition())->setType(Commands\HttpServer::class)->setArguments(['serverAddress' => $configuration->server->address, 'serverPort' => $configuration->server->port, 'serverCertificate' > $configuration->server->certificate]); $builder->addDefinition($this->prefix('middlewares.cors'), new DI\Definitions\ServiceDefinition())->setType(Middleware\Cors::class)->setArguments(['enabled' => $configuration->cors->enabled, 'allowOrigin' => $configuration->cors->allow->origin, 'allowMethods' => $configuration->cors->allow->methods, 'allowCredentials' => $configuration->cors->allow->credentials, 'allowHeaders' => $configuration->cors->allow->headers]); $builder->addDefinition($this->prefix('middlewares.staticFiles'), new DI\Definitions\ServiceDefinition())->setType(Middleware\StaticFiles::class)->setArgument('publicRoot', $configuration->static->publicRoot)->setArgument('enabled', $configuration->static->enabled); $builder->addDefinition($this->prefix('middlewares.router'), new DI\Definitions\ServiceDefinition())->setType(Middleware\Router::class);
Test for mutants (8.2, ubuntu-latest): src/DI/WebServerExtension.php#L120
Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ $builder->addDefinition($this->prefix('routing.responseFactory'), new DI\Definitions\ServiceDefinition())->setType(Http\ResponseFactory::class); $builder->addDefinition($this->prefix('routing.router'), new DI\Definitions\ServiceDefinition())->setType(Router\Router::class); $builder->addDefinition($this->prefix('commands.server'), new DI\Definitions\ServiceDefinition())->setType(Commands\HttpServer::class)->setArguments(['serverAddress' => $configuration->server->address, 'serverPort' => $configuration->server->port, 'serverCertificate' => $configuration->server->certificate]); - $builder->addDefinition($this->prefix('middlewares.cors'), new DI\Definitions\ServiceDefinition())->setType(Middleware\Cors::class)->setArguments(['enabled' => $configuration->cors->enabled, 'allowOrigin' => $configuration->cors->allow->origin, 'allowMethods' => $configuration->cors->allow->methods, 'allowCredentials' => $configuration->cors->allow->credentials, 'allowHeaders' => $configuration->cors->allow->headers]); + $builder->addDefinition($this->prefix('middlewares.cors'), new DI\Definitions\ServiceDefinition())->setType(Middleware\Cors::class)->setArguments(['enabled' > $configuration->cors->enabled, 'allowOrigin' => $configuration->cors->allow->origin, 'allowMethods' => $configuration->cors->allow->methods, 'allowCredentials' => $configuration->cors->allow->credentials, 'allowHeaders' => $configuration->cors->allow->headers]); $builder->addDefinition($this->prefix('middlewares.staticFiles'), new DI\Definitions\ServiceDefinition())->setType(Middleware\StaticFiles::class)->setArgument('publicRoot', $configuration->static->publicRoot)->setArgument('enabled', $configuration->static->enabled); $builder->addDefinition($this->prefix('middlewares.router'), new DI\Definitions\ServiceDefinition())->setType(Middleware\Router::class); $builder->addDefinition($this->prefix('application.classic'), new DI\Definitions\ServiceDefinition())->setType(Application\Application::class);