From c294cca060b7ba8b4b161bf33df76a344e0b8796 Mon Sep 17 00:00:00 2001 From: inhere Date: Mon, 26 Jul 2021 00:01:25 +0800 Subject: [PATCH] style(all): format all codes Signed-off-by: inhere --- src/Proc/ProcessUtil.php | 38 +++++++++++----------- src/Proc/Signal.php | 66 +++++++++++++++++++------------------- src/Traits/PhpEnvTrait.php | 6 ++-- src/Util/PhpError.php | 20 ++++++------ src/Util/PhpException.php | 26 +++++++-------- 5 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/Proc/ProcessUtil.php b/src/Proc/ProcessUtil.php index 84033d6..1174002 100644 --- a/src/Proc/ProcessUtil.php +++ b/src/Proc/ProcessUtil.php @@ -12,33 +12,33 @@ use Closure; use RuntimeException; use Toolkit\Stdlib\OS; -use function pcntl_fork; -use function pcntl_waitpid; -use function pcntl_wexitstatus; use function array_merge; -use function posix_kill; -use function time; -use function usleep; +use function cli_set_process_title; +use function error_get_last; +use function file_exists; +use function file_get_contents; +use function function_exists; +use function getmypid; +use function pcntl_alarm; +use function pcntl_async_signals; +use function pcntl_fork; use function pcntl_signal; use function pcntl_signal_dispatch; use function pcntl_signal_get_handler; -use function pcntl_async_signals; +use function pcntl_waitpid; +use function pcntl_wexitstatus; +use function posix_geteuid; +use function posix_getgrnam; use function posix_getpid; -use function getmypid; -use function file_exists; -use function file_get_contents; -use function unlink; +use function posix_getpwnam; use function posix_getpwuid; use function posix_getuid; -use function pcntl_alarm; -use function cli_set_process_title; -use function error_get_last; -use function posix_getpwnam; -use function posix_getgrnam; +use function posix_kill; use function posix_setgid; use function posix_setuid; -use function posix_geteuid; -use function function_exists; +use function time; +use function unlink; +use function usleep; use const DIRECTORY_SEPARATOR; use const PHP_OS; @@ -94,7 +94,7 @@ public static function isPtySupported(): bool return $result = false; } - return $result = (bool) @proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes); + return $result = (bool)@proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes); } /********************************************************************** diff --git a/src/Proc/Signal.php b/src/Proc/Signal.php index da8c058..fa87d5a 100644 --- a/src/Proc/Signal.php +++ b/src/Proc/Signal.php @@ -23,73 +23,73 @@ final class Signal public const ERR = -1; - public const HUP = 1; + public const HUP = 1; - public const INT = 2; // Ctrl+C + public const INT = 2; // Ctrl+C - public const QUIT = 3; + public const QUIT = 3; - public const ILL = 4; + public const ILL = 4; - public const TRAP = 5; + public const TRAP = 5; - public const ABRT = 6; + public const ABRT = 6; - public const IOT = 6; + public const IOT = 6; - public const BUS = 7; + public const BUS = 7; - public const FPE = 8; + public const FPE = 8; - public const KILL = 9; + public const KILL = 9; - public const USR1 = 10; + public const USR1 = 10; - public const SEGV = 11; + public const SEGV = 11; - public const USR2 = 12; + public const USR2 = 12; - public const PIPE = 13; + public const PIPE = 13; - public const ALRM = 14; + public const ALRM = 14; - public const TERM = 15; + public const TERM = 15; public const STKFLT = 16; - public const CLD = 17; + public const CLD = 17; - public const CHLD = 17; + public const CHLD = 17; - public const CONT = 18; + public const CONT = 18; - public const STOP = 19; + public const STOP = 19; - public const TSTP = 20; + public const TSTP = 20; - public const TTIN = 21; + public const TTIN = 21; - public const TTOU = 22; + public const TTOU = 22; - public const URG = 23; + public const URG = 23; - public const XCPU = 24; + public const XCPU = 24; - public const XFSZ = 25; + public const XFSZ = 25; public const VTALRM = 26; - public const PROF = 27; + public const PROF = 27; - public const WINCH = 28; + public const WINCH = 28; - public const POLL = 29; + public const POLL = 29; - public const IO = 29; + public const IO = 29; - public const PWR = 30; + public const PWR = 30; - public const SYS = 31; + public const SYS = 31; - public const BABY = 31; + public const BABY = 31; } diff --git a/src/Traits/PhpEnvTrait.php b/src/Traits/PhpEnvTrait.php index 55643d2..c58fe35 100644 --- a/src/Traits/PhpEnvTrait.php +++ b/src/Traits/PhpEnvTrait.php @@ -10,12 +10,12 @@ namespace Toolkit\Sys\Traits; use RuntimeException; -use function get_defined_constants; -use function in_array; use function defined; -use function function_exists; use function extension_loaded; +use function function_exists; +use function get_defined_constants; use function get_loaded_extensions; +use function in_array; /** * Trait PhpEnvTrait diff --git a/src/Util/PhpError.php b/src/Util/PhpError.php index e2e9591..337651f 100644 --- a/src/Util/PhpError.php +++ b/src/Util/PhpError.php @@ -9,21 +9,21 @@ namespace Toolkit\Sys\Util; +use const E_COMPILE_ERROR; use const E_COMPILE_WARNING; -use const E_ERROR; -use const E_PARSE; -use const E_WARNING; -use const E_NOTICE; use const E_CORE_ERROR; use const E_CORE_WARNING; -use const E_COMPILE_ERROR; -use const E_USER_ERROR; -use const E_USER_WARNING; -use const E_USER_NOTICE; -use const E_STRICT; -use const E_RECOVERABLE_ERROR; use const E_DEPRECATED; +use const E_ERROR; +use const E_NOTICE; +use const E_PARSE; +use const E_RECOVERABLE_ERROR; +use const E_STRICT; use const E_USER_DEPRECATED; +use const E_USER_ERROR; +use const E_USER_NOTICE; +use const E_USER_WARNING; +use const E_WARNING; /** * Class PhpError diff --git a/src/Util/PhpException.php b/src/Util/PhpException.php index 6761702..f45d197 100644 --- a/src/Util/PhpException.php +++ b/src/Util/PhpException.php @@ -10,9 +10,9 @@ namespace Toolkit\Sys\Util; use Throwable; -use function strip_tags; use function get_class; use function json_encode; +use function strip_tags; /** * Class PhpException @@ -23,8 +23,8 @@ class PhpException { /** * @param Throwable $e - * @param bool $getTrace - * @param null $catcher + * @param bool $getTrace + * @param null $catcher * * @return string * @see PhpException::toHtml() @@ -37,10 +37,10 @@ public static function toString(Throwable $e, $getTrace = true, $catcher = null) /** * Converts an exception into a simple string. * - * @param Throwable $e the exception being converted - * @param bool $clearHtml - * @param bool $getTrace - * @param null|string $catcher + * @param Throwable $e the exception being converted + * @param bool $clearHtml + * @param bool $getTrace + * @param null|string $catcher * * @return string the string representation of the exception. */ @@ -67,9 +67,9 @@ public static function toHtml(Throwable $e, bool $getTrace = true, string $catch /** * Converts an exception into a simple array. * - * @param Throwable $e the exception being converted - * @param bool $getTrace - * @param null|string $catcher + * @param Throwable $e the exception being converted + * @param bool $getTrace + * @param null|string $catcher * * @return array */ @@ -96,9 +96,9 @@ public static function toArray(Throwable $e, bool $getTrace = true, string $catc /** * Converts an exception into a json string. * - * @param Throwable $e the exception being converted - * @param bool $getTrace - * @param null|string $catcher + * @param Throwable $e the exception being converted + * @param bool $getTrace + * @param null|string $catcher * * @return string the string representation of the exception. */