Completed
Push — master ( ea0a0b...641102 )
by Nicola
02:51
created
code/Autotoc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $c = $this->owner;
65 65
         $model = $c->customisedObject ? $c->customisedObject : $c->data();
66
-        if (! $model) {
66
+        if (!$model) {
67 67
             return null;
68 68
         }
69 69
 
70 70
         $field = $this->_contentField();
71
-        if (! $model->hasField($field)) {
71
+        if (!$model->hasField($field)) {
72 72
             return null;
73 73
         }
74 74
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     public function getAutotoc()
89 89
     {
90 90
         $tocifier = $this->_getTocifier();
91
-        if (! $tocifier) {
91
+        if (!$tocifier) {
92 92
             return null;
93 93
         }
94 94
 
Please login to merge, or discard this patch.
code/Tocifier.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 
90 90
         $body = $doc->getElementsByTagName('body')->item(0);
91 91
         $this->_html = str_replace(array('<body>', '</body>'), '',
92
-                                   $doc->saveHTML($body));
92
+                                    $doc->saveHTML($body));
93 93
     }
94 94
 
95 95
     private function _dumpBranch($node, $indent = '')
Please login to merge, or discard this patch.
tests/Bootstrap.php 2 patches
Switch Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 spl_autoload_register(function ($class) {
9 9
     switch ($class) {
10 10
 
11
-    case 'Tocifier':
12
-        require_once __DIR__ . '/../code/Tocifier.php';
13
-        break;
11
+        case 'Tocifier':
12
+            require_once __DIR__ . '/../code/Tocifier.php';
13
+            break;
14 14
     }
15 15
 });
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
  * phpunit --bootstrap tests/Bootstrap.php tests/
6 6
  */
7 7
 
8
-spl_autoload_register(function ($class) {
8
+spl_autoload_register(function($class) {
9 9
     switch ($class) {
10 10
 
11 11
     case 'Tocifier':
12
-        require_once __DIR__ . '/../code/Tocifier.php';
12
+        require_once __DIR__.'/../code/Tocifier.php';
13 13
         break;
14 14
     }
15 15
 });
Please login to merge, or discard this patch.
tests/TocifierTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,26 +22,26 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function testPrependAnchor()
24 24
     {
25
-        $tocifier = new Tocifier(file_get_contents(__DIR__ . '/test1'));
25
+        $tocifier = new Tocifier(file_get_contents(__DIR__.'/test1'));
26 26
         $this->assertEquals($tocifier->getHtml(), '');
27 27
         $this->assertTrue($tocifier->process());
28 28
 
29 29
         // The default augmenting method should already be prependAnchor
30
-        $this->assertStringEqualsFile(__DIR__ . '/html1', $tocifier->getHtml());
30
+        $this->assertStringEqualsFile(__DIR__.'/html1', $tocifier->getHtml());
31 31
     }
32 32
 
33 33
     public function testSetId()
34 34
     {
35
-        $tocifier = new Tocifier(file_get_contents(__DIR__ . '/test1'));
35
+        $tocifier = new Tocifier(file_get_contents(__DIR__.'/test1'));
36 36
         $tocifier->setAugmentCallback(array('Tocifier', 'setId'));
37 37
         $this->assertEquals($tocifier->getHtml(), '');
38 38
         $this->assertTrue($tocifier->process());
39
-        $this->assertStringEqualsFile(__DIR__ . '/html2', $tocifier->getHtml());
39
+        $this->assertStringEqualsFile(__DIR__.'/html2', $tocifier->getHtml());
40 40
     }
41 41
 
42 42
     public function testTOC()
43 43
     {
44
-        $tocifier = new Tocifier(file_get_contents(__DIR__ . '/test1'));
44
+        $tocifier = new Tocifier(file_get_contents(__DIR__.'/test1'));
45 45
         $this->assertEquals($tocifier->getTOC(), array());
46 46
         $this->assertTrue($tocifier->process());
47 47
         $this->assertNotNull($tocifier->getTOC());
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
         ob_start();
50 50
         $tocifier->dumpTOC();
51 51
         $returned = ob_get_clean();
52
-        $this->assertStringEqualsFile(__DIR__ . '/toc1', $returned);
52
+        $this->assertStringEqualsFile(__DIR__.'/toc1', $returned);
53 53
     }
54 54
 
55 55
     public function testDataHideFromTOC()
56 56
     {
57
-        $tocifier = new Tocifier(file_get_contents(__DIR__ . '/test2'));
57
+        $tocifier = new Tocifier(file_get_contents(__DIR__.'/test2'));
58 58
         $this->assertEquals($tocifier->getHtml(), '');
59 59
         $this->assertTrue($tocifier->process());
60 60
 
61 61
         // Check the augmented HTML is equal to the original one
62
-        $this->assertStringEqualsFile(__DIR__ . '/test2', $tocifier->getHtml());
62
+        $this->assertStringEqualsFile(__DIR__.'/test2', $tocifier->getHtml());
63 63
 
64 64
         ob_start();
65 65
         $tocifier->dumpTOC();
Please login to merge, or discard this patch.