Reorganize method position inside class

For consistency with the rest of private methods in the class,
"isContainerRegistered" is moved below the only public method in which
it is used ("cleanUp").

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2017-04-10 19:10:03 +02:00
parent 03233b1d58
commit 4d71d37fe3

View file

@ -191,6 +191,21 @@ class NextcloudTestServerDockerHelper {
$this->executeDockerCommand("rm --volumes --force " . $this->containerName);
}
/**
* Returns whether the container exists (no matter its state) or not.
*
* @return boolean true if the container exists, false otherwise.
* @throws \Exception if the Docker command failed to execute.
*/
private function isContainerRegistered() {
// With the "--quiet" option "docker ps" only shows the ID of the
// matching containers, without table headers. Therefore, if the
// container does not exist the output will be empty (not even a new
// line, as the last line of output returned by "executeDockerCommand"
// does not include a trailing new line character).
return $this->executeDockerCommand("ps --all --quiet --filter 'name=" . $this->containerName . "'") !== "";
}
/**
* Returns the base URL of the Nextcloud test server.
*
@ -214,21 +229,6 @@ class NextcloudTestServerDockerHelper {
return $this->executeDockerCommand("port " . $this->containerName . " 80");
}
/**
* Returns whether the container exists (no matter its state) or not.
*
* @return boolean true if the container exists, false otherwise.
* @throws \Exception if the Docker command failed to execute.
*/
private function isContainerRegistered() {
// With the "--quiet" option "docker ps" only shows the ID of the
// matching containers, without table headers. Therefore, if the
// container does not exist the output will be empty (not even a new
// line, as the last line of output returned by "executeDockerCommand"
// does not include a trailing new line character).
return $this->executeDockerCommand("ps --all --quiet --filter 'name=" . $this->containerName . "'") !== "";
}
/**
* Executes the given Docker command.
*