Skip to content

Merge pull request #40 from phenixphp/feature/make-models-and-related… #142

Merge pull request #40 from phenixphp/feature/make-models-and-related…

Merge pull request #40 from phenixphp/feature/make-models-and-related… #142

Triggered via push December 17, 2024 20:31
Status Success
Total duration 2m 4s
Artifacts

run-tests.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

10 errors and 1 warning
test: src/Database/Models/DatabaseModel.php#L42
* [Forbidden public property] Do not use public properties. Use method access instead.
test: src/Database/Models/DatabaseModel.php#L156
* [Disallow empty] Use of empty() is disallowed.
test: src/Database/Models/DatabaseModel.php#L1
* [Ternary to null coalescing] @@ -115,3 +115,3 @@ - $value = isset($this->{$propertyName}) ? $this->{$propertyName} : null; + $value = $this->{$propertyName} ?? null; * [Having `classes` with more than 5 cyclomatic complexity is prohibited - Consider refactoring] 15 cyclomatic complexity * [Braces] @@ -195,3 +195,3 @@ - return match($attribute::class) { + return match ($attribute::class) { BelongsToAttribute::class => new BelongsToProperty(...$arguments), * [Ordered class elements] @@ -37,2 +37,4 @@ { + + public stdClass $pivot; protected string $table; @@ -41,4 +43,2 @@ - public stdClass $pivot; - /** @@ -60,4 +60,2 @@ - abstract protected static function table(): string; - public static function query(): DatabaseQueryBuilder @@ -135,2 +133,4 @@ } + + abstract protected static function table(): string;
test: src/Database/Models/DatabaseModel.php#L82
* [Return type hint] Method \Phenix\Database\Models\DatabaseModel::getRelationshipBindings() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "array<string, array<int, Relationship>>".
test: src/Database/Models/DatabaseModel.php#L109
* [Return type hint] Method \Phenix\Database\Models\DatabaseModel::toArray() does not have @return annotation for its traversable return value.
test: src/Database/Models/DatabaseModel.php#L142
* [Return type hint] Method \Phenix\Database\Models\DatabaseModel::buildPropertyBindings() does not have @return annotation for its traversable return value.
test: src/Database/Models/DatabaseModel.php#L169
* [Return type hint] Method \Phenix\Database\Models\DatabaseModel::buildRelationshipBindings() does not have @return annotation for its traversable return value.
test: src/Database/Models/DatabaseModel.php#L206
* [Line length] Line exceeds maximum limit of 120 characters; contains 126 characters
test: src/Testing/TestResponse.php#L12
* [Forbidden public property] Do not use public properties. Use method access instead.
test: src/Testing/TestResponse.php#L65
* [Parameter type hint] Method \Phenix\Testing\TestResponse::assertHeaderContains() does not have @param annotation for its traversable parameter $needles.
SonarScanner
This action is deprecated and will be removed in a future release. Please use the sonarqube-scan-action action instead. The sonarqube-scan-action is a drop-in replacement for this action.