Completed
Push — master ( 7161cd...80db05 )
by Schlaefer
14s
created
plugins/BbcodeParser/tests/TestCase/Lib/BbcodeParserTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
     {
303 303
         $input = '@Alice @Bob @Bobby Junior @Bobby Tables @Dr. No';
304 304
         $expected =
305
-            "<a href='/at/Alice'>@Alice</a>" .
306
-            " @Bob " .
307
-            "<a href='/at/Bobby+Junior'>@Bobby Junior</a>" .
308
-            " @Bobby Tables " .
305
+            "<a href='/at/Alice'>@Alice</a>".
306
+            " @Bob ".
307
+            "<a href='/at/Bobby+Junior'>@Bobby Junior</a>".
308
+            " @Bobby Tables ".
309 309
             "<a href='/at/Dr.+No'>@Dr. No</a>";
310 310
 
311 311
         $result = $this->_Parser->parse($input);
@@ -634,8 +634,8 @@  discard block
 block discarded – undo
634 634
     public function testIframe()
635 635
     {
636 636
         //* test allowed domain
637
-        $input = '[iframe height=349 width=560 ' .
638
-            'src=http://www.youtube.com/embed/HdoW3t_WorU ' .
637
+        $input = '[iframe height=349 width=560 '.
638
+            'src=http://www.youtube.com/embed/HdoW3t_WorU '.
639 639
             'frameborder=0][/iframe]';
640 640
         $expected = [
641 641
             [
@@ -659,8 +659,8 @@  discard block
 block discarded – undo
659 659
         $this->assertHtml($expected, $result);
660 660
 
661 661
         //* test forbidden domains
662
-        $input = '[iframe height=349 width=560 ' .
663
-            'src=http://www.youtubescam.com/embed/HdoW3t_WorU ' .
662
+        $input = '[iframe height=349 width=560 '.
663
+            'src=http://www.youtubescam.com/embed/HdoW3t_WorU '.
664 664
             'frameborder=0][/iframe]';
665 665
         $pattern = '/src/i';
666 666
         $result = $this->_Parser->parse(
@@ -672,8 +672,8 @@  discard block
 block discarded – undo
672 672
 
673 673
     public function testIframeAllDomainsAllowed()
674 674
     {
675
-        $input = '[iframe height=349 width=560 ' .
676
-            'src=http://www.youtubescam.com/embed/HdoW3t_WorU ' .
675
+        $input = '[iframe height=349 width=560 '.
676
+            'src=http://www.youtubescam.com/embed/HdoW3t_WorU '.
677 677
             '][/iframe]';
678 678
         $expected = 'src="http://www.youtubescam.com/embed/HdoW3t_WorU';
679 679
         $this->MarkupSettings->setSingle('video_domains_allowed', '*');
@@ -683,8 +683,8 @@  discard block
 block discarded – undo
683 683
 
684 684
     public function testIframeNoDomainAllowed()
685 685
     {
686
-        $input = '[iframe height=349 width=560 ' .
687
-            'src=http://www.youtubescam.com/embed/HdoW3t_WorU ' .
686
+        $input = '[iframe height=349 width=560 '.
687
+            'src=http://www.youtubescam.com/embed/HdoW3t_WorU '.
688 688
             '][/iframe]';
689 689
         $expected = '/src/i';
690 690
         $result = $this->_Parser->parse(
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
     {
935 935
         // [code]<citation mark>[/code] should not be cited
936 936
         $input = h(
937
-            "[code]\n" . $this->_Helper->getConfig('quote_symbol') . "\n[/code]"
937
+            "[code]\n".$this->_Helper->getConfig('quote_symbol')."\n[/code]"
938 938
         );
939 939
         $expected = '`span class=.*?richtext-citation`';
940 940
         $result = $this->_Parser->parse($input);
@@ -951,11 +951,11 @@  discard block
 block discarded – undo
951 951
     public function testQuote()
952 952
     {
953 953
         $_qs = $this->MarkupSettings->get('quote_symbol');
954
-        $input = $_qs . ' fo [b]test[/b] ba';
954
+        $input = $_qs.' fo [b]test[/b] ba';
955 955
         $result = $this->_Parser->parse($input);
956 956
         $expected = [
957 957
             'span' => ['class' => 'richtext-citation'],
958
-            $_qs . ' fo ',
958
+            $_qs.' fo ',
959 959
             'strong' => [],
960 960
             'test',
961 961
             '/strong',
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
         //* test autoconversion for audio files
988 988
         $html5AudioExtensions = ['m4a', 'ogg', 'mp3', 'wav', 'opus'];
989 989
         foreach ($html5AudioExtensions as $extension) {
990
-            $url = 'http://example.com/audio.' . $extension;
990
+            $url = 'http://example.com/audio.'.$extension;
991 991
             $input = "[video]{$url}[/video]";
992 992
             $result = $this->_Parser->parse($input);
993 993
             $expected = [
Please login to merge, or discard this patch.
plugins/BbcodeParser/src/Lib/Helper/UrlParserTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $validator->add('url', ['url' => ['rule' => 'url']]);
64 64
             $errors = $validator->errors(['url' => $url]);
65 65
             if (empty($errors)) {
66
-                $url = 'http://' . $url;
66
+                $url = 'http://'.$url;
67 67
             }
68 68
         }
69 69
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             if (!empty($url) && preg_match('/\<img\s*?src=/', $text) !== 1) {
80 80
                 $host = DomainParser::domainAndTld($url);
81 81
                 if ($host !== false && $host !== env('SERVER_NAME')) {
82
-                    $out .= ' <span class=\'richtext-linkInfo\'>[' . $host . ']</span>';
82
+                    $out .= ' <span class=\'richtext-linkInfo\'>['.$host.']</span>';
83 83
                 }
84 84
             }
85 85
         }
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
         }
113 113
 
114 114
         $_placeholder = ' … ';
115
-        $leftMargin = (int)floor($_textWordMaxLength / 2);
116
-        $rightMargin = (int)(-1 * ($_textWordMaxLength - $leftMargin - mb_strlen($_placeholder)));
115
+        $leftMargin = (int) floor($_textWordMaxLength / 2);
116
+        $rightMargin = (int) (-1 * ($_textWordMaxLength - $leftMargin - mb_strlen($_placeholder)));
117 117
 
118
-        $string = mb_substr($string, 0, $leftMargin) . $_placeholder .
118
+        $string = mb_substr($string, 0, $leftMargin).$_placeholder.
119 119
             mb_substr($string, $rightMargin);
120 120
 
121 121
         return $string;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     protected function _decorateTarget($string)
132 132
     {
133
-        $decorator = function ($matches) {
133
+        $decorator = function($matches) {
134 134
             $out = '';
135 135
             $url = $matches[1];
136 136
 
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
             $parsedUrl = parse_url($url);
142 142
 
143 143
             if (isset($parsedUrl['host'])) {
144
-                if ($parsedUrl['host'] !== env('SERVER_NAME') && $parsedUrl['host'] !== "www." . env('SERVER_NAME')) {
144
+                if ($parsedUrl['host'] !== env('SERVER_NAME') && $parsedUrl['host'] !== "www.".env('SERVER_NAME')) {
145 145
                     $out = " rel='external' target='_blank'";
146 146
                 }
147 147
             }
148 148
 
149
-            return $matches[0] . $out;
149
+            return $matches[0].$out;
150 150
         };
151 151
 
152 152
         return preg_replace_callback(
Please login to merge, or discard this patch.
plugins/BbcodeParser/src/Lib/Markup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 }
122 122
                 // add newline to wrapped lines
123 123
                 if (mb_strlen($line) > 60) {
124
-                    $out .= $line . "\n";
124
+                    $out .= $line."\n";
125 125
                     $line = '';
126 126
                 }
127 127
             }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         }
130 130
         $out = preg_replace(
131 131
             "/^/m",
132
-            $quoteSymbol . " ",
132
+            $quoteSymbol." ",
133 133
             $out
134 134
         );
135 135
 
Please login to merge, or discard this patch.
plugins/BbcodeParser/src/Lib/Processors/BbcodeQuotePostprocessor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@
 block discarded – undo
13 13
         $quoteSymbolSanitized = h($this->_sOptions->get('quote_symbol'));
14 14
         $string = preg_replace(
15 15
             // Begin of the text or a new line in the text, maybe one space afterwards
16
-            '/(^|\n\r\s?)' .
17
-            $quoteSymbolSanitized .
16
+            '/(^|\n\r\s?)'.
17
+            $quoteSymbolSanitized.
18 18
             '\s(.*)(?!\<br)/m',
19
-            "\\1<span class=\"richtext-citation\">" . $quoteSymbolSanitized . " \\2</span>",
19
+            "\\1<span class=\"richtext-citation\">".$quoteSymbolSanitized." \\2</span>",
20 20
             $string
21 21
         );
22 22
 
Please login to merge, or discard this patch.
plugins/BbcodeParser/src/Lib/jBBCode/Visitors/JbbCodeAutolinkVisitor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
             }
70 70
         }
71 71
         krsort($names);
72
-        $baseUrl = $this->_sOptions->get('webroot') . $this->_sOptions->get('atBaseUrl');
72
+        $baseUrl = $this->_sOptions->get('webroot').$this->_sOptions->get('atBaseUrl');
73 73
         foreach ($names as $name => $v) {
74 74
             $title = urlencode($name);
75 75
             $link = $this->_url(
76
-                $baseUrl . $title,
76
+                $baseUrl.$title,
77 77
                 "@$name",
78 78
                 false
79 79
             );
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
      */
93 93
     protected function _autolink($string)
94 94
     {
95
-        $replace = function ($matches) {
95
+        $replace = function($matches) {
96 96
             // exclude punctuation at end of sentence from URLs
97 97
             $ignoredEndChars = implode('|', [',', '\?', ',', '\.', '\)', '!']);
98 98
             preg_match(
99
-                '/(?P<element>.*?)(?P<suffix>' . $ignoredEndChars . ')?$/',
99
+                '/(?P<element>.*?)(?P<suffix>'.$ignoredEndChars.')?$/',
100 100
                 $matches['element'],
101 101
                 $m
102 102
             );
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $matches = $m + $matches;
105 105
 
106 106
             if (strpos($matches['element'], '://') === false) {
107
-                $matches['element'] = 'http://' . $matches['element'];
107
+                $matches['element'] = 'http://'.$matches['element'];
108 108
             }
109 109
             $matches += [
110 110
                 'prefix' => '',
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 true
119 119
             );
120 120
 
121
-            return $matches['prefix'] . $url . $matches['suffix'];
121
+            return $matches['prefix'].$url.$matches['suffix'];
122 122
         };
123 123
 
124 124
         //# autolink http://urls
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         //# autolink email
139 139
         $string = preg_replace_callback(
140 140
             "#(?<=^|[\n ])(?P<content>([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+))#i",
141
-            function ($matches) {
141
+            function($matches) {
142 142
                 return $this->_email($matches['content']);
143 143
             },
144 144
             $string
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
      */
157 157
     protected function _hashLink($string)
158 158
     {
159
-        $baseUrl = $this->_sOptions->get('webroot') . $this->_sOptions->get('hashBaseUrl');
159
+        $baseUrl = $this->_sOptions->get('webroot').$this->_sOptions->get('hashBaseUrl');
160 160
         $string = preg_replace_callback(
161 161
             '/(?<=\s|^|])(?<tag>#)(?<element>\d+)(?!\w)/',
162
-            function ($m) use ($baseUrl) {
162
+            function($m) use ($baseUrl) {
163 163
                 $hash = $m['element'];
164 164
 
165
-                return $this->_url($baseUrl . $hash, '#' . $hash);
165
+                return $this->_url($baseUrl.$hash, '#'.$hash);
166 166
             },
167 167
             $string
168 168
         );
Please login to merge, or discard this patch.
plugins/BbcodeParser/src/Lib/jBBCode/Definitions/JbbCodeCodeDefinition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         // load config from app/Config/geshi.php
25 25
         $this->Geshi->features = false;
26 26
 
27
-        $string = '<div class="geshi-wrapper"><pre lang="' . $type . '">' . $content . '</pre></div>';
27
+        $string = '<div class="geshi-wrapper"><pre lang="'.$type.'">'.$content.'</pre></div>';
28 28
 
29 29
         $string = $this->Geshi->highlight($string);
30 30
 
Please login to merge, or discard this patch.
BbcodeParser/src/Lib/jBBCode/Definitions/JbbHtml5MediaCodeDefinition.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $out = "<audio src='$content' controls='controls'>";
29 29
         $out .= Message::format(
30 30
             __(
31
-                'Your browser does not support HTML5 audio. Please updgrade to a modern ' .
31
+                'Your browser does not support HTML5 audio. Please updgrade to a modern '.
32 32
                 'browser. In order to watch this stream you need an HTML5 capable browser.',
33 33
                 true
34 34
             )
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
     protected function _video($content)
49 49
     {
50 50
         // fix audio files mistakenly wrapped into an [video] tag
51
-        if (preg_match('/(' . implode('|', self::$_html5AudioExtensions) . ')$/i', $content) === 1) {
51
+        if (preg_match('/('.implode('|', self::$_html5AudioExtensions).')$/i', $content) === 1) {
52 52
             return $this->_audio($content);
53 53
         }
54 54
 
55 55
         $out = "<video src='$content' controls='controls' x-webkit-airplay='allow'>";
56 56
         $out .= Message::format(
57 57
             __(
58
-                'Your browser does not support HTML5 video. Please updgrade to a modern ' .
58
+                'Your browser does not support HTML5 video. Please updgrade to a modern '.
59 59
                 'browser. In order to watch this stream you need an HTML5 capable browser.',
60 60
                 true
61 61
             )
Please login to merge, or discard this patch.
plugins/MailObfuscator/src/View/Helper/MailObfuscatorHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
         if (empty($title) === false) {
30 30
             $hasTitle = 1;
31 31
         }
32
-        $rand = "moh_" . md5(mt_rand(1, 10000) . $addr);
32
+        $rand = "moh_".md5(mt_rand(1, 10000).$addr);
33 33
         list($ttl, $dom) = explode('@', $addr);
34 34
 
35 35
         // missing  style='unicode-bidi:bidi-override;direction:rtl;'
36
-        $mailto = '<a id="' . $rand . '" href="#" data-ttl="' . $ttl . '" data-dom="' . $dom . '">' . $title . '</a>';
36
+        $mailto = '<a id="'.$rand.'" href="#" data-ttl="'.$ttl.'" data-dom="'.$dom.'">'.$title.'</a>';
37 37
         $mailto .= '<noscript><p>[You need to have Javascript enabled to see this mail address.]</p></noscript>';
38 38
         $mailto .= $this->Html->scriptBlock(
39 39
             "$(function(){
Please login to merge, or discard this patch.
plugins/Stopwatch/src/View/Helper/StopwatchHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 /**
5 5
  * Saito - The Threaded Web Forum
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function html(): string
38 38
     {
39
-        $memory = 'Peak memory usage: ' . $this->Number->toReadableSize(memory_get_peak_usage());
39
+        $memory = 'Peak memory usage: '.$this->Number->toReadableSize(memory_get_peak_usage());
40 40
         $html = $this->Html->para('', $memory);
41 41
 
42 42
         $html .= $this->Html->tag(
@@ -117,6 +117,6 @@  discard block
 block discarded – undo
117 117
      */
118 118
     private function getResult()
119 119
     {
120
-        return "<pre>" . Stopwatch::getString() . "</pre>";
120
+        return "<pre>".Stopwatch::getString()."</pre>";
121 121
     }
122 122
 }
Please login to merge, or discard this patch.