Passed
Push — master ( f69297...3e2d50 )
by Mauro
01:04 queued 14s
created
src/WholeTextFinder.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
         preg_match_all($patternAndHaystack['pattern'], $patternAndHaystack['haystack'], $matches, PREG_OFFSET_CAPTURE);
26 26
 
27
-        if($skipHtmlEntities === true){
27
+        if ($skipHtmlEntities === true) {
28 28
             $patternAndHaystack['haystack'] = Strings::unprotectHTMLTags($patternAndHaystack['haystack']);
29 29
         }
30 30
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @return mixed
43 43
      */
44
-    private static function mbCorrectMatchPositions( $haystack, &$matches)
44
+    private static function mbCorrectMatchPositions($haystack, &$matches)
45 45
     {
46
-        if(!Strings::isMultibyte($haystack) ){
46
+        if (!Strings::isMultibyte($haystack)) {
47 47
             return $matches[0];
48 48
         }
49 49
 
50
-        foreach ($matches[0] as $index => $match){
50
+        foreach ($matches[0] as $index => $match) {
51 51
             $word = $match[0];
52 52
             $position = $match[1];
53 53
 
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
      *
64 64
      * @return int
65 65
      */
66
-    private static function mbFindTheCorrectPosition( $haystack, $word, &$position)
66
+    private static function mbFindTheCorrectPosition($haystack, $word, &$position)
67 67
     {
68 68
         $wordCheck = mb_substr($haystack, $position, mb_strlen($word));
69 69
 
70
-        if($wordCheck !== $word){
70
+        if ($wordCheck !== $word) {
71 71
             $position = $position - 1;
72 72
 
73 73
             self::mbFindTheCorrectPosition($haystack, $word, $position);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $patternAndHaystack = self::getPatternAndHaystack($haystack, $needle, $skipHtmlEntities, $exactMatch, $caseSensitive, $preserveNbsps);
138 138
         $replacement = Replacer::replace($patternAndHaystack['pattern'], $replacement, $patternAndHaystack['haystack']);
139 139
 
140
-        if($skipHtmlEntities === true){
140
+        if ($skipHtmlEntities === true) {
141 141
             $replacement = Strings::unprotectHTMLTags($replacement);
142 142
         }
143 143
 
Please login to merge, or discard this patch.
src/Helper/Replacer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,6 +44,6 @@
 block discarded – undo
44 44
      */
45 45
     private static function getModifiedRegexPattern($pattern)
46 46
     {
47
-        return '/(\|\|\|\||<.*?>|&lt;.*?&gt;|%{.*?})(*SKIP)(*FAIL)|'. ltrim($pattern, $pattern[0]);
47
+        return '/(\|\|\|\||<.*?>|&lt;.*?&gt;|%{.*?})(*SKIP)(*FAIL)|' . ltrim($pattern, $pattern[0]);
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
src/Helper/Strings.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public static function htmlEntityDecode($string)
23 23
     {
24
-        return html_entity_decode($string, ENT_QUOTES|ENT_XHTML, 'UTF-8');
24
+        return html_entity_decode($string, ENT_QUOTES | ENT_XHTML, 'UTF-8');
25 25
     }
26 26
 
27 27
     /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public static function contains($needle, $haystack)
71 71
     {
72
-        if(empty($haystack)){
72
+        if (empty($haystack)) {
73 73
             return false;
74 74
         }
75 75
 
@@ -94,34 +94,34 @@  discard block
 block discarded – undo
94 94
     {
95 95
         preg_match_all('/&lt;(.*?)&gt;|<(.*?)>/sm', $string, $matches);
96 96
 
97
-        if(!empty($matches[0])){
98
-            foreach ($matches[0] as $index => $element){
97
+        if (!empty($matches[0])) {
98
+            foreach ($matches[0] as $index => $element) {
99 99
 
100 100
                 $tag = explode(" ", $element);
101 101
                 $tag = str_replace(["<", ">", "&lt;", "&gt;", "/"], "", $tag[0]);
102 102
 
103 103
                 // opening tags
104
-                if(!self::contains("/", $element)){
104
+                if (!self::contains("/", $element)) {
105 105
 
106 106
                     $tagMatch = false;
107 107
 
108 108
                     // check for the closing tag
109
-                    for($i = ($index+1); $i < count($matches[0]); $i++){
109
+                    for ($i = ($index + 1); $i < count($matches[0]); $i++) {
110 110
                         $nextElement = $matches[0][$i] ?? null;
111 111
 
112
-                        if($nextElement === null){
112
+                        if ($nextElement === null) {
113 113
                             continue;
114 114
                         }
115 115
 
116 116
                         $nextTag = explode(" ", $nextElement);
117 117
                         $nextTag = str_replace(["<", ">", "&lt;", "&gt;", "/"], "", $nextTag[0]);
118 118
 
119
-                        if($nextTag === $tag){
119
+                        if ($nextTag === $tag) {
120 120
                             $tagMatch = true;
121 121
                         }
122 122
                     }
123 123
 
124
-                    if($tagMatch === false){
124
+                    if ($tagMatch === false) {
125 125
                         continue;
126 126
                     }
127 127
                 }
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
                     $closingTag = explode(" ", $element);
131 131
                     $closingTag = str_replace(["<", ">", "&lt;", "&gt;"], "", $closingTag[0]);
132 132
 
133
-                    if(empty($closingTag)){
133
+                    if (empty($closingTag)) {
134 134
                         continue;
135 135
                     }
136 136
 
137
-                    if(!(self::firstChar($closingTag) === "/" or self::lastChar($closingTag) === "/")){
137
+                    if (!(self::firstChar($closingTag) === "/" or self::lastChar($closingTag) === "/")) {
138 138
                         continue;
139 139
                     }
140 140
                 }
Please login to merge, or discard this patch.