public function replace($needle, $replacement): Pipeline
	{
		$stages = [];
		$found  = false;
		foreach ($this->stages as $stage) {
			if ($this->matches($stage, $needle)) {
				$stages[] = $replacement;
				$found    = true;
				continue;
			}

			$stages[] = $stage;
		}

		if ($found) {
			$pipeline         = clone $this;
			$pipeline->stages = $stages;

			return $pipeline;
		}

		unset($stages);

		return $this;
	}