diff --git a/src/AttachableLogger.php b/src/AttachableLogger.php index d7e6030..f201ea9 100644 --- a/src/AttachableLogger.php +++ b/src/AttachableLogger.php @@ -15,21 +15,24 @@ * GNU General Public License for more details. */ +/** + * @phpstan-type LoggerAttachment \Closure(mixed $level, string $message) : void + */ interface AttachableLogger extends \Logger{ /** - * @param LoggerAttachment $attachment + * @phpstan-param LoggerAttachment $attachment * * @return void */ - public function addAttachment(\LoggerAttachment $attachment); + public function addAttachment(\Closure $attachment); /** - * @param LoggerAttachment $attachment + * @phpstan-param LoggerAttachment $attachment * * @return void */ - public function removeAttachment(\LoggerAttachment $attachment); + public function removeAttachment(\Closure $attachment); /** * @return void @@ -37,7 +40,8 @@ public function removeAttachment(\LoggerAttachment $attachment); public function removeAttachments(); /** - * @return \LoggerAttachment[] + * @return \Closure[] + * @phpstan-return LoggerAttachment[] */ public function getAttachments(); } diff --git a/src/LoggerAttachment.php b/src/LoggerAttachment.php deleted file mode 100644 index b3332a0..0000000 --- a/src/LoggerAttachment.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. -*/ - -interface LoggerAttachment{ - - /** - * @param mixed $level - * @param string $message - * - * @return void - */ - public function log($level, $message); - -}