Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[#2370] CS fixes

- Trailing whitespace
- Braces
  • Loading branch information...
commit 1a57370126bbcc603c2c990402c546097e916b6c 1 parent 4ac85d8
Matthew Weier O'Phinney weierophinney authored
22 library/Zend/Log/Writer/AbstractWriter.php
View
@@ -42,17 +42,17 @@
* @var Formatter
*/
protected $formatter;
-
+
/**
* Use Zend\Stdlib\ErrorHandler to report errors during calls to write
- *
+ *
* @var bool
*/
protected $convertWriteErrorsToExceptions = true;
-
+
/**
* Error level passed to Zend\Stdlib\ErrorHandler::start for errors reported during calls to write
- *
+ *
* @var bool
*/
protected $errorsToExceptionsConversionLevel = E_WARNING;
@@ -150,31 +150,29 @@ public function write(array $event)
}
$errorHandlerStarted = false;
-
+
if ($this->convertWriteErrorsToExceptions && !ErrorHandler::started()) {
ErrorHandler::start($this->errorsToExceptionsConversionLevel);
$errorHandlerStarted = true;
}
-
+
try {
$this->doWrite($event);
- }
- catch (\Exception $e)
- {
+ } catch (\Exception $e) {
if ($errorHandlerStarted) {
ErrorHandler::stop();
$errorHandlerStarted = false;
}
throw $e;
}
-
+
if ($errorHandlerStarted) {
$error = ErrorHandler::stop();
$errorHandlerStarted = false;
if ($error) {
throw new Exception\RuntimeException("Unable to write", 0, $error);
}
- }
+ }
}
/**
@@ -188,7 +186,7 @@ public function setFormatter(Formatter $formatter)
$this->formatter = $formatter;
return $this;
}
-
+
/**
* Set convert write errors to exception flag
*
4 tests/ZendTest/Log/Writer/AbstractTest.php
View
@@ -70,13 +70,13 @@ public function testFluentInterface()
$this->assertTrue($instance instanceof ConcreteWriter);
}
-
+
public function testConvertErrorsToException()
{
$writer = new ErrorGeneratingWriter();
$this->setExpectedException('Zend\Log\Exception\RuntimeException');
$writer->write(array('message' => 'test'));
-
+
$writer->setConvertWriteErrorsToExceptions(false);
$this->setExpectedException('PHPUnit_Framework_Error_Warning');
$writer->write(array('message' => 'test'));
Please sign in to comment.
Something went wrong with that request. Please try again.