From 9aa53a5d6b590e957d73cedb3ccd59919cb40c5b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 14 Dec 2021 19:33:47 -0800 Subject: [PATCH] Civi::pipe - Rename maxLines to bufferSize --- Civi/Pipe/LineSessionTrait.php | 14 +++++++------- Civi/Pipe/PublicMethods.php | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Civi/Pipe/LineSessionTrait.php b/Civi/Pipe/LineSessionTrait.php index f7ba82ef32..97828f8298 100644 --- a/Civi/Pipe/LineSessionTrait.php +++ b/Civi/Pipe/LineSessionTrait.php @@ -87,7 +87,7 @@ trait LineSessionTrait { * * @var int */ - protected $maxLine = 524288; + protected $bufferSize = 524288; /** * A value to display immediately before the response lines. @@ -114,7 +114,7 @@ trait LineSessionTrait { public function run() { $this->write($this->onConnect()); - while (FALSE !== ($line = stream_get_line($this->input, $this->maxLine, $this->delimiter))) { + while (FALSE !== ($line = stream_get_line($this->input, $this->bufferSize, $this->delimiter))) { $line = rtrim($line, $this->delimiter); if (empty($line)) { continue; @@ -133,16 +133,16 @@ trait LineSessionTrait { /** * @return int */ - public function getMaxLine(): int { - return $this->maxLine; + public function getBufferSize(): int { + return $this->bufferSize; } /** - * @param int $maxLine + * @param int $bufferSize * @return $this */ - public function setMaxLine(int $maxLine) { - $this->maxLine = $maxLine; + public function setBufferSize(int $bufferSize) { + $this->bufferSize = $bufferSize; return $this; } diff --git a/Civi/Pipe/PublicMethods.php b/Civi/Pipe/PublicMethods.php index 9a9d844cf9..700475b5f0 100644 --- a/Civi/Pipe/PublicMethods.php +++ b/Civi/Pipe/PublicMethods.php @@ -99,16 +99,16 @@ class PublicMethods { * Set ephemeral session options. * * @param $session - * @param array{maxLines: int, responsePrefix: int} $request + * @param array{bufferSize: int, responsePrefix: int} $request * Any updates to perform. May be empty/omitted. - * @return array{maxLines: int, responsePrefix: int} + * @return array{bufferSize: int, responsePrefix: int} * List of updated options. * If the list of updates was empty, then return all options. */ public function options($session, $request) { $storageMap = [ 'apiError' => $this, - 'maxLine' => $session, + 'bufferSize' => $session, 'responsePrefix' => $session, ]; -- 2.25.1