From 0c24cef452988c96c9cd9356ef51380d0180f618 Mon Sep 17 00:00:00 2001 From: Jacob Thomason Date: Sat, 12 Sep 2020 23:38:33 -0400 Subject: [PATCH] Make method public --- src/Client/ForteClient.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Client/ForteClient.php b/src/Client/ForteClient.php index 06318fd..32d7936 100644 --- a/src/Client/ForteClient.php +++ b/src/Client/ForteClient.php @@ -68,30 +68,30 @@ protected function getForteEnvironment(string $name): ForteEnvironment /** - * Sets the current environment to be used + * Gets a given environment by name */ - protected function setCurrentForteEnvironment(string $name): self + protected function getCurrentForteEnvironment(): ForteEnvironment { - if (!isset($this->environments[$name])) { - throw new LibraryGenericException('Cannot find forte environment with name `' . $name . '`'); + if ($this->currentEnvironment === null) { + throw new LibraryGenericException('Current Forte environemnt has not been set'); } - $this->currentEnvironment = $this->environments[$name]; - - return $this; + return $this->currentEnvironment; } /** - * Gets a given environment by name + * Sets the current environment to be used */ - protected function getCurrentForteEnvironment(): ForteEnvironment + public function setCurrentForteEnvironment(string $name): self { - if ($this->currentEnvironment === null) { - throw new LibraryGenericException('Current Forte environemnt has not been set'); + if (!isset($this->environments[$name])) { + throw new LibraryGenericException('Cannot find forte environment with name `' . $name . '`'); } - return $this->currentEnvironment; + $this->currentEnvironment = $this->environments[$name]; + + return $this; }