Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3748742
D1328.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D1328.diff
View Options
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);
}
@@ -47,7 +43,7 @@
* @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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 10:29 (21 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249198
Default Alt Text
D1328.diff (2 KB)
Attached To
Mode
D1328: Add PHP 7. 1 type hinting
Attached
Detach File
Event Timeline
Log In to Comment