diff --git a/src/OneBot/Config/Loader/AbstractFileLoader.php b/src/OneBot/Config/Loader/AbstractFileLoader.php index 148dadb..72cc6a4 100644 --- a/src/OneBot/Config/Loader/AbstractFileLoader.php +++ b/src/OneBot/Config/Loader/AbstractFileLoader.php @@ -9,9 +9,6 @@ abstract class AbstractFileLoader implements LoaderInterface { - /** - * {@inheritDoc} - */ public function load($source): array { // TODO: flexible base path diff --git a/src/OneBot/Config/Loader/DelegateLoader.php b/src/OneBot/Config/Loader/DelegateLoader.php index 071af74..4bcc9ad 100644 --- a/src/OneBot/Config/Loader/DelegateLoader.php +++ b/src/OneBot/Config/Loader/DelegateLoader.php @@ -25,9 +25,6 @@ public function __construct(array $loaders = null) $this->loaders = $loaders ?? self::getDefaultLoaders(); } - /** - * {@inheritDoc} - */ public function load($source): array { return $this->determineLoader($source)->load($source); diff --git a/src/OneBot/Config/Loader/JsonFileLoader.php b/src/OneBot/Config/Loader/JsonFileLoader.php index b55f475..130ecca 100644 --- a/src/OneBot/Config/Loader/JsonFileLoader.php +++ b/src/OneBot/Config/Loader/JsonFileLoader.php @@ -6,9 +6,6 @@ class JsonFileLoader extends AbstractFileLoader { - /** - * {@inheritDoc} - */ protected function loadFile(string $file) { try { diff --git a/src/OneBot/Config/Repository.php b/src/OneBot/Config/Repository.php index f60bcfb..c3dcd8f 100644 --- a/src/OneBot/Config/Repository.php +++ b/src/OneBot/Config/Repository.php @@ -21,9 +21,6 @@ public function __construct(array $config = []) $this->config = $config; } - /** - * {@inheritDoc} - */ public function get(string $key, $default = null) { // 在表层直接查找,找到就直接返回 @@ -51,9 +48,6 @@ public function get(string $key, $default = null) return $data; } - /** - * {@inheritDoc} - */ public function set(string $key, $value): void { if ($value === null) { @@ -75,17 +69,11 @@ public function set(string $key, $value): void $data = $value; } - /** - * {@inheritDoc} - */ public function has(string $key): bool { return $this->get($key) !== null; } - /** - * {@inheritDoc} - */ public function all(): array { return $this->config; diff --git a/src/OneBot/Driver/Event/DriverEvent.php b/src/OneBot/Driver/Event/DriverEvent.php index f46f999..cf5d87d 100644 --- a/src/OneBot/Driver/Event/DriverEvent.php +++ b/src/OneBot/Driver/Event/DriverEvent.php @@ -24,9 +24,6 @@ public static function getName(): string return static::$custom_name ?? static::class; } - /** - * {@inheritDoc} - */ public function isPropagationStopped(): bool { return $this->propagation_stopped; diff --git a/src/OneBot/Driver/Swoole/EventLoop.php b/src/OneBot/Driver/Swoole/EventLoop.php index 498d44f..109b43e 100644 --- a/src/OneBot/Driver/Swoole/EventLoop.php +++ b/src/OneBot/Driver/Swoole/EventLoop.php @@ -10,17 +10,11 @@ class EventLoop extends DriverEventLoopBase { - /** - * {@inheritDoc} - */ public function addReadEvent($fd, callable $callable) { Event::add($fd, $callable); } - /** - * {@inheritDoc} - */ public function delReadEvent($fd) { Event::del($fd); @@ -36,9 +30,6 @@ public function delWriteEvent($fd) Event::del($fd); } - /** - * {@inheritDoc} - */ public function addTimer(int $ms, callable $callable, int $times = 1, array $arguments = []): int { $timer_count = 0; @@ -54,17 +45,11 @@ public function addTimer(int $ms, callable $callable, int $times = 1, array $arg }, ...$arguments); } - /** - * {@inheritDoc} - */ public function clearTimer(int $timer_id) { Timer::clear($timer_id); } - /** - * {@inheritDoc} - */ public function clearAllTimer() { Timer::clearAll(); diff --git a/src/OneBot/Driver/Swoole/Socket/WSServerSocket.php b/src/OneBot/Driver/Swoole/Socket/WSServerSocket.php index bc87bcd..272d6af 100644 --- a/src/OneBot/Driver/Swoole/Socket/WSServerSocket.php +++ b/src/OneBot/Driver/Swoole/Socket/WSServerSocket.php @@ -27,9 +27,6 @@ public function close($fd): bool return false; } - /** - * {@inheritDoc} - */ public function send($data, $fd): bool { if ($data instanceof FrameInterface) { diff --git a/src/OneBot/Driver/Swoole/SwooleDriver.php b/src/OneBot/Driver/Swoole/SwooleDriver.php index c9ad016..85a17bc 100644 --- a/src/OneBot/Driver/Swoole/SwooleDriver.php +++ b/src/OneBot/Driver/Swoole/SwooleDriver.php @@ -59,9 +59,6 @@ public function getEventLoop(): DriverEventLoopBase return EventLoop::getInstance(); } - /** - * {@inheritDoc} - */ public function initInternalDriverClasses(?array $http, ?array $http_webhook, ?array $ws, ?array $ws_reverse): array { if (!empty($ws)) { diff --git a/src/OneBot/Driver/Workerman/EventLoop.php b/src/OneBot/Driver/Workerman/EventLoop.php index 2f7193b..623ceea 100644 --- a/src/OneBot/Driver/Workerman/EventLoop.php +++ b/src/OneBot/Driver/Workerman/EventLoop.php @@ -10,9 +10,6 @@ class EventLoop extends DriverEventLoopBase { - /** - * {@inheritDoc} - */ public function addTimer(int $ms, callable $callable, int $times = 1, array $arguments = []): int { $timer_count = 0; @@ -28,49 +25,31 @@ public function addTimer(int $ms, callable $callable, int $times = 1, array $arg }, $arguments); } - /** - * {@inheritDoc} - */ public function clearTimer(int $timer_id) { Timer::del($timer_id); } - /** - * {@inheritDoc} - */ public function addReadEvent($fd, callable $callable) { Worker::getEventLoop()->add($fd, EventInterface::EV_READ, $callable); } - /** - * {@inheritDoc} - */ public function delReadEvent($fd) { Worker::getEventLoop()->del($fd, EventInterface::EV_READ); } - /** - * {@inheritDoc} - */ public function addWriteEvent($fd, callable $callable) { Worker::getEventLoop()->add($fd, EventInterface::EV_WRITE, $callable); } - /** - * {@inheritDoc} - */ public function delWriteEvent($fd) { Worker::getEventLoop()->del($fd, EventInterface::EV_WRITE); } - /** - * {@inheritDoc} - */ public function clearAllTimer() { Timer::delAll(); diff --git a/src/OneBot/Driver/Workerman/Worker.php b/src/OneBot/Driver/Workerman/Worker.php index 73c58e3..724c35a 100644 --- a/src/OneBot/Driver/Workerman/Worker.php +++ b/src/OneBot/Driver/Workerman/Worker.php @@ -117,7 +117,7 @@ public static function stopAll($code = 0, $log = '') } foreach ($worker_pid_array as $worker_pid) { \posix_kill($worker_pid, $sig); - if (!static::$_gracefulStop){ + if (!static::$_gracefulStop) { Timer::add(static::$stopTimeout, '\posix_kill', [$worker_pid, \SIGKILL], false); } } @@ -130,7 +130,7 @@ public static function stopAll($code = 0, $log = '') else { // Execute exit. foreach (static::$_workers as $worker) { - if (!$worker->stopping){ + if (!$worker->stopping) { $worker->stop(); $worker->stopping = true; } @@ -156,7 +156,8 @@ public static function stopAll($code = 0, $log = '') * * @return array */ - public static function getStartFilesForWindows() { + public static function getStartFilesForWindows() + { return ['']; } @@ -303,7 +304,7 @@ protected static function parseCommand(): void } static::safeEcho("\nPress Ctrl+C to quit.\n\n"); } - // no break + // no break case 'connections': if (\is_file($statistics_file) && is_writable($statistics_file)) { \unlink($statistics_file); diff --git a/src/OneBot/Driver/Workerman/WorkermanDriver.php b/src/OneBot/Driver/Workerman/WorkermanDriver.php index deb37c4..9c82ea7 100644 --- a/src/OneBot/Driver/Workerman/WorkermanDriver.php +++ b/src/OneBot/Driver/Workerman/WorkermanDriver.php @@ -58,9 +58,6 @@ public function getWSServerSocketByWorker(Worker $worker): ?WSServerSocket return null; } - /** - * {@inheritDoc} - */ public function run(): void { try { @@ -121,8 +118,6 @@ public function getName(): string } /** - * {@inheritDoc} - * * @throws \Exception */ public function initWSReverseClients(array $headers = []) diff --git a/src/OneBot/V12/EventBuilder.php b/src/OneBot/V12/EventBuilder.php index 1da622f..8ace3e9 100644 --- a/src/OneBot/V12/EventBuilder.php +++ b/src/OneBot/V12/EventBuilder.php @@ -36,7 +36,7 @@ public function valid(): bool try { $this->event = new OneBotEvent($this->data); return true; - }catch (OneBotException $e) { + } catch (OneBotException $e) { return false; } } diff --git a/tests/OneBot/Config/RepositoryTest.php b/tests/OneBot/Config/RepositoryTest.php index 3b09082..16b82de 100644 --- a/tests/OneBot/Config/RepositoryTest.php +++ b/tests/OneBot/Config/RepositoryTest.php @@ -49,12 +49,12 @@ protected function setUp(): void ); } -// 尚未确定是否应该支持 -// public function testGetValueWhenKeyContainsDot(): void -// { -// $this->assertEquals('c', $this->repository->get('a.b')); -// $this->assertEquals('d', $this->repository->get('a.b.c')); -// } + // 尚未确定是否应该支持 + // public function testGetValueWhenKeyContainsDot(): void + // { + // $this->assertEquals('c', $this->repository->get('a.b')); + // $this->assertEquals('d', $this->repository->get('a.b.c')); + // } public function testGetBooleanValue(): void {