logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject [42/43] git commit: Style fixes to make code conform to PSR-2 better
Date Thu, 28 Nov 2013 16:04:12 GMT
Style fixes to make code conform to PSR-2 better

Also wrapped lines to 120 chars, since it's a sane value, and phpcs
produces a warning for longer lines.

Made some errors less verbose to acomplish this.

Signed-off-by: Ivan Habunek <ivan.habunek@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/logging-log4php/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4php/commit/378ce1a3
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4php/tree/378ce1a3
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4php/diff/378ce1a3

Branch: refs/heads/v3
Commit: 378ce1a3828440df364860f0da96403e1f7de0c9
Parents: b178d46
Author: Ivan Habunek <ivan.habunek@gmail.com>
Authored: Thu Nov 28 16:53:20 2013 +0100
Committer: Ivan Habunek <ivan.habunek@gmail.com>
Committed: Thu Nov 28 16:53:20 2013 +0100

----------------------------------------------------------------------
 src/AppenderPool.php                            |  5 +-
 src/Appenders/AbstractAppender.php              | 10 ++--
 src/Appenders/ConsoleAppender.php               |  4 +-
 src/Appenders/DailyFileAppender.php             |  8 +--
 src/Appenders/MailAppender.php                  |  6 +-
 src/Appenders/MailEventAppender.php             | 15 +++--
 src/Appenders/MongoDBAppender.php               |  8 ++-
 src/Appenders/PdoAppender.php                   |  8 ++-
 src/Appenders/RollingFileAppender.php           | 12 ++--
 src/Appenders/SyslogAppender.php                |  5 +-
 src/Configurable.php                            | 40 ++++++++++---
 src/Configuration/DefaultConfigurator.php       | 60 +++++++++++++-------
 src/Configuration/adapters/AdapterInterface.php |  1 -
 src/Configuration/adapters/IniAdapter.php       | 39 +++++--------
 src/Filters/AbstractFilter.php                  |  3 +-
 src/Filters/StringMatchFilter.php               |  2 +-
 src/Helpers/OptionConverter.php                 | 30 +++++++---
 src/Helpers/PatternParser.php                   |  5 +-
 src/Layouts/HtmlLayout.php                      |  9 ++-
 src/Layouts/XmlLayout.php                       | 11 ++--
 src/Level.php                                   | 55 +++++++++++-------
 src/LocationInfo.php                            |  1 -
 src/Logger.php                                  | 24 ++++++--
 src/LoggingEvent.php                            | 11 ++--
 src/Pattern/AbstractConverter.php               | 22 +++----
 src/Pattern/ClassConverter.php                  |  8 +--
 src/Pattern/LoggerConverter.php                 |  8 +--
 src/Pattern/SuperglobalConverter.php            |  8 +--
 src/ReflectionUtils.php                         |  7 ++-
 src/Renderers/RendererMap.php                   | 22 +++++--
 tests/src/ConfiguratorTest.php                  |  2 +-
 tests/src/Configurators/INIAdapterTest.php      |  4 +-
 tests/src/Renderers/RendererMapTest.php         |  4 +-
 33 files changed, 285 insertions(+), 172 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/AppenderPool.php
----------------------------------------------------------------------
diff --git a/src/AppenderPool.php b/src/AppenderPool.php
index abcb698..98034bb 100644
--- a/src/AppenderPool.php
+++ b/src/AppenderPool.php
@@ -52,7 +52,10 @@ class AppenderPool
         }
 
         if (isset(self::$appenders[$name])) {
-            trigger_error("log4php: Appender [$name] already exists in pool. Overwriting existing appender.", E_USER_WARNING);
+            trigger_error(
+                "log4php: Appender [$name] already exists in pool. Overwriting existing appender.",
+                E_USER_WARNING
+            );
         }
 
         self::$appenders[$name] = $appender;

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/AbstractAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/AbstractAppender.php b/src/Appenders/AbstractAppender.php
index e772b21..8a76d64 100644
--- a/src/Appenders/AbstractAppender.php
+++ b/src/Appenders/AbstractAppender.php
@@ -163,9 +163,12 @@ abstract class AbstractAppender extends Configurable
         $filter = $this->getFirstFilter();
         while ($filter !== null) {
             switch ($filter->decide($event)) {
-                case AbstractFilter::DENY: return;
-                case AbstractFilter::ACCEPT: return $this->append($event);
-                case AbstractFilter::NEUTRAL: $filter = $filter->getNext();
+                case AbstractFilter::DENY:
+                    return;
+                case AbstractFilter::ACCEPT:
+                    return $this->append($event);
+                case AbstractFilter::NEUTRAL:
+                    $filter = $filter->getNext();
             }
         }
         $this->append($event);
@@ -307,5 +310,4 @@ abstract class AbstractAppender extends Configurable
         $id = get_class($this) . (empty($this->name) ? '' : ":{$this->name}");
         trigger_error("log4php: [$id]: $message", E_USER_WARNING);
     }
-
 }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/ConsoleAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/ConsoleAppender.php b/src/Appenders/ConsoleAppender.php
index d32fd9e..13e89af 100644
--- a/src/Appenders/ConsoleAppender.php
+++ b/src/Appenders/ConsoleAppender.php
@@ -35,8 +35,8 @@ use Apache\Log4php\LoggingEvent;
  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  * @link http://logging.apache.org/log4php/docs/appenders/console.html Appender documentation
  */
- class ConsoleAppender extends AbstractAppender
- {
+class ConsoleAppender extends AbstractAppender
+{
     /** The standard otuput stream.  */
     const STDOUT = 'php://stdout';
 

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/DailyFileAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/DailyFileAppender.php b/src/Appenders/DailyFileAppender.php
index 3464246..81541b0 100644
--- a/src/Appenders/DailyFileAppender.php
+++ b/src/Appenders/DailyFileAppender.php
@@ -80,13 +80,11 @@ class DailyFileAppender extends FileAppender
     {
         $eventDate = $this->getDate($event->getTimestamp());
 
-        // Initial setting of current date
         if (!isset($this->currentDate)) {
+            // Initial setting of current date
             $this->currentDate = $eventDate;
-        }
-
-        // Check if rollover is needed
-        else if ($this->currentDate !== $eventDate) {
+        } elseif ($this->currentDate !== $eventDate) {
+            // Check if rollover is needed
             $this->currentDate = $eventDate;
 
             // Close the file if it's open.

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/MailAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/MailAppender.php b/src/Appenders/MailAppender.php
index d34dce1..916ba45 100644
--- a/src/Appenders/MailAppender.php
+++ b/src/Appenders/MailAppender.php
@@ -90,9 +90,11 @@ class MailAppender extends AbstractAppender
                 $subject = $this->subject;
                 if (!$this->dry) {
                     mail(
-                        $to, $subject,
+                        $to,
+                        $subject,
                         $this->layout->getHeader() . $this->body . $this->layout->getFooter(),
-                        "From: {$from}\r\n");
+                        "From: {$from}\r\n"
+                    );
                 } else {
                     echo "DRY MODE OF MAIL APP.: Send mail to: ".$to." with content: ".$this->body;
                 }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/MailEventAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/MailEventAppender.php b/src/Appenders/MailEventAppender.php
index 6a0ff70..291642c 100644
--- a/src/Appenders/MailEventAppender.php
+++ b/src/Appenders/MailEventAppender.php
@@ -118,9 +118,16 @@ class MailEventAppender extends AbstractAppender
         $addHeader = empty($this->from) ? '' : "From: {$this->from}\r\n";
 
         if (!$this->dry) {
-            $result = mail($this->to, $this->subject, $this->layout->getHeader() . $this->layout->format($event) . $this->layout->getFooter($event), $addHeader);
+            $result = mail(
+                $this->to,
+                $this->subject,
+                $this->layout->getHeader() . $this->layout->format($event) . $this->layout->getFooter($event),
+                $addHeader
+            );
         } else {
-            echo "DRY MODE OF MAIL APP.: Send mail to: ".$this->to." with additional headers '".trim($addHeader)."' and content: ".$this->layout->format($event);
+            echo "DRY MODE OF MAIL APP.: Send mail to: " . $this->to .
+                " with additional headers '" . trim($addHeader) .
+                "' and content: " . $this->layout->format($event);
         }
 
         ini_set('SMTP', $prevSmtpHost);
@@ -166,7 +173,7 @@ class MailEventAppender extends AbstractAppender
     /** Sets the 'subject' parameter. */
     public function setSubject($subject)
     {
-        $this->setString('subject',  $subject);
+        $this->setString('subject', $subject);
     }
 
     /** Returns the 'subject' parameter. */
@@ -178,7 +185,7 @@ class MailEventAppender extends AbstractAppender
     /** Sets the 'to' parameter. */
     public function setTo($to)
     {
-        $this->setString('to',  $to);
+        $this->setString('to', $to);
     }
 
     /** Returns the 'to' parameter. */

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/MongoDBAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/MongoDBAppender.php b/src/Appenders/MongoDBAppender.php
index 0ff180b..c07e6b8 100644
--- a/src/Appenders/MongoDBAppender.php
+++ b/src/Appenders/MongoDBAppender.php
@@ -130,7 +130,10 @@ class MongoDBAppender extends AbstractAppender
     public function activateOptions()
     {
         try {
-            $this->connection = new Mongo(sprintf('%s:%d', $this->host, $this->port), array('timeout' => $this->timeout));
+            $this->connection = new Mongo(
+                sprintf('%s:%d', $this->host, $this->port),
+                array('timeout' => $this->timeout)
+            );
             $db	= $this->connection->selectDB($this->databaseName);
             if ($this->userName !== null && $this->password !== null) {
                 $authResult = $db->authenticate($this->userName, $this->password);
@@ -190,7 +193,8 @@ class MongoDBAppender extends AbstractAppender
         if ($locationInfo != null) {
             $document['fileName'] = $locationInfo->getFileName();
             $document['method'] = $locationInfo->getMethodName();
-            $document['lineNumber'] = ($locationInfo->getLineNumber() == 'NA') ? 'NA' : (int) $locationInfo->getLineNumber();
+            $document['lineNumber'] = ($locationInfo->getLineNumber() == 'NA') ?
+                'NA' : (int) $locationInfo->getLineNumber();
             $document['className'] = $locationInfo->getClassName();
         }
 

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/PdoAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/PdoAppender.php b/src/Appenders/PdoAppender.php
index 431b9d6..81ef3ad 100644
--- a/src/Appenders/PdoAppender.php
+++ b/src/Appenders/PdoAppender.php
@@ -71,7 +71,8 @@ class PdoAppender extends AbstractAppender
      * The questionmarks are part of the prepared statement, and they must
      * match the number of conversion specifiers in {@link insertPattern}.
      */
-    protected $insertSQL = "INSERT INTO __TABLE__ (timestamp, logger, level, message, thread, file, line) VALUES (?, ?, ?, ?, ?, ?, ?)";
+    protected $insertSQL =
+        "INSERT INTO __TABLE__ (timestamp, logger, level, message, thread, file, line) VALUES (?, ?, ?, ?, ?, ?, ?)";
 
     /**
      * A comma separated list of {@link LoggerPatternLayout} format strings
@@ -177,7 +178,10 @@ class PdoAppender extends AbstractAppender
 
                 // Close the appender if it's the last attempt
                 if ($attempt > $this->reconnectAttempts) {
-                    $this->warn("Failed writing to database after {$this->reconnectAttempts} reconnect attempts. Closing appender.");
+                    $this->warn(
+                        "Failed writing to database after {$this->reconnectAttempts} reconnect attempts. " .
+                        "Closing appender."
+                    );
                     $this->close();
                 // Otherwise reconnect and try to write again
                 } else {

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/RollingFileAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/RollingFileAppender.php b/src/Appenders/RollingFileAppender.php
index 8e7024b..35af51a 100644
--- a/src/Appenders/RollingFileAppender.php
+++ b/src/Appenders/RollingFileAppender.php
@@ -104,12 +104,16 @@ class RollingFileAppender extends FileAppender
     /**
      * Implements the usual roll over behaviour.
      *
-     * If MaxBackupIndex is positive, then files File.1, ..., File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex.
-     * Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
+     * If MaxBackupIndex is positive, then files File.1, ...,
+     * File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex.
+     * Moreover, File is renamed File.1 and closed. A new File is created to
+     * receive further log output.
      *
-     * If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.
+     * If MaxBackupIndex is equal to zero, then the File is truncated with no
+     * backup files created.
      *
-     * Rollover must be called while the file is locked so that it is safe for concurrent access.
+     * Rollover must be called while the file is locked so that it is safe for
+     * concurrent access.
      *
      * @throws LoggerException If any part of the rollover procedure fails.
      */

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Appenders/SyslogAppender.php
----------------------------------------------------------------------
diff --git a/src/Appenders/SyslogAppender.php b/src/Appenders/SyslogAppender.php
index b6fc0c0..8bb8904 100644
--- a/src/Appenders/SyslogAppender.php
+++ b/src/Appenders/SyslogAppender.php
@@ -286,7 +286,10 @@ class SyslogAppender extends AbstractAppender
                 if (defined($constant)) {
                     $value |= constant($constant);
                 } else {
-                    trigger_error("log4php: Invalid syslog option provided: $option. Whole option string: {$this->option}.", E_USER_WARNING);
+                    trigger_error(
+                        "log4php: Invalid syslog option provided: $option. Whole option string: {$this->option}.",
+                        E_USER_WARNING
+                    );
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Configurable.php
----------------------------------------------------------------------
diff --git a/src/Configurable.php b/src/Configurable.php
index 6964408..246b105 100644
--- a/src/Configurable.php
+++ b/src/Configurable.php
@@ -39,7 +39,10 @@ abstract class Configurable
             $this->$property = OptionConverter::toBooleanEx($value);
         } catch (Exception $ex) {
             $value = var_export($value, true);
-            $this->warn("Invalid value given for '$property' property: [$value]. Expected a boolean value. Property not changed.");
+            $this->warn(
+                "Invalid value given for '$property' property: [$value]. " .
+                "Expected a boolean value. Property not changed."
+            );
         }
     }
 
@@ -50,7 +53,10 @@ abstract class Configurable
             $this->$property = OptionConverter::toIntegerEx($value);
         } catch (Exception $ex) {
             $value = var_export($value, true);
-            $this->warn("Invalid value given for '$property' property: [$value]. Expected an integer. Property not changed.");
+            $this->warn(
+                "Invalid value given for '$property' property: [$value]. Expected an integer. " .
+                "Property not changed."
+            );
         }
     }
 
@@ -61,7 +67,10 @@ abstract class Configurable
             $this->$property = OptionConverter::toLevelEx($value);
         } catch (Exception $ex) {
             $value = var_export($value, true);
-            $this->warn("Invalid value given for '$property' property: [$value]. Expected a level value. Property not changed.");
+            $this->warn(
+                "Invalid value given for '$property' property: [$value]. Expected a level value. " .
+                "Property not changed."
+            );
         }
     }
 
@@ -72,7 +81,10 @@ abstract class Configurable
             $this->$property = OptionConverter::toPositiveIntegerEx($value);
         } catch (Exception $ex) {
             $value = var_export($value, true);
-            $this->warn("Invalid value given for '$property' property: [$value]. Expected a positive integer. Property not changed.");
+            $this->warn(
+                "Invalid value given for '$property' property: [$value]. Expected a positive integer. " .
+                "Property not changed."
+            );
         }
     }
 
@@ -83,7 +95,10 @@ abstract class Configurable
             $this->$property = OptionConverter::toFileSizeEx($value);
         } catch (Exception $ex) {
             $value = var_export($value, true);
-            $this->warn("Invalid value given for '$property' property: [$value]. Expected a file size value.  Property not changed.");
+            $this->warn(
+                "Invalid value given for '$property' property: [$value]. Expected a file size value.  " .
+                "Property not changed."
+            );
         }
     }
 
@@ -94,7 +109,10 @@ abstract class Configurable
             $this->$property = OptionConverter::toNumericEx($value);
         } catch (Exception $ex) {
             $value = var_export($value, true);
-            $this->warn("Invalid value given for '$property' property: [$value]. Expected a number. Property not changed.");
+            $this->warn(
+                "Invalid value given for '$property' property: [$value]. Expected a number. " .
+                "Property not changed."
+            );
         }
     }
 
@@ -105,7 +123,10 @@ abstract class Configurable
             if ($nullable) {
                 $this->$property= null;
             } else {
-                $this->warn("Null value given for '$property' property. Expected a string. Property not changed.");
+                $this->warn(
+                    "Null value given for '$property' property. Expected a string. " .
+                    "Property not changed."
+                );
             }
         } else {
             try {
@@ -113,7 +134,10 @@ abstract class Configurable
                 $this->$property = OptionConverter::substConstants($value);
             } catch (Exception $ex) {
                 $value = var_export($value, true);
-                $this->warn("Invalid value given for '$property' property: [$value]. Expected a string. Property not changed.");
+                $this->warn(
+                    "Invalid value given for '$property' property: [$value]. Expected a string. " .
+                    "Property not changed."
+                );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Configuration/DefaultConfigurator.php
----------------------------------------------------------------------
diff --git a/src/Configuration/DefaultConfigurator.php b/src/Configuration/DefaultConfigurator.php
index 7ef223b..7dd8dde 100644
--- a/src/Configuration/DefaultConfigurator.php
+++ b/src/Configuration/DefaultConfigurator.php
@@ -106,28 +106,22 @@ class DefaultConfigurator implements ConfiguratorInterface
      */
     public function parse($input)
     {
-        // No input - use default configuration
         if (!isset($input)) {
+            // No input - use default configuration
             $config = self::$defaultConfiguration;
-        }
-
-        // Array input - contains configuration within the array
-        else if (is_array($input)) {
+        } elseif (is_array($input)) {
+            // Array input - contains configuration within the array
             $config = $input;
-        }
-
-        // String input - contains path to configuration file
-        else if (is_string($input)) {
+        } elseif (is_string($input)) {
+            // String input - contains path to configuration file
             try {
                 $config = $this->parseFile($input);
             } catch (LoggerException $e) {
                 $this->warn("Configuration failed. " . $e->getMessage() . " Using default configuration.");
                 $config = self::$defaultConfiguration;
             }
-        }
-
-        // Anything else is an error
-        else {
+        } else {
+            // Anything else is an error
             $this->warn("Invalid configuration param given. Reverting to default configuration.");
             $config = self::$defaultConfiguration;
         }
@@ -203,7 +197,10 @@ class DefaultConfigurator implements ConfiguratorInterface
             if (isset($threshold)) {
                 $hierarchy->setThreshold($threshold);
             } else {
-                $this->warn("Invalid threshold value [{$config['threshold']}] specified. Ignoring threshold definition.");
+                $this->warn(
+                    "Invalid threshold value [{$config['threshold']}] specified. " .
+                    "Ignoring threshold definition."
+                );
             }
         }
 
@@ -279,7 +276,10 @@ class DefaultConfigurator implements ConfiguratorInterface
         // TODO: add this check to other places where it might be useful
         if (!is_array($config)) {
             $type = gettype($config);
-            $this->warn("Invalid configuration provided for appender [$name]. Expected an array, found <$type>. Skipping appender definition.");
+            $this->warn(
+                "Invalid configuration provided for appender [$name]. Expected an array, found <$type>. " .
+                "Skipping appender definition."
+            );
 
             return;
         }
@@ -304,13 +304,19 @@ class DefaultConfigurator implements ConfiguratorInterface
         }
 
         if (!isset($appender)) {
-            $this->warn("Invalid class [$class] given for appender [$name]. Class does not exist. Skipping appender definition.");
+            $this->warn(
+                "Invalid class [$class] given for appender [$name]. Class does not exist. " .
+                "Skipping appender definition."
+            );
 
             return;
         }
 
         if (!($appender instanceof AbstractAppender)) {
-            $this->warn("Invalid class [$class] given for appender [$name]. Not a valid Appender class. Skipping appender definition.");
+            $this->warn(
+                "Invalid class [$class] given for appender [$name]. Not a valid Appender class. " .
+                "Skipping appender definition."
+            );
 
             return;
         }
@@ -321,7 +327,10 @@ class DefaultConfigurator implements ConfiguratorInterface
             if ($threshold instanceof Level) {
                 $appender->setThreshold($threshold);
             } else {
-                $this->warn("Invalid threshold value [{$config['threshold']}] specified for appender [$name]. Ignoring threshold definition.");
+                $this->warn(
+                    "Invalid threshold value [{$config['threshold']}] specified for appender [$name]. " .
+                    "Ignoring threshold definition."
+                );
             }
         }
 
@@ -372,7 +381,10 @@ class DefaultConfigurator implements ConfiguratorInterface
         }
 
         if (!isset($layout)) {
-            $this->warn("Nonexistant layout class [$class] specified for appender [$name]. Reverting to default layout.");
+            $this->warn(
+                "Nonexistant layout class [$class] specified for appender [$name]. " .
+                "Reverting to default layout."
+            );
 
             return;
         }
@@ -468,7 +480,10 @@ class DefaultConfigurator implements ConfiguratorInterface
             if (isset($level)) {
                 $logger->setLevel($level);
             } else {
-                $this->warn("Invalid level value [{$config['level']}] specified for logger [$loggerName]. Ignoring level definition.");
+                $this->warn(
+                    "Invalid level value [{$config['level']}] specified for logger [$loggerName]. " .
+                    "Ignoring level definition."
+                );
             }
         }
 
@@ -489,7 +504,10 @@ class DefaultConfigurator implements ConfiguratorInterface
                 $additivity = OptionConverter::toBooleanEx($config['additivity'], null);
                 $logger->setAdditivity($additivity);
             } catch (LoggerException $ex) {
-                $this->warn("Invalid additivity value [{$config['additivity']}] specified for logger [$loggerName]. Ignoring additivity setting.");
+                $this->warn(
+                    "Invalid additivity value [{$config['additivity']}] specified for logger [$loggerName]. " .
+                    "Ignoring additivity setting."
+                );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Configuration/adapters/AdapterInterface.php
----------------------------------------------------------------------
diff --git a/src/Configuration/adapters/AdapterInterface.php b/src/Configuration/adapters/AdapterInterface.php
index 15b565a..871bb9d 100644
--- a/src/Configuration/adapters/AdapterInterface.php
+++ b/src/Configuration/adapters/AdapterInterface.php
@@ -31,5 +31,4 @@ interface AdapterInterface
 {
     /** Converts the configuration file to PHP format usable by the configurator. */
     public function convert($input);
-
 }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Configuration/adapters/IniAdapter.php
----------------------------------------------------------------------
diff --git a/src/Configuration/adapters/IniAdapter.php b/src/Configuration/adapters/IniAdapter.php
index 93a71d4..6110a10 100644
--- a/src/Configuration/adapters/IniAdapter.php
+++ b/src/Configuration/adapters/IniAdapter.php
@@ -99,25 +99,20 @@ class IniAdapter implements AdapterInterface
         $appenders = array();
 
         foreach ($properties as $key => $value) {
-            // Parse loggers
+
             if ($this->beginsWith($key, self::LOGGER_PREFIX)) {
+                // Parse loggers
                 $name = substr($key, strlen(self::LOGGER_PREFIX));
                 $this->parseLogger($value, $name);
-            }
-
-            // Parse additivity
-            if ($this->beginsWith($key, self::ADDITIVITY_PREFIX)) {
+            } elseif ($this->beginsWith($key, self::ADDITIVITY_PREFIX)) {
+                // Parse additivity
                 $name = substr($key, strlen(self::ADDITIVITY_PREFIX));
                 $this->config['loggers'][$name]['additivity'] = $value;
-            }
-
-            // Parse appenders
-            else if ($this->beginsWith($key, self::APPENDER_PREFIX)) {
+            } elseif ($this->beginsWith($key, self::APPENDER_PREFIX)) {
+                // Parse appenders
                 $this->parseAppender($key, $value);
-            }
-
-            // Parse renderers
-            else if ($this->beginsWith($key, self::RENDERER_PREFIX)) {
+            } elseif ($this->beginsWith($key, self::RENDERER_PREFIX)) {
+                // Parse renderers
                 $this->parseRenderer($key, $value);
             }
         }
@@ -238,16 +233,12 @@ class IniAdapter implements AdapterInterface
         // The first part is always the appender name
         $name = trim($parts[0]);
 
-        // Only one part - this line defines the appender class
         if ($count == 1) {
+            // Only one part - this line defines the appender class
             $this->config['appenders'][$name]['class'] = $value;
-
             return;
-        }
-
-        // Two parts - either a parameter, a threshold or layout class
-        else if ($count == 2) {
-
+        } elseif ($count == 2) {
+            // Two parts - either a parameter, a threshold or layout class
             if ($parts[1] == 'layout') {
                 $this->config['appenders'][$name]['layout']['class'] = $value;
 
@@ -261,10 +252,8 @@ class IniAdapter implements AdapterInterface
 
                 return;
             }
-        }
-
-        // Three parts - this can only be a layout parameter
-        else if ($count == 3) {
+        } elseif ($count == 3) {
+            // Three parts - this can only be a layout parameter
             if ($parts[1] == 'layout') {
                 $this->config['appenders'][$name]['layout']['params'][$parts[2]] = $value;
 
@@ -272,7 +261,7 @@ class IniAdapter implements AdapterInterface
             }
         }
 
-        trigger_error("log4php: Don't know how to parse the following line: \"$key = $value\". Skipping.", E_USER_WARNING);
+        trigger_error("log4php: Don't know how to parse line: \"$key = $value\". Skipping.", E_USER_WARNING);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Filters/AbstractFilter.php
----------------------------------------------------------------------
diff --git a/src/Filters/AbstractFilter.php b/src/Filters/AbstractFilter.php
index bdc167a..7f15e34 100644
--- a/src/Filters/AbstractFilter.php
+++ b/src/Filters/AbstractFilter.php
@@ -97,7 +97,7 @@ abstract class AbstractFilter extends Configurable
      * the chain.
      *
      * @param  LoggingEvent $event The {@link LoggingEvent} to decide upon.
-     * @return integer      {@link AbstractFilter::NEUTRAL} or {@link AbstractFilter::DENY}|{@link AbstractFilter::ACCEPT}
+     * @return integer {@link AbstractFilter::NEUTRAL} or {@link AbstractFilter::DENY} or {@link AbstractFilter::ACCEPT}
      */
     public function decide(LoggingEvent $event)
     {
@@ -128,5 +128,4 @@ abstract class AbstractFilter extends Configurable
     {
         return $this->next;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Filters/StringMatchFilter.php
----------------------------------------------------------------------
diff --git a/src/Filters/StringMatchFilter.php b/src/Filters/StringMatchFilter.php
index 5582317..f77976a 100644
--- a/src/Filters/StringMatchFilter.php
+++ b/src/Filters/StringMatchFilter.php
@@ -84,7 +84,7 @@ class StringMatchFilter extends AbstractFilter
             return AbstractFilter::NEUTRAL;
         }
 
-        if (strpos($msg, $this->stringToMatch) !== false ) {
+        if (strpos($msg, $this->stringToMatch) !== false) {
             return ($this->acceptOnMatch) ? AbstractFilter::ACCEPT : AbstractFilter::DENY;
         }
 

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Helpers/OptionConverter.php
----------------------------------------------------------------------
diff --git a/src/Helpers/OptionConverter.php b/src/Helpers/OptionConverter.php
index 868bed6..2888cb9 100644
--- a/src/Helpers/OptionConverter.php
+++ b/src/Helpers/OptionConverter.php
@@ -83,7 +83,8 @@ class OptionConverter
             }
         }
 
-        throw new LoggerException("Given value [" . var_export($value, true) . "] cannot be converted to boolean.");
+        $value = var_export($value, true);
+        throw new LoggerException("Given value [$value] cannot be converted to boolean.");
     }
 
     /**
@@ -99,7 +100,8 @@ class OptionConverter
             return (integer) $value;
         }
 
-        throw new LoggerException("Given value [" . var_export($value, true) . "] cannot be converted to integer.");
+        $value = var_export($value, true);
+        throw new LoggerException("Given value [$value] cannot be converted to integer.");
     }
 
     /**
@@ -115,7 +117,8 @@ class OptionConverter
             return (integer) $value;
         }
 
-        throw new LoggerException("Given value [" . var_export($value, true) . "] cannot be converted to a positive integer.");
+        $value = var_export($value, true);
+        throw new LoggerException("Given value [$value] cannot be converted to a positive integer.");
     }
 
     /** Converts the value to a level. Throws an exception if not possible. */
@@ -126,7 +129,8 @@ class OptionConverter
         }
         $level = Level::toLevel($value);
         if ($level === null) {
-            throw new LoggerException("Given value [" . var_export($value, true) . "] cannot be converted to a logger level.");
+            $value = var_export($value, true);
+            throw new LoggerException("Given value [$value] cannot be converted to a logger level.");
         }
 
         return $level;
@@ -159,7 +163,8 @@ class OptionConverter
         }
 
         if (!is_string($value)) {
-            throw new LoggerException("Given value [" . var_export($value, true) . "] cannot be converted to a file size.");
+            $value = var_export($value, true);
+            throw new LoggerException("Given value [$value] cannot be converted to a file size.");
         }
 
         $str = strtoupper(trim($value));
@@ -170,9 +175,15 @@ class OptionConverter
             $unit = $matches[2];
 
             switch ($unit) {
-                case 'KB': $size *= pow(1024, 1); break;
-                case 'MB': $size *= pow(1024, 2); break;
-                case 'GB': $size *= pow(1024, 3); break;
+                case 'KB':
+                    $size *= pow(1024, 1);
+                    break;
+                case 'MB':
+                    $size *= pow(1024, 2);
+                    break;
+                case 'GB':
+                    $size *= pow(1024, 3);
+                    break;
             }
 
             return (integer) $size;
@@ -200,7 +211,8 @@ class OptionConverter
             return (string) $value;
         }
 
-        throw new LoggerException("Given value [" . var_export($value, true) . "] cannot be converted to string.");
+        $value = var_export($value, true);
+        throw new LoggerException("Given value [$value] cannot be converted to string.");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Helpers/PatternParser.php
----------------------------------------------------------------------
diff --git a/src/Helpers/PatternParser.php b/src/Helpers/PatternParser.php
index 1d9b014..067acd6 100644
--- a/src/Helpers/PatternParser.php
+++ b/src/Helpers/PatternParser.php
@@ -230,7 +230,10 @@ class PatternParser
         // Validate
         $pattern = '/^(-?[0-9]+)?\.?-?[0-9]+$/';
         if (!preg_match($pattern, $modifiers)) {
-            trigger_error("log4php: Invalid modifier in conversion pattern: [$modifiers]. Ignoring modifier.", E_USER_WARNING);
+            trigger_error(
+                "log4php: Invalid modifier in conversion pattern: [$modifiers]. Ignoring modifier.",
+                E_USER_WARNING
+            );
 
             return $info;
         }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Layouts/HtmlLayout.php
----------------------------------------------------------------------
diff --git a/src/Layouts/HtmlLayout.php b/src/Layouts/HtmlLayout.php
index be414d8..e14f5ac 100644
--- a/src/Layouts/HtmlLayout.php
+++ b/src/Layouts/HtmlLayout.php
@@ -152,7 +152,8 @@ class HtmlLayout extends AbstractLayout
         $sbuf .= "</tr>" . PHP_EOL;
 
         if ($event->getNDC() != null) {
-            $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">";
+            $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" ";
+            $sbuf .= "colspan=\"6\" title=\"Nested Diagnostic Context\">";
             $sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES);
             $sbuf .= "</td></tr>" . PHP_EOL;
         }
@@ -165,7 +166,8 @@ class HtmlLayout extends AbstractLayout
      */
     public function getHeader()
     {
-        $sbuf = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . PHP_EOL;
+        $sbuf = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" ";
+        $sbuf .= "\"http://www.w3.org/TR/html4/loose.dtd\">" . PHP_EOL;
         $sbuf .= "<html>" . PHP_EOL;
         $sbuf .= "<head>" . PHP_EOL;
         $sbuf .= "<title>" . $this->title . "</title>" . PHP_EOL;
@@ -180,7 +182,8 @@ class HtmlLayout extends AbstractLayout
         $sbuf .= "<hr size=\"1\" noshade>" . PHP_EOL;
         $sbuf .= "Log session start time " . strftime('%c', time()) . "<br>" . PHP_EOL;
         $sbuf .= "<br>" . PHP_EOL;
-        $sbuf .= "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">" . PHP_EOL;
+        $sbuf .= "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" ";
+        $sbuf .= "bordercolor=\"#224466\" width=\"100%\">" . PHP_EOL;
         $sbuf .= "<tr>" . PHP_EOL;
         $sbuf .= "<th>Time</th>" . PHP_EOL;
         $sbuf .= "<th>Thread</th>" . PHP_EOL;

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Layouts/XmlLayout.php
----------------------------------------------------------------------
diff --git a/src/Layouts/XmlLayout.php b/src/Layouts/XmlLayout.php
index 9a503f8..191b9e8 100644
--- a/src/Layouts/XmlLayout.php
+++ b/src/Layouts/XmlLayout.php
@@ -107,7 +107,8 @@ class XmlLayout extends AbstractLayout
         $thread = $event->getThreadName();
         $level = $event->getLevel()->toString();
 
-        $buf  = "<$ns:event logger=\"{$loggerName}\" level=\"{$level}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
+        $buf  = "<$ns:event logger=\"{$loggerName}\" level=\"{$level}\" thread=\"{$thread}\" ";
+        $buf .= "timestamp=\"{$timeStamp}\">" . PHP_EOL;
         $buf .= "<$ns:message>";
         $buf .= $this->encodeCDATA($event->getRenderedMessage());
         $buf .= "</$ns:message>".PHP_EOL;
@@ -122,7 +123,7 @@ class XmlLayout extends AbstractLayout
         $mdcMap = $event->getMDCMap();
         if (!empty($mdcMap)) {
             $buf .= "<$ns:properties>".PHP_EOL;
-            foreach ($mdcMap as $name=>$value) {
+            foreach ($mdcMap as $name => $value) {
                 $buf .= "<$ns:data name=\"$name\" value=\"$value\" />".PHP_EOL;
             }
             $buf .= "</$ns:properties>".PHP_EOL;
@@ -175,10 +176,10 @@ class XmlLayout extends AbstractLayout
     /**
      * @return boolean
      */
-     public function getLog4jNamespace()
-     {
+    public function getLog4jNamespace()
+    {
          return $this->log4jNamespace;
-     }
+    }
 
     /**
      * @param boolean

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Level.php
----------------------------------------------------------------------
diff --git a/src/Level.php b/src/Level.php
index 0f7ce46..f13dcf9 100644
--- a/src/Level.php
+++ b/src/Level.php
@@ -252,29 +252,44 @@ class Level
     public static function toLevel($arg, $defaultLevel = null)
     {
         if (is_int($arg)) {
-            switch ($arg) {
-                case self::ALL:	return self::getLevelAll();
-                case self::TRACE: return self::getLevelTrace();
-                case self::DEBUG: return self::getLevelDebug();
-                case self::INFO: return self::getLevelInfo();
-                case self::WARN: return self::getLevelWarn();
-                case self::ERROR: return self::getLevelError();
-                case self::FATAL: return self::getLevelFatal();
-                case self::OFF:	return self::getLevelOff();
-                default: return $defaultLevel;
+            if ($arg === self::ALL) {
+                return self::getLevelAll();
+            } elseif ($arg === self::TRACE) {
+                return self::getLevelTrace();
+            } elseif ($arg === self::DEBUG) {
+                return self::getLevelDebug();
+            } elseif ($arg === self::INFO) {
+                return self::getLevelInfo();
+            } elseif ($arg === self::WARN) {
+                return self::getLevelWarn();
+            } elseif ($arg === self::ERROR) {
+                return self::getLevelError();
+            } elseif ($arg === self::FATAL) {
+                return self::getLevelFatal();
+            } elseif ($arg === self::OFF) {
+                return self::getLevelOff();
             }
         } else {
-            switch (strtoupper($arg)) {
-                case 'ALL':	return self::getLevelAll();
-                case 'TRACE': return self::getLevelTrace();
-                case 'DEBUG': return self::getLevelDebug();
-                case 'INFO': return self::getLevelInfo();
-                case 'WARN': return self::getLevelWarn();
-                case 'ERROR': return self::getLevelError();
-                case 'FATAL': return self::getLevelFatal();
-                case 'OFF':	return self::getLevelOff();
-                default: return $defaultLevel;
+            $arg = strtoupper($arg);
+            if ($arg === 'ALL') {
+                return self::getLevelAll();
+            } elseif ($arg === 'TRACE') {
+                return self::getLevelTrace();
+            } elseif ($arg === 'DEBUG') {
+                return self::getLevelDebug();
+            } elseif ($arg === 'INFO') {
+                return self::getLevelInfo();
+            } elseif ($arg === 'WARN') {
+                return self::getLevelWarn();
+            } elseif ($arg === 'ERROR') {
+                return self::getLevelError();
+            } elseif ($arg === 'FATAL') {
+                return self::getLevelFatal();
+            } elseif ($arg === 'OFF') {
+                return self::getLevelOff();
             }
         }
+
+        return $defaultLevel;
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/LocationInfo.php
----------------------------------------------------------------------
diff --git a/src/LocationInfo.php b/src/LocationInfo.php
index 712091b..0c3becd 100644
--- a/src/LocationInfo.php
+++ b/src/LocationInfo.php
@@ -105,5 +105,4 @@ class LocationInfo
     {
         return ($this->fullInfo === null) ? self::LOCATION_INFO_NA : $this->fullInfo;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Logger.php
----------------------------------------------------------------------
diff --git a/src/Logger.php b/src/Logger.php
index fa504b1..f23bd08 100644
--- a/src/Logger.php
+++ b/src/Logger.php
@@ -603,7 +603,11 @@ class Logger
             if ($configurator instanceof Configurator) {
                 return $configurator;
             } else {
-                trigger_error("log4php: Given configurator object [$configurator] does not implement the Configurator interface. Reverting to default configurator.", E_USER_WARNING);
+                trigger_error(
+                    "log4php: Given configurator object [$configurator] does not implement Configurator interface. " .
+                    "Reverting to default configurator.",
+                    E_USER_WARNING
+                );
 
                 return new Configuration\DefaultConfigurator();
             }
@@ -611,7 +615,11 @@ class Logger
 
         if (is_string($configurator)) {
             if (!class_exists($configurator)) {
-                trigger_error("log4php: Specified configurator class [$configurator] does not exist. Reverting to default configurator.", E_USER_WARNING);
+                trigger_error(
+                    "log4php: Given configurator class [$configurator] does not exist. " .
+                    "Reverting to default configurator.",
+                    E_USER_WARNING
+                );
 
                 return new Configuration\DefaultConfigurator();
             }
@@ -619,7 +627,11 @@ class Logger
             $instance = new $configurator();
 
             if (!($instance instanceof Configurator)) {
-                trigger_error("log4php: Specified configurator class [$configurator] does not implement the Configurator interface. Reverting to default configurator.", E_USER_WARNING);
+                trigger_error(
+                    "log4php: Specified configurator class [$configurator] does not implement Configurator interface." .
+                    " Reverting to default configurator.",
+                    E_USER_WARNING
+                );
 
                 return new Configuration\DefaultConfigurator();
             }
@@ -627,7 +639,11 @@ class Logger
             return $instance;
         }
 
-        trigger_error("log4php: Invalid configurator specified. Expected either a string or a Configurator instance. Reverting to default configurator.", E_USER_WARNING);
+        trigger_error(
+            "log4php: Invalid configurator specified. Expected either a string or a Configurator instance. " .
+            "Reverting to default configurator.",
+            E_USER_WARNING
+        );
 
         return new Configuration\DefaultConfigurator();
     }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/LoggingEvent.php
----------------------------------------------------------------------
diff --git a/src/LoggingEvent.php b/src/LoggingEvent.php
index 4187224..8fa5d5f 100644
--- a/src/LoggingEvent.php
+++ b/src/LoggingEvent.php
@@ -143,10 +143,10 @@ class LoggingEvent
      * Returns the full qualified classname.
      * TODO: PHP does contain namespaces in 5.3. Those should be returned too,
      */
-     public function getFullQualifiedClassname()
-     {
-         return $this->fqcn;
-     }
+    public function getFullQualifiedClassname()
+    {
+        return $this->fqcn;
+    }
 
     /**
      * Set the location information for this logging event. The collected
@@ -182,7 +182,7 @@ class LoggingEvent
                 $hop = array_pop($trace);
             }
             $locationInfo['class'] = isset($prevHop['class']) ? $prevHop['class'] : 'main';
-            if(isset($prevHop['function']) and
+            if (isset($prevHop['function']) and
                 $prevHop['function'] !== 'include' and
                 $prevHop['function'] !== 'include_once' and
                 $prevHop['function'] !== 'require' and
@@ -388,7 +388,6 @@ class LoggingEvent
             'locationInfo',
         );
     }
-
 }
 
 LoggingEvent::getStartTime();

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Pattern/AbstractConverter.php
----------------------------------------------------------------------
diff --git a/src/Pattern/AbstractConverter.php b/src/Pattern/AbstractConverter.php
index c3760ab..4f9c46b 100644
--- a/src/Pattern/AbstractConverter.php
+++ b/src/Pattern/AbstractConverter.php
@@ -68,7 +68,10 @@ abstract class AbstractConverter
      * Called in constructor. Converters which need to process the options
      * can override this method.
      */
-    public function activateOptions() { }
+    public function activateOptions()
+    {
+
+    }
 
     /**
      * Converts the logging event to the desired format. Derived pattern
@@ -108,17 +111,16 @@ abstract class AbstractConverter
 
         $len = strlen($string);
 
-        // Trim the string if needed
+        // Trim the string or add padding if needed
         if ($len > $fi->max) {
+            // Trim
             if ($fi->trimLeft) {
                 $sbuf .= substr($string, $len - $fi->max, $fi->max);
             } else {
-                $sbuf .= substr($string , 0, $fi->max);
+                $sbuf .= substr($string, 0, $fi->max);
             }
-        }
-
-        // Add padding if needed
-        else if ($len < $fi->min) {
+        } elseif ($len < $fi->min) {
+            // Pad
             if ($fi->padLeft) {
                 $sbuf .= str_repeat(' ', $fi->min - $len);
                 $sbuf .= $string;
@@ -126,10 +128,8 @@ abstract class AbstractConverter
                 $sbuf .= $string;
                 $sbuf .= str_repeat(' ', $fi->min - $len);
             }
-        }
-
-        // No action needed
-        else {
+        } else {
+            // No action needed
             $sbuf .= $string;
         }
     }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Pattern/ClassConverter.php
----------------------------------------------------------------------
diff --git a/src/Pattern/ClassConverter.php b/src/Pattern/ClassConverter.php
index 5adc46d..cb8d515 100644
--- a/src/Pattern/ClassConverter.php
+++ b/src/Pattern/ClassConverter.php
@@ -50,13 +50,11 @@ class ClassConverter extends AbstractConverter
 
         if (!isset($this->cache[$name])) {
 
-            // If length is set return shortened class name
             if (isset($this->length)) {
+                // If length is set return shortened class name
                 $this->cache[$name] = Utils::shortenClassName($name, $this->length);
-            }
-
-            // If no length is specified return the full class name
-            else {
+            } else {
+                // If no length is specified return the full class name
                 $this->cache[$name] = $name;
             }
         }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Pattern/LoggerConverter.php
----------------------------------------------------------------------
diff --git a/src/Pattern/LoggerConverter.php b/src/Pattern/LoggerConverter.php
index b436fee..0689601 100644
--- a/src/Pattern/LoggerConverter.php
+++ b/src/Pattern/LoggerConverter.php
@@ -52,13 +52,11 @@ class LoggerConverter extends AbstractConverter
 
         if (!isset($this->cache[$name])) {
 
-            // If length is set return shortened logger name
             if (isset($this->length)) {
+                // If length is set return shortened logger name
                 $this->cache[$name] = Utils::shortenClassName($name, $this->length);
-            }
-
-            // If no length is specified return full logger name
-            else {
+            } else {
+                // If no length is specified return full logger name
                 $this->cache[$name] = $name;
             }
         }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Pattern/SuperglobalConverter.php
----------------------------------------------------------------------
diff --git a/src/Pattern/SuperglobalConverter.php b/src/Pattern/SuperglobalConverter.php
index 11431fb..3350044 100644
--- a/src/Pattern/SuperglobalConverter.php
+++ b/src/Pattern/SuperglobalConverter.php
@@ -80,15 +80,13 @@ abstract class SuperglobalConverter extends AbstractConverter
 
         $source = ${$this->name};
 
-        // When the key is set, display the matching value
         if (isset($key)) {
+            // When the key is set, display the matching value
             if (isset($source[$key])) {
                 $this->value = $source[$key];
             }
-        }
-
-        // When the key is not set, display all values
-        else {
+        } else {
+            // When the key is not set, display all values
             $values = array();
             foreach ($source as $key => $value) {
                 $values[] = "$key=$value";

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/ReflectionUtils.php
----------------------------------------------------------------------
diff --git a/src/ReflectionUtils.php b/src/ReflectionUtils.php
index dd9a4da..d5e488f 100644
--- a/src/ReflectionUtils.php
+++ b/src/ReflectionUtils.php
@@ -45,11 +45,12 @@ class ReflectionUtils
      * go. The <code>properties</code> are parsed relative to a
      * <code>prefix</code>.
      *
+     * TODO: check, if this is really useful
+     *
      * @param object $obj        The object to configure.
      * @param array  $properties An array containing keys and values.
      * @param string $prefix     Only keys having the specified prefix will be set.
      */
-     // TODO: check, if this is really useful
     public static function setPropertiesByObject($obj, $properties, $prefix)
     {
         $pSetter = new ReflectionUtils($obj);
@@ -114,7 +115,8 @@ class ReflectionUtils
         $method = "set" . ucfirst($name);
 
         if (!method_exists($this->obj, $method)) {
-            throw new Exception("Error setting log4php property $name to $value: no method $method in class ".get_class($this->obj)."!");
+            $class = get_class($this->obj);
+            throw new Exception("Error setting log4php property $name to $value: no method $method in class $class.");
         } else {
             return call_user_func(array($this->obj, $method), $value);
         }
@@ -159,5 +161,4 @@ class ReflectionUtils
             return false;
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/src/Renderers/RendererMap.php
----------------------------------------------------------------------
diff --git a/src/Renderers/RendererMap.php b/src/Renderers/RendererMap.php
index c3cec35..3cd86fb 100644
--- a/src/Renderers/RendererMap.php
+++ b/src/Renderers/RendererMap.php
@@ -69,14 +69,21 @@ class RendererMap
         }
 
         if (!isset($renderer)) {
-            trigger_error("log4php: Failed adding renderer. Rendering class [$renderingClass] not found.", E_USER_WARNING);
+            trigger_error(
+                "log4php: Failed adding renderer. Rendering class [$renderingClass] not found.",
+                E_USER_WARNING
+            );
 
             return;
         }
 
         // Check the class implements the right interface
         if (!($renderer instanceof RendererInterface)) {
-            trigger_error("log4php: Failed adding renderer. Rendering class [$renderingClass] does not implement the RendererInterface interface.", E_USER_WARNING);
+            trigger_error(
+                "log4php: Failed adding renderer. " .
+                "Rendering class [$renderingClass] does not implement RendererInterface.",
+                E_USER_WARNING
+            );
 
             return;
         }
@@ -101,7 +108,10 @@ class RendererMap
     {
         // Check the class exists
         if (!class_exists($renderingClass)) {
-            trigger_error("log4php: Failed setting default renderer. Rendering class [$renderingClass] not found.", E_USER_WARNING);
+            trigger_error(
+                "log4php: Failed setting default renderer. Rendering class [$renderingClass] not found.",
+                E_USER_WARNING
+            );
 
             return;
         }
@@ -111,7 +121,11 @@ class RendererMap
 
         // Check the class implements the right interface
         if (!($renderer instanceof RendererInterface)) {
-            trigger_error("log4php: Failed setting default renderer. Rendering class [$renderingClass] does not implement the RendererInterface interface.", E_USER_WARNING);
+            trigger_error(
+                "log4php: Failed setting default renderer. " .
+                "Rendering class [$renderingClass] does not implement RendererInterface.",
+                E_USER_WARNING
+            );
 
             return;
         }

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/tests/src/ConfiguratorTest.php
----------------------------------------------------------------------
diff --git a/tests/src/ConfiguratorTest.php b/tests/src/ConfiguratorTest.php
index d38cc0c..2e234ee 100644
--- a/tests/src/ConfiguratorTest.php
+++ b/tests/src/ConfiguratorTest.php
@@ -202,7 +202,7 @@ class CostumDefaultRenderer implements RendererInterface
 
     /**
       * @expectedException PHPUnit_Framework_Error
-      * @expectedExceptionMessage Failed adding renderer. Rendering class [stdClass] does not implement the RendererInterface interface.
+      * @expectedExceptionMessage Failed adding renderer. Rendering class [stdClass] does not implement RendererInterface.
       */
      public function testInvalidRenderingClassSet()
      {

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/tests/src/Configurators/INIAdapterTest.php
----------------------------------------------------------------------
diff --git a/tests/src/Configurators/INIAdapterTest.php b/tests/src/Configurators/INIAdapterTest.php
index 5b950e4..31c8435 100644
--- a/tests/src/Configurators/INIAdapterTest.php
+++ b/tests/src/Configurators/INIAdapterTest.php
@@ -124,7 +124,7 @@ class INIAdapterTest extends \PHPUnit_Framework_TestCase
     /**
      * Test a warning is triggered when configurator doesn't understand a line.
      * @expectedException PHPUnit_Framework_Error
-     * @expectedExceptionMessage log4php: Don't know how to parse the following line: "log4php.appender.default.layout.param.bla = LoggerLayoutTTCC". Skipping.
+     * @expectedExceptionMessage log4php: Don't know how to parse line: "log4php.appender.default.layout.param.bla = LoggerLayoutTTCC". Skipping.
      */
     public function testInvalidLineWarning1()
     {
@@ -136,7 +136,7 @@ class INIAdapterTest extends \PHPUnit_Framework_TestCase
     /**
      * Test a warning is triggered when configurator doesn't understand a line.
      * @expectedException PHPUnit_Framework_Error
-     * @expectedExceptionMessage log4php: Don't know how to parse the following line: "log4php.appender.default.not-layout.param = LoggerLayoutTTCC". Skipping.
+     * @expectedExceptionMessage log4php: Don't know how to parse line: "log4php.appender.default.not-layout.param = LoggerLayoutTTCC". Skipping.
      */
     public function testInvalidLineWarning2()
     {

http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/378ce1a3/tests/src/Renderers/RendererMapTest.php
----------------------------------------------------------------------
diff --git a/tests/src/Renderers/RendererMapTest.php b/tests/src/Renderers/RendererMapTest.php
index 664bb71..8c3bf7e 100644
--- a/tests/src/Renderers/RendererMapTest.php
+++ b/tests/src/Renderers/RendererMapTest.php
@@ -126,7 +126,7 @@ class RendererMapTest extends \PHPUnit_Framework_TestCase
     /**
      * Try adding a class which does not implement RendererInterface as renderer.
      * @expectedException PHPUnit_Framework_Error
-      * @expectedExceptionMessage Failed adding renderer. Rendering class [stdClass] does not implement the RendererInterface interface.
+      * @expectedExceptionMessage Failed adding renderer. Rendering class [stdClass] does not implement RendererInterface.
      */
     public function testAddRendererError2()
     {
@@ -158,7 +158,7 @@ class RendererMapTest extends \PHPUnit_Framework_TestCase
     /**
      * Try setting a class which does not implement RendererInterface as default renderer.
      * @expectedException PHPUnit_Framework_Error
-     * @expectedExceptionMessage Failed setting default renderer. Rendering class [stdClass] does not implement the RendererInterface interface.
+     * @expectedExceptionMessage Failed setting default renderer. Rendering class [stdClass] does not implement RendererInterface.
      */
     public function testSetDefaultRendererError2()
     {


Mime
View raw message