Passed
Push — master ( 778310...fbc9ab )
by Kacper
05:38
created
Parser/OpenRule.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *1
5
- * Copyright (C) 2015, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *1
5
+     * Copyright (C) 2015, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Utils;
17 17
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 {
21 21
     public function match($source)
22 22
     {
23
-        return array_filter(parent::match($source), function (Token $token) {
23
+        return array_filter(parent::match($source), function(Token $token) {
24 24
             if ($token->isEnd()) {
25 25
                 $token->setStart(null);
26 26
 
Please login to merge, or discard this patch.
Parser/TokenFactoryInterface.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *
5
- * Copyright (C) 2015, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *
5
+     * Copyright (C) 2015, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Utils;
17 17
 
Please login to merge, or discard this patch.
Parser/TokenFactory.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *
5
- * Copyright (C) 2015, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *
5
+     * Copyright (C) 2015, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Utils;
17 17
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     public function create($params) {
40 40
         $params[0] = !empty($params[0]) ? $this->getName($params[0]) : $this->_base;
41
-        if(empty($params['rule'])) {
41
+        if (empty($params['rule'])) {
42 42
             $params['rule'] = $this->_rule;
43 43
         }
44 44
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function setClass($class)
103 103
     {
104
-        if(!is_a($class, 'Kadet\Highlighter\Parser\Token', true)) {
104
+        if (!is_a($class, 'Kadet\Highlighter\Parser\Token', true)) {
105 105
             throw new \InvalidArgumentException('$class must extend Kadet\Highlighter\Parser\Token');
106 106
         }
107 107
 
Please login to merge, or discard this patch.
Formatter/FormatterInterface.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *
5
- * Copyright (C) 2015, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *
5
+     * Copyright (C) 2015, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Utils;
17 17
 
Please login to merge, or discard this patch.
Formatter/HtmlFormatter.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *
5
- * Copyright (C) 2015, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *
5
+     * Copyright (C) 2015, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Utils;
17 17
 
Please login to merge, or discard this patch.
Language/LatexLanguage.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *
5
- * Copyright (C) 2016, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *
5
+     * Copyright (C) 2016, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Language;
17 17
 
Please login to merge, or discard this patch.
Matcher/SubStringMatcher.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *1
5
- * Copyright (C) 2015, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *1
5
+     * Copyright (C) 2015, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Utils;
17 17
 
Please login to merge, or discard this patch.
Utils/Console.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     ];
32 32
 
33 33
     public static function styled($style, $text) {
34
-        return self::open($style).$text.self::close();
34
+        return self::open($style) . $text . self::close();
35 35
     }
36 36
 
37 37
     public static function open($style)
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public static function close()
49 49
     {
50 50
         self::$_current = empty(self::$_stack) ? self::$_default : array_pop(self::$_stack);
51
-        return "\033[0m".self::_set(array_diff(self::$_current, self::$_default));
51
+        return "\033[0m" . self::_set(array_diff(self::$_current, self::$_default));
52 52
     }
53 53
 
54 54
     private static function _color($name, $bg = false)
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     }
78 78
 
79 79
     private static function _style($name, $value) {
80
-        switch($name) {
80
+        switch ($name) {
81 81
             case 'color':
82 82
                 return self::_color($value);
83 83
             case 'background':
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
     }
99 99
 
100 100
     private static function _set($style) {
101
-        $escape = "\033[".implode(';', array_map(function($style, $name) {
101
+        $escape = "\033[" . implode(';', array_map(function($style, $name) {
102 102
                 return self::_style($style, $name);
103
-            }, array_keys($style), $style)).'m';
103
+            }, array_keys($style), $style)) . 'm';
104 104
 
105 105
         return $escape;
106 106
     }
Please login to merge, or discard this patch.
KeyLighter.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *
5
- * Copyright (C) 2015, Some right reserved.
6
- *
7
- * @author Kacper "Kadet" Donat <[email protected]>
8
- *
9
- * Contact with author:
10
- * Xmpp: [email protected]
11
- * E-mail: [email protected]
12
- *
13
- * From Kadet with love.
14
- */
3
+     * Highlighter
4
+     *
5
+     * Copyright (C) 2015, Some right reserved.
6
+     *
7
+     * @author Kacper "Kadet" Donat <[email protected]>
8
+     *
9
+     * Contact with author:
10
+     * Xmpp: [email protected]
11
+     * E-mail: [email protected]
12
+     *
13
+     * From Kadet with love.
14
+     */
15 15
 
16 16
 namespace Kadet\Highlighter\Utils;
17 17
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public static function getLanguage($name) {
38 38
         $embedded = [];
39
-        if(($pos = strpos($name, '>')) !== false) {
39
+        if (($pos = strpos($name, '>')) !== false) {
40 40
             $embedded[] = self::getLanguage(trim(substr($name, $pos + 1)));
41 41
             $name       = trim(substr($name, 0, $pos));
42 42
         }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     public static function highlight($source, $language, FormatterInterface $formatter = null) {
71 71
         $formatter = $formatter ?: self::getDefaultFormatter();
72 72
 
73
-        if(!$language instanceof Language) {
73
+        if (!$language instanceof Language) {
74 74
             $language = self::getLanguage($language);
75 75
         }
76 76
 
@@ -82,8 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 KeyLighter::setDefaultFormatter(
84 84
     php_sapi_name() === 'cli' ?
85
-        new CliFormatter() :
86
-        new HtmlFormatter()
85
+        new CliFormatter() : new HtmlFormatter()
87 86
 );
88 87
 
89 88
 KeyLighter::registerLanguage('Kadet\\Highlighter\\Language\\PhpLanguage', ['php']);
Please login to merge, or discard this patch.