Define any deepness of the relationship

@param int $distance

@throws LogicException If no relationship in the path

@return self
337303
public function withAnyDistance(): self
    {
        if ($this->elements->size() < 3) {
            throw new LogicException;
        }

        $path = clone $this;
        $path->elements = $this
            ->elements
            ->dropEnd(2)
            ->add(
                $this->elements->dropEnd(1)->last()->withAnyDistance()
            )
            ->add($this->elements->last());

        return $path;
    }
1218751
public function setRelationship($relationship)
    {
        $allowedValues = $this->getRelationshipAllowableValues();
        if (!is_null($relationship) && !in_array($relationship, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'relationship', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['relationship'] = $relationship;

        return $this;
    }
853858
public function setCookie(Cookie $cookie) : parent
    {
        if ($this->headerSent($file, $line)) {
            throw new \LogicException(sprintf("Headers is already sent in '%s:%s'", $file, $line));
        }

        return parent::setCookie($cookie);
    }
360807
public function shiftedLeft(int $distance) : BigInteger
    {
        if ($distance === 0) {
            return $this;
        }

        if ($distance < 0) {
            return $this->shiftedRight(- $distance);
        }

        return $this->multipliedBy(BigInteger::of(2)->power($distance));
    }
1095223
public function make($contract)
    {
        if (empty($this->bindings[$contract])) {
            throw new \LogicException('Not found contract:' . $contract);
        }

        $class = $this->bindings[$contract];
        if ($class['type'] == 'closure') {
            return call_user_func($class['closure'], $class['class'], $class['args']);
        } else if ($class['type'] == 'singleton') {
            return $class['instance'];
        }

        throw new \LogicException('Not found contract:' . $contract);
    }
953626
public function geo_distance(string $key, $location, string $distance): GeoDistance
    {
        return new GeoDistance($key, $location, $distance);
    }
781130
private function addRelation(string $logic, $column1, ?string $operator, $column2)
    {
        $column1 = $this->prepareRow($column1);

        $column2 = $this->prepareRow($column2);

        if (is_array($column1)) {
            $this->addRowRelation($logic, $column1, $operator, (array) $column2);

            return $this;
        }

        if (!$operator) {
            $operator = is_array($column2) ? 'IN' : '=';
        }

        if ($operator === 'IN' and !is_array($column2)) {
            $operator = '=';
        }

        if ($operator !== 'IN' and is_array($column2)) {
            throw new SqlException('Second column could not be an array in relation for operator `' . $operator . '`.');
        }

        $column2 = is_array($column2) ? $this->prepareColumns($column2) : $this->dialect()->quoteName($column2);

        $sql = $this->dialect()->quoteName($column1) . ' ' . $operator . ' ' . $column2;

        $this->addCondition($logic, $sql);

        return $this;
    }
1095229
public function addRelationship(Relationship $relationship)
    {
        foreach ($this->relationships as $rel) {
            if ($rel->getType() === $relationship->getType() &&
            $rel->getStartNode() === $relationship->getStartNode() &&
            $rel->getEndNode() === $relationship->getEndNode()) {
                throw new SchemaDefinitionException(sprintf('There is already a relationship declared with TYPE "%s" and STARTNODE "%s" and ENDNODE "%s"',
                    $relationship->getType(), $relationship->getStartNode(), $relationship->getEndNode()));
            }
        }

        return $this->relationships->add($relationship);
    }
576235
public function setWidth($width)
    {
        if (!is_numeric($width)) {
            throw new \LogicException('Box width is NaN!');
        }

        $this->width = (int) $width;

        return $this;
    }
1135124
public function logicalXor(self $other){
		
		$l = \max(array($this->count(), $other->count()));
		$new = new static();
		
		for($i = 0; $i < $l; ++$i){

			if(isset($this[$i], $other[$i])){
				$new[$i] = (bool)($this[$i] ^ $other[$i]);
			}
			else{
				$new[$i] = false;
			}
			
		}
		
		return $new;
		
	}
593125
public static function createFromPath($path)
    {
        if (!is_dir($path) || !is_readable($path)) {
            throw new \LogicException(sprintf('%s does not exist or is not readable.', $path));
        }

        return static::createFromFilesystem(new Filesystem(new Local($path)));
    }
155644
public function parents(array $parents): self
    {
        if ($parents === []) {
            return $this;
        }

        $data = [];

        foreach ($parents as $parent) {
            if (!isset($this->preparedGroups[$parent])) {
                throw new \LogicException(sprintf(
                    'Unable to find parent group: %s for route group: %s',
                    $parent,
                    $this->group
                ));
            }

            $data[] = $this->preparedGroups[$parent];
        }

        $old = $this->options->dump();
        $data = Arr::mergeRecursive(...$data);

        $this->options->bind($data);
        $this->options->bind($old);

        return $this;
    }
789189
public function remove() {
		$p = $this->getParent();
		if (null == $p) {
			throw new LogicException();
		}
		$p->removeChildAt( $this->getChildIndex() );
		return $this;
	}
60223
public function create()
    {
        if ($this->rootPath === null) {
            throw new \LogicException('Root path must be set before PathResolver can be created');
        }

        return new PathResolver($this->rootPath, $this->paths);
    }
327322
public function through(
        string $variable = null,
        string $type = null,
        string $direction = 'BOTH'
    ): self {
        if ($this->elements->size() < 3) {
            throw new LogicException;
        }

        $direction = \strtolower($direction);

        $path = new self;
        $path->elements = $this
            ->elements
            ->dropEnd(2)
            ->add(Relationship::$direction($variable, $type))
            ->add($this->elements->last());
        $path->lastOperation = Relationship::class;

        return $path;
    }
855086
public function with($relationship)
    {
        $this->_with[] = $relationship;

        if (!in_array('relate', $this->after_get))
        {
            $this->after_get[] = 'relate';
        }

        return $this;
    }
413192
public function setStatus(int $code) : self
    {
        if ($this->headerSent($file, $line)) {
            throw new \LogicException(sprintf("Headers is already sent in '%s:%s'", $file, $line));
        }

        $this->statusCode = $code;

        return $this;
    }