diff options
author | Grégoire Pineau <lyrixx@lyrixx.info> | 2017-06-19 01:41:02 +0200 |
---|---|---|
committer | Jordi Boggiano <j.boggiano@seld.be> | 2017-06-19 01:41:02 +0200 |
commit | 5a041bab8f16c88cb7f4767f2fc32434c67d1dc2 (patch) | |
tree | 0767597f2891a899b67333189f4cc4e4a9ea8fe6 /src | |
parent | 91a0f40927b58e01579ea12469eef5ce2a833687 (diff) | |
download | monolog-5a041bab8f16c88cb7f4767f2fc32434c67d1dc2.zip monolog-5a041bab8f16c88cb7f4767f2fc32434c67d1dc2.tar.gz monolog-5a041bab8f16c88cb7f4767f2fc32434c67d1dc2.tar.bz2 |
Use callable typehint where possible + Removed dead code (#996)
* Removed dead code
* Use callable typehint where possible
* Removed PHP5.3 workaround
Diffstat (limited to 'src')
-rw-r--r-- | src/Monolog/Handler/ProcessableHandlerTrait.php | 3 | ||||
-rw-r--r-- | src/Monolog/Handler/TestHandler.php | 6 |
2 files changed, 1 insertions, 8 deletions
diff --git a/src/Monolog/Handler/ProcessableHandlerTrait.php b/src/Monolog/Handler/ProcessableHandlerTrait.php index d28d46b..bba940e 100644 --- a/src/Monolog/Handler/ProcessableHandlerTrait.php +++ b/src/Monolog/Handler/ProcessableHandlerTrait.php @@ -28,9 +28,6 @@ trait ProcessableHandlerTrait */ public function pushProcessor(callable $callback): HandlerInterface { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } array_unshift($this->processors, $callback); return $this; diff --git a/src/Monolog/Handler/TestHandler.php b/src/Monolog/Handler/TestHandler.php index 34bfba4..3df7b6d 100644 --- a/src/Monolog/Handler/TestHandler.php +++ b/src/Monolog/Handler/TestHandler.php @@ -109,12 +109,8 @@ class TestHandler extends AbstractProcessingHandler }, $level); } - public function hasRecordThatPasses($predicate, $level) + public function hasRecordThatPasses(callable $predicate, $level) { - if (!is_callable($predicate)) { - throw new \InvalidArgumentException("Expected a callable for hasRecordThatPasses"); - } - if (!isset($this->recordsByLevel[$level])) { return false; } |