Skip to content

implement the interface ArrayableInterface for BaseActiveRecord #771

implement the interface ArrayableInterface for BaseActiveRecord

implement the interface ArrayableInterface for BaseActiveRecord #771

Triggered via pull request December 11, 2023 03:48
@niqingyangniqingyang
synchronize #273
master
Status Success
Total duration 21m 33s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation
Fit to window
Zoom out
Zoom in

Annotations

4 warnings
PHP 8-ubuntu-latest: src/ActiveRelationTrait.php#L368
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ */ private function populateInverseRelation(array &$primaryModels, array $models, string $primaryName, string $name) : void { - if (empty($models) || empty($primaryModels)) { + if (empty($models) && empty($primaryModels)) { return; } $model = reset($models);
PHP 8-ubuntu-latest: src/ActiveRelationTrait.php#L387
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ if ($model instanceof ActiveRecordInterface) { foreach ($models as $model) { $key = $this->getModelKey($model, $relation->getLink()); - if ($model instanceof ActiveRecordInterface) { + if (true) { $model->populateRelation($name, $buckets[$key] ?? []); } }
PHP 8-ubuntu-latest: src/BaseActiveRecordTrait.php#L79
Escaped Mutant for Mutator "UnwrapUcFirst": --- Original +++ New @@ @@ /** read property, e.g. getName() */ return $this->{$getter}(); } - if (method_exists($this, 'set' . ucfirst($name))) { + if (method_exists($this, 'set' . $name)) { throw new InvalidCallException('Getting write-only property: ' . static::class . '::' . $name); } throw new UnknownPropertyException('Getting unknown property: ' . static::class . '::' . $name);
PHP 8-ubuntu-latest: src/BaseActiveRecordTrait.php#L83
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ if (method_exists($this, 'set' . ucfirst($name))) { throw new InvalidCallException('Getting write-only property: ' . static::class . '::' . $name); } - throw new UnknownPropertyException('Getting unknown property: ' . static::class . '::' . $name); + throw new UnknownPropertyException(static::class . '::' . $name); } /** * Returns the relation object with the specified name.