@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $this->_loginUser(1); |
43 | 43 | $source = 2; |
44 | 44 | |
45 | - $readPostings = function () use ($source) { |
|
45 | + $readPostings = function() use ($source) { |
|
46 | 46 | $read = []; |
47 | 47 | $read['all'] = $this->Entries->find()->all()->count(); |
48 | 48 | $read['source'] = $this->Entries->find() |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $source = 2; |
79 | 79 | $target = 4; |
80 | 80 | |
81 | - $readPostings = function () use ($source, $target) { |
|
81 | + $readPostings = function() use ($source, $target) { |
|
82 | 82 | $read = []; |
83 | 83 | $read['all'] = $this->Entries->find()->all()->count(); |
84 | 84 | $read['source'] = $this->Entries->find() |
@@ -8,7 +8,7 @@ |
||
8 | 8 | Router::scope( |
9 | 9 | '/admin', |
10 | 10 | ['plugin' => 'Admin'], |
11 | - function ($routes) { |
|
11 | + function($routes) { |
|
12 | 12 | $routes->connect( |
13 | 13 | '/', |
14 | 14 | ['controller' => 'Admins', 'action' => 'index'] |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | $anchors = ''; |
52 | 52 | foreach ($settingNames as $name) { |
53 | 53 | $out .= $this->tableRow($name, $Settings); |
54 | - $anchors .= '<a name="' . $name . '"></a>'; |
|
54 | + $anchors .= '<a name="'.$name.'"></a>'; |
|
55 | 55 | } |
56 | 56 | $key = $this->addHeader($options['nav-title']); |
57 | - $out = '<table class="table table-striped table-bordered table-condensed">' . |
|
58 | - $out . '</table>'; |
|
57 | + $out = '<table class="table table-striped table-bordered table-condensed">'. |
|
58 | + $out.'</table>'; |
|
59 | 59 | |
60 | 60 | $sh = ''; |
61 | 61 | if (!empty($options['sh'])) { |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | ); |
66 | 66 | } |
67 | 67 | |
68 | - $out = '<div id="navHeaderAnchor' . $key . '"></div>' . |
|
69 | - $sh . |
|
70 | - $anchors . |
|
71 | - '<h2 >' . $tableName . '</h2>' . |
|
68 | + $out = '<div id="navHeaderAnchor'.$key.'"></div>'. |
|
69 | + $sh. |
|
70 | + $anchors. |
|
71 | + '<h2 >'.$tableName.'</h2>'. |
|
72 | 72 | $out; |
73 | 73 | |
74 | 74 | return $out; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | [ |
112 | 112 | __d('nondynamic', $name), |
113 | 113 | $Settings[$name], |
114 | - "<p>" . __d('nondynamic', $name . '_exp') . "</p>", |
|
114 | + "<p>".__d('nondynamic', $name.'_exp')."</p>", |
|
115 | 115 | $this->Html->link( |
116 | 116 | __('edit'), |
117 | 117 | ['controller' => 'settings', 'action' => 'edit', $name], |
@@ -72,7 +72,7 @@ |
||
72 | 72 | */ |
73 | 73 | public function delete($id) |
74 | 74 | { |
75 | - $id = (int)$id; |
|
75 | + $id = (int) $id; |
|
76 | 76 | $exists = $this->Users->exists($id); |
77 | 77 | if (!$exists) { |
78 | 78 | $this->Flash->set(__('User not found.'), ['element' => 'error']); |
@@ -123,7 +123,7 @@ |
||
123 | 123 | |
124 | 124 | switch ($this->request->getData('mode')) { |
125 | 125 | case ('move'): |
126 | - $targetId = (int)$this->request->getData('targetCategory'); |
|
126 | + $targetId = (int) $this->request->getData('targetCategory'); |
|
127 | 127 | try { |
128 | 128 | $this->Categories->merge($category->get('id'), $targetId); |
129 | 129 | $this->Flash->set( |
@@ -103,7 +103,7 @@ |
||
103 | 103 | if ($this->_isBot === null) { |
104 | 104 | $agent = env('HTTP_USER_AGENT'); |
105 | 105 | $imploded = implode('|', $this->_bots); |
106 | - $this->_isBot = (bool)preg_match('/' . $imploded . '/i', $agent); |
|
106 | + $this->_isBot = (bool) preg_match('/'.$imploded.'/i', $agent); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | return $this->_isBot; |
@@ -302,10 +302,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 = [ |
@@ -121,7 +121,7 @@ discard block |
||
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 |
||
129 | 129 | } |
130 | 130 | $out = preg_replace( |
131 | 131 | "/^/m", |
132 | - $quoteSymbol . " ", |
|
132 | + $quoteSymbol." ", |
|
133 | 133 | $out |
134 | 134 | ); |
135 | 135 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Saito - The Threaded Web Forum |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // serializing complex objects kills PHP |
282 | 282 | $serializable = array_filter( |
283 | 283 | $options, |
284 | - function ($value) { |
|
284 | + function($value) { |
|
285 | 285 | return !is_object($value); |
286 | 286 | } |
287 | 287 | ); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $this->_Parser->addCodeDefinition($builder->build()); |
336 | 336 | break; |
337 | 337 | case 'class': |
338 | - $class = '\Plugin\BbcodeParser\src\Lib\jBBCode\Definitions\\' . ucfirst($title); |
|
338 | + $class = '\Plugin\BbcodeParser\src\Lib\jBBCode\Definitions\\'.ucfirst($title); |
|
339 | 339 | $this->_Parser->addCodeDefinition(new $class($this->_Helper, $options)); |
340 | 340 | break; |
341 | 341 | default: |
@@ -355,10 +355,10 @@ discard block |
||
355 | 355 | return; |
356 | 356 | } |
357 | 357 | |
358 | - $folder = __DIR__ . '/jBBCode/Definitions/'; |
|
359 | - require_once $folder . 'JbbCodeDefinitions.php'; |
|
360 | - require_once $folder . 'JbbHtml5MediaCodeDefinition.php'; |
|
361 | - require_once $folder . 'JbbCodeCodeDefinition.php'; |
|
358 | + $folder = __DIR__.'/jBBCode/Definitions/'; |
|
359 | + require_once $folder.'JbbCodeDefinitions.php'; |
|
360 | + require_once $folder.'JbbHtml5MediaCodeDefinition.php'; |
|
361 | + require_once $folder.'JbbCodeCodeDefinition.php'; |
|
362 | 362 | |
363 | 363 | $this->areCombinedClassFilesLoaded = true; |
364 | 364 | } |