Jordi Boggiano %!s(int64=11) %!d(string=hai) anos
pai
achega
995a61bec8

+ 15 - 0
.php_cs

@@ -0,0 +1,15 @@
+<?php
+
+$finder = Symfony\CS\Finder\DefaultFinder::create()
+    ->files()
+    ->name('*.php')
+    ->in(__DIR__.'/src')
+    ->in(__DIR__.'/tests')
+;
+
+return Symfony\CS\Config\Config::create()
+    ->fixers(array(
+        'psr0', 'encoding', 'short_tag', 'braces', 'elseif', 'eof_ending', 'function_declaration', 'indentation', 'line_after_namespace', 'linefeed', 'lowercase_constants', 'lowercase_keywords', 'multiple_use', 'php_closing_tag', 'trailing_spaces', 'visibility', 'duplicate_semicolon', 'extra_empty_lines', 'include', 'namespace_no_leading_whitespace', 'object_operator', 'operators_spaces', 'phpdoc_params', 'return', 'single_array_no_trailing_comma', 'spaces_cast', 'standardize_not_equal', 'ternary_spaces', 'unused_use', 'whitespacy_lines',
+    ))
+    ->finder($finder)
+;

+ 1 - 1
src/Monolog/Handler/NewRelicHandler.php

@@ -16,7 +16,7 @@ use Monolog\Logger;
 /**
  * Class to record a log on a NewRelic application.
  * Enabling New Relic High Security mode may prevent capture of useful information.
- * 
+ *
  * @see https://docs.newrelic.com/docs/agents/php-agent
  * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security
  */

+ 0 - 1
src/Monolog/Handler/SamplingHandler.php

@@ -11,7 +11,6 @@
 
 namespace Monolog\Handler;
 
-
 /**
  * Sampling handler
  *

+ 2 - 7
src/Monolog/Handler/SlackHandler.php

@@ -157,11 +157,8 @@ class SlackHandler extends SocketHandler
             }
 
             if ($this->includeExtra) {
-
                 if (!empty($record['extra'])) {
-
                     if ($this->useShortAttachment) {
-
                         $attachment['fields'][] = array(
                             'title' => "Extra",
                             'value' => $this->stringify($record['extra']),
@@ -170,7 +167,7 @@ class SlackHandler extends SocketHandler
                     } else {
                         // Add all extra fields as individual fields in attachment
                         foreach ($record['extra'] as $var => $val) {
-                           $attachment['fields'][] = array(
+                            $attachment['fields'][] = array(
                                 'title' => $var,
                                 'value' => $val,
                                 'short' => $this->useShortAttachment
@@ -180,9 +177,7 @@ class SlackHandler extends SocketHandler
                 }
 
                 if (!empty($record['context'])) {
-
                     if ($this->useShortAttachment) {
-
                         $attachment['fields'][] = array(
                             'title' => "Context",
                             'value' => $this->stringify($record['context']),
@@ -191,7 +186,7 @@ class SlackHandler extends SocketHandler
                     } else {
                         // Add all context fields as individual fields in attachment
                         foreach ($record['context'] as $var => $val) {
-                           $attachment['fields'][] = array(
+                            $attachment['fields'][] = array(
                                 'title' => $var,
                                 'value' => $val,
                                 'short' => $this->useShortAttachment

+ 1 - 0
src/Monolog/Registry.php

@@ -72,6 +72,7 @@ class Registry
     {
         if ($logger instanceof Logger) {
             $index = array_search($logger, self::$loggers, true);
+
             return false !== $index;
         } else {
             return isset(self::$loggers[$logger]);

+ 2 - 2
tests/Monolog/Handler/GelfHandlerLegacyTest.php

@@ -24,7 +24,7 @@ class GelfHandlerLegacyTest extends TestCase
             $this->markTestSkipped("mlehner/gelf-php not installed");
         }
 
-        require_once __DIR__ . '/GelfMocks.php';
+        require_once __DIR__ . '/GelfMockMessagePublisher.php';
     }
 
     /**
@@ -45,7 +45,7 @@ class GelfHandlerLegacyTest extends TestCase
 
     protected function getMessagePublisher()
     {
-        return new MockMessagePublisher('localhost');
+        return new GelfMockMessagePublisher('localhost');
     }
 
     public function testDebug()

+ 1 - 1
tests/Monolog/Handler/GelfMocks.php → tests/Monolog/Handler/GelfMockMessagePublisher.php

@@ -14,7 +14,7 @@ namespace Monolog\Handler;
 use Gelf\MessagePublisher;
 use Gelf\Message;
 
-class MockMessagePublisher extends MessagePublisher
+class GelfMockMessagePublisher extends MessagePublisher
 {
     public function publish(Message $message)
     {

+ 2 - 2
tests/Monolog/Handler/RavenHandlerTest.php

@@ -86,12 +86,12 @@ class RavenHandlerTest extends TestCase
     }
 
     public function testUserContext()
-    {        
+    {
         $ravenClient = $this->getRavenClient();
         $handler = $this->getHandler($ravenClient);
 
         $user = array(
-            'id' => '123', 
+            'id' => '123',
             'email' => 'test@test.com'
         );
         $record = $this->getRecord(Logger::INFO, "test", array('user' => $user));

+ 1 - 2
tests/Monolog/RegistryTest.php

@@ -11,8 +11,6 @@
 
 namespace Monolog;
 
-use Monolog\Logger;
-use Monolog\Registry;
 
 class RegistryTest extends \PHPUnit_Framework_TestCase
 {
@@ -40,6 +38,7 @@ class RegistryTest extends \PHPUnit_Framework_TestCase
         $logger1 = new Logger('test1');
         $logger2 = new Logger('test2');
         $logger3 = new Logger('test3');
+
         return array(
             // only instances
             array(