From c7b34ab144a850f9a1157b6f1f8fb65de0867a5d Mon Sep 17 00:00:00 2001 From: AuroraYolo <847050412@qq.com> Date: Mon, 28 Aug 2023 11:37:18 +0800 Subject: [PATCH] "Improve code readability with better structuring This commit involves cleanup and improved structuring of multiple function calls and if-else conditions across multiple classes for improved readability. Code has been refactored to use explicit comparisons, multi-line function arguments and chained method calls to enhance understanding and maintainability. No changes in functionality have been introduced." --- cloud-admin/RedLock/Redis.php | 13 +++++++------ php-styler.php | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 php-styler.php diff --git a/cloud-admin/RedLock/Redis.php b/cloud-admin/RedLock/Redis.php index b23a167..9d12f15 100644 --- a/cloud-admin/RedLock/Redis.php +++ b/cloud-admin/RedLock/Redis.php @@ -1,6 +1,6 @@ $expireSeconds], ); } catch ( - NotFoundExceptionInterface|ContainerExceptionInterface|RedisException $e, + NotFoundExceptionInterface|ContainerExceptionInterface|RedisException $e ) { } return false; } - public function eval(string $src, int $keyCount, array $keysAndArgs) : mixed + public function eval(string $src, int $keyCount, array $keysAndArgs): mixed { try { return $this->getRedisCon()->eval($src, $keysAndArgs, $keyCount); } catch ( - NotFoundExceptionInterface|ContainerExceptionInterface|RedisException $e, + NotFoundExceptionInterface|ContainerExceptionInterface|RedisException $e ) { } @@ -60,7 +61,7 @@ public function eval(string $src, int $keyCount, array $keysAndArgs) : mixed * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ - protected function getRedisCon() : RedisProxy + protected function getRedisCon(): RedisProxy { $container = ApplicationContext::getContainer(); return $container->get(RedisFactory::class)->get($this->pool); diff --git a/php-styler.php b/php-styler.php new file mode 100644 index 0000000..56a8366 --- /dev/null +++ b/php-styler.php @@ -0,0 +1,18 @@ +