Passed
Push — master ( 46ff04...839992 )
by Berend
06:11
created
src/LogHandler.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -21,36 +21,36 @@
 block discarded – undo
21 21
  */
22 22
 class LogHandler implements LogHandlerInterface
23 23
 {
24
-	const DEFAULT_PATH = '.logger';
25
-	const DEFAULT_EXTENSION = '.log';
26
-
27
-	/** @var string The path. */
28
-	private $path;
29
-
30
-	/**
31
-	 * Construct a log handler object with the given path.
32
-	 *
33
-	 * @param string $path = self::DEFAULT_PATH
34
-	 */
35
-	public function __construct($path = self::DEFAULT_PATH)
36
-	{
37
-		$this->path = $path;
38
-	}
39
-
40
-	/**
41
-	 * {@inheritdoc}
42
-	 */
43
-	public function update(SubjectInterface $subject, $arguments = null)
44
-	{
45
-		// Check instance
46
-		if (!$arguments instanceof LogRecord) {
47
-			return;
48
-		}
49
-
50
-		// Create file
51
-		$file = new File($this->path . DIRECTORY_SEPARATOR . strtolower($arguments->getLevel()) . static::DEFAULT_EXTENSION);
52
-
53
-		// Append message
54
-		$file->append((new \DateTime())->format('Y-m-d H:i:s') . ' - ' . $arguments->getMessage() . PHP_EOL);
55
-	}
24
+    const DEFAULT_PATH = '.logger';
25
+    const DEFAULT_EXTENSION = '.log';
26
+
27
+    /** @var string The path. */
28
+    private $path;
29
+
30
+    /**
31
+     * Construct a log handler object with the given path.
32
+     *
33
+     * @param string $path = self::DEFAULT_PATH
34
+     */
35
+    public function __construct($path = self::DEFAULT_PATH)
36
+    {
37
+        $this->path = $path;
38
+    }
39
+
40
+    /**
41
+     * {@inheritdoc}
42
+     */
43
+    public function update(SubjectInterface $subject, $arguments = null)
44
+    {
45
+        // Check instance
46
+        if (!$arguments instanceof LogRecord) {
47
+            return;
48
+        }
49
+
50
+        // Create file
51
+        $file = new File($this->path . DIRECTORY_SEPARATOR . strtolower($arguments->getLevel()) . static::DEFAULT_EXTENSION);
52
+
53
+        // Append message
54
+        $file->append((new \DateTime())->format('Y-m-d H:i:s') . ' - ' . $arguments->getMessage() . PHP_EOL);
55
+    }
56 56
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@
 block discarded – undo
48 48
 		}
49 49
 
50 50
 		// Create file
51
-		$file = new File($this->path . DIRECTORY_SEPARATOR . strtolower($arguments->getLevel()) . static::DEFAULT_EXTENSION);
51
+		$file = new File($this->path.DIRECTORY_SEPARATOR.strtolower($arguments->getLevel()).static::DEFAULT_EXTENSION);
52 52
 
53 53
 		// Append message
54
-		$file->append((new \DateTime())->format('Y-m-d H:i:s') . ' - ' . $arguments->getMessage() . PHP_EOL);
54
+		$file->append((new \DateTime())->format('Y-m-d H:i:s').' - '.$arguments->getMessage().PHP_EOL);
55 55
 	}
56 56
 }
Please login to merge, or discard this patch.
src/LogRecord.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -18,56 +18,56 @@
 block discarded – undo
18 18
  */
19 19
 class LogRecord
20 20
 {
21
-	/** @var string The log records level. */
22
-	private $level;
21
+    /** @var string The log records level. */
22
+    private $level;
23 23
 
24
-	/** @var string The log record message. */
25
-	private $message;
24
+    /** @var string The log record message. */
25
+    private $message;
26 26
 
27
-	/** @var mixed[] The log record context. */
28
-	private $context;
27
+    /** @var mixed[] The log record context. */
28
+    private $context;
29 29
 
30
-	/**
31
-	 * Construct a log record object with the given level, message & context.
32
-	 *
33
-	 * @param string $level
34
-	 * @param string $message
35
-	 * @param mixed[] $context = []
36
-	 */
37
-	public function __construct($level, $message, array $context = [])
38
-	{
39
-		$this->level = $level;
40
-		$this->message = $message;
41
-		$this->context = $context;
42
-	}
30
+    /**
31
+     * Construct a log record object with the given level, message & context.
32
+     *
33
+     * @param string $level
34
+     * @param string $message
35
+     * @param mixed[] $context = []
36
+     */
37
+    public function __construct($level, $message, array $context = [])
38
+    {
39
+        $this->level = $level;
40
+        $this->message = $message;
41
+        $this->context = $context;
42
+    }
43 43
 
44
-	/**
45
-	 * Returns the level.
46
-	 *
47
-	 * @return string the level.
48
-	 */
49
-	public function getLevel()
50
-	{
51
-		return $this->level;
52
-	}
44
+    /**
45
+     * Returns the level.
46
+     *
47
+     * @return string the level.
48
+     */
49
+    public function getLevel()
50
+    {
51
+        return $this->level;
52
+    }
53 53
 
54
-	/**
55
-	 * Returns the message.
56
-	 *
57
-	 * @return string the message.
58
-	 */
59
-	public function getMessage()
60
-	{
61
-		return $this->message;
62
-	}
54
+    /**
55
+     * Returns the message.
56
+     *
57
+     * @return string the message.
58
+     */
59
+    public function getMessage()
60
+    {
61
+        return $this->message;
62
+    }
63 63
 
64
-	/**
65
-	 * Returns the context.
66
-	 *
67
-	 * @return mixed[] the context.
68
-	 */
69
-	public function getContext()
70
-	{
71
-		return $this->context;
72
-	}
64
+    /**
65
+     * Returns the context.
66
+     *
67
+     * @return mixed[] the context.
68
+     */
69
+    public function getContext()
70
+    {
71
+        return $this->context;
72
+    }
73 73
 }
Please login to merge, or discard this patch.
src/Logger.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -23,21 +23,21 @@
 block discarded – undo
23 23
  */
24 24
 class Logger extends AbstractLogger implements SubjectInterface
25 25
 {
26
-	use SubjectTrait;
26
+    use SubjectTrait;
27 27
 
28
-	/**
29
-	 * Construct a logger object.
30
-	 */
31
-	public function __construct()
32
-	{
28
+    /**
29
+     * Construct a logger object.
30
+     */
31
+    public function __construct()
32
+    {
33 33
 
34
-	}
34
+    }
35 35
 
36
-	/**
37
-	 * {@inheritdoc}
38
-	 */
39
-	public function log($level, $message, array $context = [])
40
-	{
41
-		$this->notify(new LogRecord($level, $message, $context));
42
-	}
36
+    /**
37
+     * {@inheritdoc}
38
+     */
39
+    public function log($level, $message, array $context = [])
40
+    {
41
+        $this->notify(new LogRecord($level, $message, $context));
42
+    }
43 43
 }
Please login to merge, or discard this patch.