Skip to content

Commit

Permalink
Make method public
Browse files Browse the repository at this point in the history
  • Loading branch information
oojacoboo committed Sep 13, 2020
1 parent 419cbab commit 0c24cef
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Client/ForteClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down

0 comments on commit 0c24cef

Please sign in to comment.