Skip to content

Commit 9b0ad81

Browse files
committed
add more return type declare
1 parent 9e790a0 commit 9b0ad81

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Cli.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Cli
113113
* @param string|int|array $style
114114
* @return string
115115
*/
116-
public static function color($text, $style = null)
116+
public static function color($text, $style = null): string
117117
{
118118
if (!$text) {
119119
return $text;
@@ -173,7 +173,7 @@ public static function renderColor($text)
173173
* @param string $text
174174
* @return string
175175
*/
176-
public static function clearColor($text)
176+
public static function clearColor($text): string
177177
{
178178
// return preg_replace('/\033\[(?:\d;?)+m/', '' , "\033[0;36mtext\033[0m");
179179
return preg_replace('/\033\[(?:\d;?)+m/', '', strip_tags($text));
@@ -252,7 +252,7 @@ public static function stderr($message, $nl = true, $quit = -200)
252252
* \Symfony\Component\Console\Output\OutputStream.
253253
* @return boolean
254254
*/
255-
public static function isSupportColor()
255+
public static function isSupportColor(): bool
256256
{
257257
return SysEnv::isSupportColor();
258258
}
@@ -271,7 +271,7 @@ public static function isSupportColor()
271271
* @param bool $mergeOpts
272272
* @return array
273273
*/
274-
public static function parseArgv(array $noValues = [], $mergeOpts = false)
274+
public static function parseArgv(array $noValues = [], $mergeOpts = false): array
275275
{
276276
$params = $GLOBALS['argv'];
277277
reset($params);

src/Sys.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static function exec($command, $logfile = null, $user = null)
6767
* @param bool $returnStatus
6868
* @return array
6969
*/
70-
public static function runCommand($command, $returnStatus = true)
70+
public static function runCommand($command, $returnStatus = true): array
7171
{
7272
$return_var = 1;
7373

src/SysEnv.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public static function isRoot(): bool
7575
/**
7676
* @return string
7777
*/
78-
public static function getHostname()
78+
public static function getHostname(): string
7979
{
8080
return php_uname('n');
8181
}
8282

8383
/**
8484
* @return string
8585
*/
86-
public static function getNullDevice()
86+
public static function getNullDevice(): string
8787
{
8888
if (self::isUnix()) {
8989
return '/dev/null';
@@ -98,7 +98,7 @@ public static function getNullDevice()
9898
* \Symfony\Component\Console\Output\OutputStream.
9999
* @return boolean
100100
*/
101-
public static function isSupportColor()
101+
public static function isSupportColor(): bool
102102
{
103103
if (DIRECTORY_SEPARATOR === '\\') {
104104
return
@@ -121,7 +121,7 @@ public static function isSupportColor()
121121
* @param int|resource $fileDescriptor
122122
* @return boolean
123123
*/
124-
public static function isInteractive($fileDescriptor)
124+
public static function isInteractive($fileDescriptor): bool
125125
{
126126
return \function_exists('posix_isatty') && @posix_isatty($fileDescriptor);
127127
}

0 commit comments

Comments
 (0)