Merge pull request #41 from phenixphp/feature/add-model-api #149
Annotations
10 errors and 1 warning
test:
src/Database/Models/DatabaseModel.php#L43
* [Forbidden public property] Do not use public properties. Use method access instead.
|
test:
src/Database/Models/DatabaseModel.php#L234
* [Disallow empty] Use of empty() is disallowed.
|
test:
src/Database/Models/DatabaseModel.php#L1
* [Ternary to null coalescing] @@ -158,3 +158,3 @@
- $value = isset($this->{$propertyName}) ? $this->{$propertyName} : null;
+ $value = $this->{$propertyName} ?? null;
* [Having `classes` with more than 5 cyclomatic complexity is prohibited - Consider refactoring] 22 cyclomatic complexity
* [Braces] @@ -273,3 +273,3 @@
- return match($attribute::class) {
+ return match ($attribute::class) {
BelongsToAttribute::class => new BelongsToProperty(...$arguments),
* [No extra blank lines] @@ -330,3 +330,2 @@
-
return $data;
* [Ordered class elements] @@ -38,2 +38,4 @@
{
+
+ public stdClass $pivot;
protected string $table;
@@ -42,4 +44,2 @@
- public stdClass $pivot;
-
/**
@@ -61,4 +61,2 @@
- abstract protected static function table(): string;
-
public static function query(): DatabaseQueryBuilder
@@ -213,2 +211,4 @@
}
+
+ abstract protected static function table(): string;
|
test:
src/Database/Models/DatabaseModel.php#L308
* [Disallow mixed type hint] Usage of "mixed" type hint is disallowed.
|
test:
src/Database/Models/DatabaseModel.php#L73
* [Parameter type hint] @param annotation of method \Phenix\Database\Models\DatabaseModel::create() does not specify type hint for items of its traversable parameter $attributes.
|
test:
src/Database/Models/DatabaseModel.php#L98
* [Parameter type hint] Method \Phenix\Database\Models\DatabaseModel::find() has useless @param annotation for parameter $id.
|
test:
src/Database/Models/DatabaseModel.php#L99
* [Parameter type hint] @param annotation of method \Phenix\Database\Models\DatabaseModel::find() does not specify type hint for items of its traversable parameter $columns.
|
test:
src/Database/Models/DatabaseModel.php#L152
* [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#L220
* [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#L247
* [Return type hint] Method \Phenix\Database\Models\DatabaseModel::buildRelationshipBindings() does not have @return annotation for its traversable return value.
|
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.
|