Page MenuHomeDevCentral

D1328.id3407.diff
No OneTemporary

D1328.id3407.diff

diff --git a/traits/assertHttp.php b/traits/assertHttp.php
--- a/traits/assertHttp.php
+++ b/traits/assertHttp.php
@@ -8,18 +8,17 @@
* @param string $url the URL to check
* @param string $comment the comment to output if the test fails [facultative]
*/
- private function assertHttpResponseCode ($expectedCode, $url, $comment = '') {
+ private function assertHttpResponseCode ($expectedCode, $url, $comment = '') : void {
$actualCode = $this->getHttpResponseCode($url);
- return $this->assertEquals($expectedCode, $actualCode, $comment);
+ $this->assertEquals($expectedCode, $actualCode, $comment);
}
/**
* Gets the HTTP response code of the specified URL
*
* @param string $url
- * @return int the HTTP response code
*/
- private function getHttpResponseCode ($url) {
+ private function getHttpResponseCode ($url) : int {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, "Nasqueron-Ops-Tests");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
diff --git a/utils/DockerContainer.php b/utils/DockerContainer.php
--- a/utils/DockerContainer.php
+++ b/utils/DockerContainer.php
@@ -24,19 +24,15 @@
/**
* Determines if a hostname is valid
- *
- * @return bool true if the specified name is valid; otherwise, false
*/
- public static function isValidHostname ($host) {
+ public static function isValidHostname ($host) : bool {
return (bool)preg_match('/^[A-Za-z0-9\-\.]+$/', $host);
}
/**
* Determines if a container name is valid
- *
- * @return bool true if the specified name is valid; otherwise, false
*/
- public static function isValidContainerName ($name) {
+ public static function isValidContainerName ($name) : bool {
//Source: https://github.com/ajhager/docker/commit/f63cdf0260cf6287d28a589a79d3f947def6a569
return (bool)preg_match('@^/?[a-zA-Z0-9_-]+$@', $name);
}
@@ -45,9 +41,8 @@
* Executes the specified command in the container
*
* @param string $command the command to run
- * @return string the command output
*/
- public function exec ($command) {
+ public function exec ($command) : string {
$output = `ssh $this->host docker exec $this->container $command`;
return trim($output);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 12:28 (22 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249361
Default Alt Text
D1328.id3407.diff (2 KB)

Event Timeline