Skip to content

Do not catch an Exception in isset() of magic properties #783

Do not catch an Exception in isset() of magic properties

Do not catch an Exception in isset() of magic properties #783

Triggered via push December 14, 2023 05:46
Status Success
Total duration 17m 36s
Artifacts

mutation.yml

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

Annotations

6 warnings
PHP 8-ubuntu-latest: src/ActiveRelationTrait.php#L253
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ if ($this->via instanceof self) { $viaQuery = $this->via; $viaModels = $viaQuery->findJunctionRows($primaryModels); - $this->filterByModels($viaModels); + } elseif (is_array($this->via)) { [$viaName, $viaQuery] = $this->via; if ($viaQuery->asArray === null) {
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#L374
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ return; } $model = reset($models); - if ($model instanceof ActiveRecordInterface) { + if (false) { /** @var ActiveQuery $relation */ $relation = $model->getRelation($name); } else {
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#L298
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ */ public function hasProperty(string $name, bool $checkVars = true) : bool { - return $this->canGetProperty($name, $checkVars) || $this->canSetProperty($name, false); + return $this->canGetProperty($name, $checkVars) && $this->canSetProperty($name, false); } public function canGetProperty(string $name, bool $checkVars = true) : bool {
PHP 8-ubuntu-latest: src/BaseActiveRecordTrait.php#L304
Escaped Mutant for Mutator "UnwrapUcFirst": --- Original +++ New @@ @@ } public function canGetProperty(string $name, bool $checkVars = true) : bool { - if (method_exists($this, 'get' . ucfirst($name)) || $checkVars && property_exists($this, $name)) { + if (method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name)) { return true; } try {