Browse files

CS

  • Loading branch information...
1 parent a18574a commit 10b2ad2bb426a0c931f29577c6a3cd7a42b47fea @stefankleff committed Oct 10, 2012
View
4 library/Zend/Log/Formatter/Base.php
@@ -39,11 +39,11 @@ public function __construct($dateTimeFormat = null)
if ($dateTimeFormat instanceof Traversable) {
$dateTimeFormat = iterator_to_array($dateTimeFormat);
}
-
+
if (is_array($dateTimeFormat)) {
$dateTimeFormat = isset($dateTimeFormat['dateTimeFormat'])? $dateTimeFormat['dateTimeFormat'] : null;
}
-
+
if (null !== $dateTimeFormat) {
$this->dateTimeFormat = $dateTimeFormat;
}
View
4 library/Zend/Log/Formatter/Db.php
@@ -39,11 +39,11 @@ public function __construct($dateTimeFormat = null)
if ($dateTimeFormat instanceof Traversable) {
$dateTimeFormat = iterator_to_array($dateTimeFormat);
}
-
+
if (is_array($dateTimeFormat)) {
$dateTimeFormat = isset($dateTimeFormat['dateTimeFormat'])? $dateTimeFormat['dateTimeFormat'] : null;
}
-
+
if (null !== $dateTimeFormat) {
$this->setDateTimeFormat($dateTimeFormat);
}
View
6 library/Zend/Log/Formatter/Simple.php
@@ -43,12 +43,12 @@ public function __construct($format = null, $dateTimeFormat = null)
if ($format instanceof Traversable) {
$format = iterator_to_array($format);
}
-
- if (is_array($format)) {
+
+ if (is_array($format)) {
$dateTimeFormat = isset($format['dateTimeFormat'])? $format['dateTimeFormat'] : null;
$format = isset($format['format'])? $format['format'] : null;
}
-
+
if (isset($format) && !is_string($format)) {
throw new Exception\InvalidArgumentException('Format must be a string');
}
View
24 library/Zend/Log/Logger.php
@@ -82,7 +82,7 @@ class Logger implements LoggerInterface
/**
* Constructor
- *
+ *
* Set options for an logger. Accepted options are:
* - writers: array of writers to add to this logger
* - exceptionhandler: if true register this logger as exceptionhandler
@@ -95,35 +95,35 @@ class Logger implements LoggerInterface
public function __construct(array $options = null)
{
$this->writers = new SplPriorityQueue();
-
+
if ($options instanceof Traversable) {
$options = ArrayUtils::iteratorToArray($options);
}
-
+
if (is_array($options)) {
-
- if(isset($options['writers']) && is_array($options['writers'])) {
+
+ if(isset($options['writers']) && is_array($options['writers'])) {
foreach($options['writers'] as $writer) {
-
+
if(!isset($writer['name'])) {
throw new Exception\InvalidArgumentException('Options must contain a name for the writer');
}
-
+
$priority = (isset($writer['priority'])) ? $writer['priority'] : null;
$writerOptions = (isset($writer['options'])) ? $writer['options'] : null;
$this->addWriter($writer['name'], $priority, $writerOptions);
}
}
-
+
if(isset($options['exceptionhandler']) && $options['exceptionhandler'] === true) {
self::registerExceptionHandler($this);
- }
-
+ }
+
if(isset($options['errorhandler']) && $options['errorhandler'] === true) {
self::registerErrorHandler($this);
- }
-
+ }
+
}
}
View
32 library/Zend/Log/Writer/AbstractWriter.php
@@ -29,7 +29,7 @@
* @var FilterPluginManager
*/
protected $filterPlugins;
-
+
/**
* Formatter plugins
*
@@ -64,10 +64,10 @@
* @var bool
*/
protected $errorsToExceptionsConversionLevel = E_WARNING;
-
+
/**
* Constructor
- *
+ *
* Set options for an writer. Accepted options are:
* - filters: array of filters to add to this filter
* - formatter: formatter for this writer
@@ -81,21 +81,21 @@ public function __construct($options = null)
if ($options instanceof Traversable) {
$options = iterator_to_array($options);
}
-
+
if (is_array($options)) {
-
+
if(isset($options['filters']) && is_array($options['filters'])) {
- foreach($options['filters'] as $filter) {
+ foreach($options['filters'] as $filter) {
if(!isset($filter['name'])) {
throw new Exception\InvalidArgumentException('Options must contain a name for the filter');
- }
+ }
$filterOptions = (isset($filter['options'])) ? $filter['options'] : null;
$this->addFilter($filter['name'], $filterOptions);
}
}
-
+
if(isset($options['formatter'])) {
- $formatter = $options['formatter'];
+ $formatter = $options['formatter'];
if(is_string($formatter) || $formatter instanceof Formatter\FormatterInterface) {
$this->setFormatter($formatter);
} elseif(is_array($formatter)) {
@@ -187,7 +187,7 @@ public function filterPlugin($name, array $options = null)
{
return $this->getFilterPluginManager()->get($name, $options);
}
-
+
/**
* Get formatter plugin manager
*
@@ -200,7 +200,7 @@ public function getFormatterPluginManager()
}
return $this->formatterPlugins;
}
-
+
/**
* Set formatter plugin manager
*
@@ -220,12 +220,12 @@ public function setFormatterPluginManager($plugins)
is_object($plugins) ? get_class($plugins) : gettype($plugins)
));
}
-
+
$this->formatterPlugins = $plugins;
return $this;
}
-
-
+
+
/**
* Get formatter instance
*
@@ -296,12 +296,12 @@ public function setFormatter($formatter, array $options = null)
//throw new Exception\InvalidArgumentException(sprintf(
// 'Formatter must implement %s\Formatter\FormatterInterface; received "%s"',
// __NAMESPACE__,
- // is_object($formatter) ? get_class($formatter) : gettype($formatter)
+ // is_object($formatter) ? get_class($formatter) : gettype($formatter)
//));
trigger_error(sprintf(
'Formatter must implement %s\Formatter\FormatterInterface; received "%s"',
__NAMESPACE__,
- is_object($formatter) ? get_class($formatter) : gettype($formatter)
+ is_object($formatter) ? get_class($formatter) : gettype($formatter)
));
}
View
23 library/Zend/Log/Writer/FingersCrossed.php
@@ -37,7 +37,7 @@ class FingersCrossed extends AbstractWriter
* @var WriterInterface
*/
protected $writer;
-
+
/**
* Writer plugins
*
@@ -77,11 +77,11 @@ class FingersCrossed extends AbstractWriter
public function __construct($writer, $filterOrPriority = null, $bufferSize = 0)
{
$this->writer = $writer;
-
+
if ($writer instanceof Traversable) {
$writer = ArrayUtils::iteratorToArray($writer);
}
-
+
if (is_array($writer)) {
$filterOrPriority = isset($writer['priority']) ? $writer['priority'] : null;
$bufferSize = isset($writer['bufferSize']) ? $writer['bufferSize'] : null;
@@ -96,14 +96,13 @@ public function __construct($writer, $filterOrPriority = null, $bufferSize = 0)
if (is_array($writer) && isset($writer['name'])) {
$this->setWriter($writer['name'], $writer['options']);
- }
- else {
+ } else {
$this->setWriter($writer);
}
$this->addFilter($filterOrPriority);
$this->bufferSize = $bufferSize;
}
-
+
/**
* Set a new formatter for this writer
*
@@ -116,19 +115,19 @@ public function setWriter($writer, array $options = null)
if (is_string($writer)) {
$writer = $this->writerPlugin($writer, $options);
}
-
+
if (!$writer instanceof WriterInterface) {
throw new Exception\InvalidArgumentException(sprintf(
'Formatter must implement %s\Formatter\FormatterInterface; received "%s"',
__NAMESPACE__,
is_object($writer) ? get_class($writer) : gettype($writer)
));
}
-
+
$this->writer = $writer;
return $this;
}
-
+
/**
* Get writer plugin manager
*
@@ -141,7 +140,7 @@ public function getWriterPluginManager()
}
return $this->writerPlugins;
}
-
+
/**
* Set writer plugin manager
*
@@ -161,11 +160,11 @@ public function setWriterPluginManager($plugins)
is_object($plugins) ? get_class($plugins) : gettype($plugins)
));
}
-
+
$this->writerPlugins = $plugins;
return $this;
}
-
+
/**
* Get writer instance
*

0 comments on commit 10b2ad2

Please sign in to comment.