From 25804d7a137698e94f4bfbde13d1e24f3738234f Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 14 Dec 2021 21:13:48 -0800 Subject: [PATCH] (REF) Civi::pipe - Rename JsonRpcSession to PipeSession Not supporting multiple session types --- Civi/Core/Container.php | 2 +- Civi/Pipe/{JsonRpcSession.php => PipeSession.php} | 2 +- Civi/Pipe/PublicMethods.php | 10 +++++----- tests/phpunit/Civi/Pipe/JsonRpcSessionTest.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename Civi/Pipe/{JsonRpcSession.php => PipeSession.php} (98%) diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index a967a13e17..daee0396cb 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -263,7 +263,7 @@ class Container { $container->setAlias('cache.short', 'cache.default')->setPublic(TRUE); $container->setDefinition('pipe.jsonrpc20', new Definition( - 'Civi\Pipe\JsonRpcSession', + 'Civi\Pipe\PipeSession', [] ))->setPublic(TRUE); diff --git a/Civi/Pipe/JsonRpcSession.php b/Civi/Pipe/PipeSession.php similarity index 98% rename from Civi/Pipe/JsonRpcSession.php rename to Civi/Pipe/PipeSession.php index 681c8cfa2e..68d833b4ec 100644 --- a/Civi/Pipe/JsonRpcSession.php +++ b/Civi/Pipe/PipeSession.php @@ -11,7 +11,7 @@ namespace Civi\Pipe; -class JsonRpcSession { +class PipeSession { use LineSessionTrait; diff --git a/Civi/Pipe/PublicMethods.php b/Civi/Pipe/PublicMethods.php index 700475b5f0..4f49eb0cbe 100644 --- a/Civi/Pipe/PublicMethods.php +++ b/Civi/Pipe/PublicMethods.php @@ -28,7 +28,7 @@ class PublicMethods { /** * Send a request to APIv3. * - * @param $session + * @param \Civi\Pipe\PipeSession $session * @param array $request * Tuple: [$entity, $action, $params] * @return array|\Civi\Api4\Generic\Result|int @@ -50,7 +50,7 @@ class PublicMethods { /** * Send a request to APIv4. * - * @param $session + * @param \Civi\Pipe\PipeSession $session * @param array $request * Tuple: [$entity, $action, $params] * @return array|\Civi\Api4\Generic\Result|int @@ -72,7 +72,7 @@ class PublicMethods { /** * Simple test; send/receive a fragment of data. * - * @param $session + * @param \Civi\Pipe\PipeSession $session * @param mixed $request * @return mixed */ @@ -83,7 +83,7 @@ class PublicMethods { /** * Set active user. * - * @param $session + * @param \Civi\Pipe\PipeSession $session * @param array{contactId: int, userId: int, user: string} $request * @return array|\Civi\Api4\Generic\Result|int */ @@ -98,7 +98,7 @@ class PublicMethods { /** * Set ephemeral session options. * - * @param $session + * @param \Civi\Pipe\PipeSession $session * @param array{bufferSize: int, responsePrefix: int} $request * Any updates to perform. May be empty/omitted. * @return array{bufferSize: int, responsePrefix: int} diff --git a/tests/phpunit/Civi/Pipe/JsonRpcSessionTest.php b/tests/phpunit/Civi/Pipe/JsonRpcSessionTest.php index 51add84143..f1b01d7bd6 100644 --- a/tests/phpunit/Civi/Pipe/JsonRpcSessionTest.php +++ b/tests/phpunit/Civi/Pipe/JsonRpcSessionTest.php @@ -25,7 +25,7 @@ class JsonRpcSessionTest extends \CiviUnitTestCase { parent::setUp(); $this->input = fopen('php://memory', 'w'); $this->output = fopen('php://memory', 'w'); - $this->server = new JsonRpcSession($this->input, $this->output); + $this->server = new PipeSession($this->input, $this->output); } protected function tearDown(): void { -- 2.25.1