Code Duplication    Length = 17-17 lines in 2 locations

NestedIntervalsBehavior.php 2 locations

@@ 1038-1054 (lines=17) @@
1035
     * @param int $right
1036
     * @return array|null
1037
     */
1038
    protected function findInsertBeforeRange(&$left, &$right)
1039
    {
1040
        $result = null;
1041
        $right = $this->node->getAttribute($this->leftAttribute);
1042
        $left  = $this->getNodeBehavior()->getPrev()
1043
            ->select($this->rightAttribute)
1044
            ->scalar();
1045
        if ($left === false) {
1046
            $result = $this->getNodeBehavior()->getParent()
1047
                ->select([$this->leftAttribute, $this->rightAttribute])
1048
                ->createCommand()
1049
                ->queryOne();
1050
            $left = $result[$this->leftAttribute];
1051
        }
1052
        $left = (int)$left;
1053
        return $result;
1054
    }
1055
1056
    /**
1057
     * @param int $left
@@ 1061-1077 (lines=17) @@
1058
     * @param int $right
1059
     * @return array|null
1060
     */
1061
    protected function findInsertAfterRange(&$left, &$right)
1062
    {
1063
        $result = null;
1064
        $left  = $this->node->getAttribute($this->rightAttribute);
1065
        $right = $this->getNodeBehavior()->getNext()
1066
            ->select($this->leftAttribute)
1067
            ->scalar();
1068
        if ($right === false) {
1069
            $result = $this->getNodeBehavior()->getParent()
1070
                ->select([$this->leftAttribute, $this->rightAttribute])
1071
                ->createCommand()
1072
                ->queryOne();
1073
            $right = $result[$this->rightAttribute];
1074
        }
1075
        $right = (int)$right;
1076
        return $result;
1077
    }
1078
1079
    /**
1080
     * @param int $value