Completed
Pull Request — master (#9)
by Mark
02:09
created
syntax.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,10 +13,16 @@  discard block
 block discarded – undo
13 13
  * @author  Michael Klier <[email protected]>
14 14
  * @author  Mark C. Prins <[email protected]>
15 15
  */
16
-if(!defined('DOKU_INC')) die();
16
+if(!defined('DOKU_INC')) {
17
+    die();
18
+}
17 19
 
18
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
19
-if(!defined('DW_LF')) define('DW_LF',"\n");
20
+if(!defined('DOKU_PLUGIN')) {
21
+    define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
22
+}
23
+if(!defined('DW_LF')) {
24
+    define('DW_LF',"\n");
25
+}
20 26
 
21 27
 require_once(DOKU_PLUGIN.'syntax.php');
22 28
 require_once(DOKU_INC.'inc/parserutils.php');
@@ -119,7 +125,9 @@  discard block
 block discarded – undo
119 125
 
120 126
                 foreach($backlinks as $backlink){
121 127
                     $name = p_get_metadata($backlink,'title');
122
-                    if(empty($name)) $name = $backlink;
128
+                    if(empty($name)) {
129
+                        $name = $backlink;
130
+                    }
123 131
                     $renderer->doc .= '<li><div class="li">';
124 132
                     $renderer->doc .= html_wikilink(':'.$backlink,$name,'');
125 133
                     $renderer->doc .= '</div></li>';
Please login to merge, or discard this patch.
_test/syntax.test.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function testIndex() {
73 73
         $query = array('ross');
74 74
         $this->assertEquals(
75
-                 array('ross' => array(
75
+                    array('ross' => array(
76 76
                     'link' => '3',
77 77
                     'bob_ross_says' => '1',
78 78
                     'backlinks_syntax' => '2',
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                     'include:link' => '3',
83 83
                     'exclude:link' => '3'
84 84
                     )),
85
-                 idx_lookup($query)
85
+                    idx_lookup($query)
86 86
         );
87 87
     }
88 88
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             strpos($response->getContent(), 'A link to Bob Ross') !== false,
95 95
             'A link to Bob Ross was not in the output'
96 96
         );
97
-     }
97
+        }
98 98
 
99 99
     public function testStoryPage() {
100 100
         $request = new TestRequest();
@@ -119,18 +119,18 @@  discard block
 block discarded – undo
119 119
         //look for id="plugin__backlinks"
120 120
         $this->assertEquals(1, pq('#plugin__backlinks', $doc)->length,
121 121
                             'There should be one backlinks element'
122
-                           );
122
+                            );
123 123
 
124 124
         $wikilinks = pq('#plugin__backlinks ul li', $doc);
125 125
         dbglog($wikilinks->text(), 'found backlinks');
126 126
         $this->assertEquals(4, $wikilinks->contents()->length,
127 127
                             'There should be 4 backlinks'
128
-                           );
128
+                            );
129 129
 
130 130
         $lastlink = pq('a:last',$wikilinks);
131 131
         dbglog($lastlink->text(),"last backlink");
132 132
         $this->assertEquals($lastlink->text(),'A link to Bob Ross',
133 133
                             'The last backlink should be a link to Bob Ross'
134
-                           );
134
+                            );
135 135
     }
136 136
 }
Please login to merge, or discard this patch.
_test/general.test.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@
 block discarded – undo
55 55
     public function test_plugin_backlinks_isloaded() {
56 56
         global $plugin_controller;
57 57
         $this->assertTrue(
58
-                   in_array('backlinks', $plugin_controller->getList()),
59
-                   "backlinks plugin is loaded"
60
-                         );
58
+                    in_array('backlinks', $plugin_controller->getList()),
59
+                    "backlinks plugin is loaded"
60
+                            );
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
_test/syntax_include.test.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                             1,
89 89
                             pq('#plugin__backlinks', $doc)->length,
90 90
                             'There should be one backlinks element'
91
-                           );
91
+                            );
92 92
 
93 93
         $wikilinks = pq('#plugin__backlinks ul li', $doc);
94 94
         dbglog($wikilinks->text(), 'found backlinks');
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                             1,
97 97
                             $wikilinks->contents()->length,
98 98
                             'There should be 1 backlink'
99
-                           );
99
+                            );
100 100
 
101 101
         $lastlink = pq('a:last',$wikilinks);
102 102
         dbglog($lastlink->text(),"last backlink");
@@ -104,6 +104,6 @@  discard block
 block discarded – undo
104 104
                             $lastlink->text(),
105 105
                             'An included link to Bob Ross',
106 106
                             'The last backlink should be "An included link to Bob Ross"'
107
-                           );
107
+                            );
108 108
     }
109 109
 }
Please login to merge, or discard this patch.
_test/syntax_exclude.test.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                             1,
89 89
                             pq('#plugin__backlinks', $doc)->length,
90 90
                             'There should be one backlinks element'
91
-                           );
91
+                            );
92 92
 
93 93
         $wikilinks = pq('#plugin__backlinks ul li', $doc);
94 94
         dbglog($wikilinks->text(), 'found backlinks');
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                             1,
97 97
                             $wikilinks->contents()->length,
98 98
                             'There should be 1 backlink'
99
-                           );
99
+                            );
100 100
 
101 101
         $lastlink = pq('a:last',$wikilinks);
102 102
         dbglog($lastlink->text(),"last backlink");
@@ -104,6 +104,6 @@  discard block
 block discarded – undo
104 104
                             $lastlink->text(),
105 105
                             'An included link to Bob Ross',
106 106
                             'The last backlink should be "An included link to Bob Ross"'
107
-                           );
107
+                            );
108 108
     }
109 109
 }
Please login to merge, or discard this patch.