docs: Add notes on transaction handling in appendTo, insertAfter,…
#215
Annotations
6 warnings
|
mutation / PHP 8.4-ubuntu-latest:
src/NestedSetsBehavior.php#L1137
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
@@ @@
$ownerRightValue = $this->getRightValue();
$subtreeSize = $ownerRightValue - $ownerLeftValue + 1;
$this->shiftLeftRightAttribute($context->targetPositionValue, $subtreeSize);
- if ($ownerLeftValue >= $context->targetPositionValue) {
+ if ($ownerLeftValue > $context->targetPositionValue) {
$ownerLeftValue += $subtreeSize;
$ownerRightValue += $subtreeSize;
}
|
|
mutation / PHP 8.4-ubuntu-latest:
src/NestedSetsBehavior.php#L1109
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
}
$condition = QueryConditionBuilder::createRangeCondition($this->leftAttribute, $this->getLeftValue(), $this->rightAttribute, $this->getRightValue(), $this->treeAttribute, $this->getTreeValue($this->getOwner()));
$result = $this->getOwner()::deleteAll($condition);
- $this->getOwner()->setOldAttributes(null);
+
$this->getOwner()->afterDelete();
return $result;
}
|
|
mutation / PHP 8.4-ubuntu-latest:
src/NestedSetsBehavior.php#L930
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
public function parents(int|null $depth = null): ActiveQuery
{
$condition = QueryConditionBuilder::createParentsCondition($this->leftAttribute, $this->getLeftValue(), $this->rightAttribute, $this->getRightValue(), $this->treeAttribute, $this->getTreeValue($this->getOwner()), $depth !== null ? $this->depthAttribute : null, $depth !== null ? $this->getDepthValue() : null, $depth);
- return $this->getOwner()::find()->andWhere($condition)->addOrderBy([$this->leftAttribute => SORT_ASC]);
+ return $this->getOwner()::find()->andWhere($condition)->addOrderBy([]);
}
/**
* Inserts the current node as the first child of the specified target node or moves it if it already exists.
|
|
mutation / PHP 8.4-ubuntu-latest:
src/NestedSetsBehavior.php#L790
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
public function leaves(): ActiveQuery
{
$condition = QueryConditionBuilder::createLeavesCondition($this->leftAttribute, $this->rightAttribute, $this->treeAttribute, $this->getTreeValue($this->getOwner()), $this->getLeftValue(), $this->getRightValue());
- return $this->getOwner()::find()->andWhere($condition)->addOrderBy([$this->leftAttribute => SORT_ASC]);
+ return $this->getOwner()::find()->andWhere($condition)->addOrderBy([]);
}
/**
* Creates the root node if the active record is new, or moves it as the root node in the nested set tree.
|
|
mutation / PHP 8.4-ubuntu-latest:
src/NestedSetsBehavior.php#L692
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
@@ @@
{
$nodeLeft = $node->getAttribute($this->leftAttribute);
$nodeRight = $node->getAttribute($this->rightAttribute);
- if ($this->getLeftValue() <= $nodeLeft || $this->getRightValue() >= $nodeRight) {
+ if ($this->getLeftValue() <= $nodeLeft || $this->getRightValue() > $nodeRight) {
return false;
}
if ($this->treeAttribute !== false) {
|
|
mutation / PHP 8.4-ubuntu-latest:
src/NestedSetsBehavior.php#L692
Escaped Mutant for Mutator "LessThanOrEqualTo":
@@ @@
{
$nodeLeft = $node->getAttribute($this->leftAttribute);
$nodeRight = $node->getAttribute($this->rightAttribute);
- if ($this->getLeftValue() <= $nodeLeft || $this->getRightValue() >= $nodeRight) {
+ if ($this->getLeftValue() < $nodeLeft || $this->getRightValue() >= $nodeRight) {
return false;
}
if ($this->treeAttribute !== false) {
|