Passed
Pull Request — master (#6)
by Arjan
04:50
created
src/Placeholders/WhitespacePlaceholder.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace ArjanSchouten\HtmlMinifier\Placeholders;
4 4
 
5 5
 use ArjanSchouten\HtmlMinifier\PlaceholderContainer;
6
-use ArjanSchouten\HtmlMinifier\Repositories\HtmlInlineElementsRepository;
7 6
 
8 7
 class WhitespacePlaceholder implements PlaceholderInterface
9 8
 {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 \s+                             # Match minimal 1 whitespace between the elements
64 64
                 <('.$elementsRegex.')           # Match the start of the next inline element
65 65
             /xi',
66
-            function ($match) use ($placeholderContainer) {
66
+            function($match) use ($placeholderContainer) {
67 67
                 // Where going to respect one space between the inline elements.
68 68
                 $placeholder = $placeholderContainer->createPlaceholder(' ');
69 69
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 )
94 94
                 <('.$elementsRegex.')       # Match starting tag
95 95
             /xis',
96
-            function ($match) use ($placeholderContainer) {
96
+            function($match) use ($placeholderContainer) {
97 97
                 return $this->replaceWhitespacesInInlineElements($match[1], $placeholderContainer).'<'.$match[3];
98 98
             }, $contents);
99 99
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     private function replaceWhitespacesInInlineElements($element, PlaceholderContainer $placeholderContainer)
110 110
     {
111
-        return preg_replace_callback('/>\s/', function ($match) use ($placeholderContainer) {
111
+        return preg_replace_callback('/>\s/', function($match) use ($placeholderContainer) {
112 112
             return '>'.$placeholderContainer->createPlaceholder(' ');
113 113
         }, $element);
114 114
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             ((?:(?!<\/\2>).)+)
135 135
             (<\/\2>)/xis';
136 136
 
137
-        return preg_replace_callback($pattern, function ($match) use ($placeholderContainer) {
137
+        return preg_replace_callback($pattern, function($match) use ($placeholderContainer) {
138 138
             return $match[1].$placeholderContainer->createPlaceholder($match[3]).$match[4];
139 139
         }, $contents);
140 140
     }
Please login to merge, or discard this patch.
src/Minifiers/Html/AttributeQuoteMinifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
                             )*                              # special part of "unrolling the loop"
49 49
                     )       # use a the "unrolling the loop" technique to be able to skip escaped quotes like ="\""
50 50
                 \1?         # match the same quote symbol as matched before
51
-            /x', function ($match) {
51
+            /x', function($match) {
52 52
             return $this->minifyAttribute($match);
53 53
         }, $context->getContents()));
54 54
     }
Please login to merge, or discard this patch.
src/Minifiers/Html/BooleanAttributeMinifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
                 ([\'"])?                    # optional to use a quote
32 32
                 (\1|true|false|([\s>"\']))    # match the boolean attribute name again or true|false
33 33
                 \2?                         # match the quote again
34
-            /xi', function ($match) {
34
+            /xi', function($match) {
35 35
                 if (isset($match[4])) {
36 36
                     return ' '.$match[1];
37 37
                 }
Please login to merge, or discard this patch.
src/Minifiers/Html/CommentMinifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
                 <!          # search for the start of a comment
24 24
                     [^>]*   # search for everything without a ">"
25 25
                 >           # match the end of the comment
26
-            /xs', function ($match) {
26
+            /xs', function($match) {
27 27
             if (Str::contains(strtolower($match[0]), 'doctype')) {
28 28
                 return $match[0];
29 29
             }
Please login to merge, or discard this patch.
src/Minifiers/Html/EmptyAttributeMinifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
                 \2                                              # Backreference to the matched quote
37 37
                 \s*
38 38
             /x',
39
-            function ($match) {
39
+            function($match) {
40 40
                 if ($this->isBooleanAttribute($match[1])) {
41 41
                     return Html::isLastAttribute($match[0]) ? $match[1] : $match[1].' ';
42 42
                 }
Please login to merge, or discard this patch.
src/Minifiers/Html/JavascriptEventsMinifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
                 ["\']?              # Match an optional quote
26 26
                 \s*javascript:      # Match the text "javascript:" which should be removed
27 27
             /xis',
28
-            function ($match) {
28
+            function($match) {
29 29
                 return str_replace('javascript:', '', $match[0]);
30 30
             }, $context->getContents());
31 31
 
Please login to merge, or discard this patch.
src/Minifiers/Html/RedundantAttributeMinifier.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function process(MinifyContext $context)
42 42
     {
43
-        Collection::make($this->redundantAttributes)->each(function ($attributes, $element) use (&$context) {
44
-            Collection::make($attributes)->each(function ($value, $attribute) use ($element, &$context) {
43
+        Collection::make($this->redundantAttributes)->each(function($attributes, $element) use (&$context) {
44
+            Collection::make($attributes)->each(function($value, $attribute) use ($element, &$context) {
45 45
                 $contents = preg_replace_callback(
46 46
                     '/
47 47
                         '.$element.'                    # Match the given element
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                             \s*
56 56
                         )
57 57
                     /xis',
58
-                    function ($match) {
58
+                    function($match) {
59 59
                         return $this->removeAttribute($match[0], $match[2]);
60 60
                     }, $context->getContents());
61 61
 
Please login to merge, or discard this patch.
src/Statistics/ReferencePoint.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     }
38 38
 
39 39
     /**
40
-     * @return float
40
+     * @return integer
41 41
      */
42 42
     public function getKiloBytes()
43 43
     {
Please login to merge, or discard this patch.
src/Statistics/StatisticsInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     /**
18 18
      * Get all the steps which are measured.
19 19
      *
20
-     * @return array
20
+     * @return ReferencePoint[]
21 21
      */
22 22
     public function getReferencePoints();
23 23
 
Please login to merge, or discard this patch.