Code Duplication    Length = 17-17 lines in 2 locations

NestedIntervalsBehavior.php 2 locations

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