1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 09:06:10 +02:00

Fix misleading @throws tag in StreamHandler doc

The `\Exception` for non-existing and not creatable paths is thrown earliest on first write.
Not during StreamHandler instantiation, as claimed by the constructor's `@throws` tag.
This commit is contained in:
Thomas Praxl
2019-11-15 09:07:02 +01:00
parent f9d56fd2f5
commit 3dcb1919a3
2 changed files with 27 additions and 21 deletions

View File

@@ -32,13 +32,12 @@ class StreamHandler extends AbstractProcessingHandler
private $dirCreated;
/**
* @param resource|string $stream
* @param resource|string $stream If a missing path can't be created, an Exception will be thrown on first write
* @param string|int $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
* @param bool $useLocking Try to lock log file before doing any writes
*
* @throws \Exception If a missing directory is not buildable
* @throws \InvalidArgumentException If stream is not a resource or string
*/
public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false)