Passed
Push — develop ( 111896...eb49e9 )
by Jens
02:45
created
cloudcontrol/library/storage/storage/DocumentStorage.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	public function getDocumentBySlug($slug)
37 37
 	{
38
-		$path = '/' . $slug;
38
+		$path = '/'.$slug;
39 39
 
40 40
 		return $this->repository->getDocumentByPath($path);
41 41
 	}
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function saveDocument($postValues)
47 47
 	{
48
-		$oldPath = '/' . $postValues['path'];
48
+		$oldPath = '/'.$postValues['path'];
49 49
 
50 50
 		$container = $this->getDocumentContainerByPath($oldPath);
51 51
 		$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, new DocumentTypesStorage($this->repository));
52 52
 		if ($container->path === '/') {
53
-			$newPath = $container->path . $documentObject->slug;
53
+			$newPath = $container->path.$documentObject->slug;
54 54
 		} else {
55
-			$newPath = $container->path . '/' . $documentObject->slug;
55
+			$newPath = $container->path.'/'.$documentObject->slug;
56 56
 		}
57 57
 		$documentObject->path = $newPath;
58 58
 		$this->repository->saveDocument($documentObject);
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 	{
66 66
 		$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, new DocumentTypesStorage($this->repository));
67 67
 		if ($postValues['path'] === '/') {
68
-			$documentObject->path = $postValues['path'] . $documentObject->slug;
68
+			$documentObject->path = $postValues['path'].$documentObject->slug;
69 69
 		} else {
70
-			$documentObject->path = $postValues['path'] . '/' . $documentObject->slug;
70
+			$documentObject->path = $postValues['path'].'/'.$documentObject->slug;
71 71
 		}
72 72
 
73 73
 		$this->repository->saveDocument($documentObject);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function deleteDocumentBySlug($slug)
80 80
 	{
81
-		$path = '/' . $slug;
81
+		$path = '/'.$slug;
82 82
 		$this->repository->deleteDocumentByPath($path);
83 83
 	}
84 84
 
Please login to merge, or discard this patch.
cloudcontrol/library/components/cms/SearchRouting.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	private function showJson($obj, $httpHeader = 'HTTP/1.0 200 OK') {
75
-		header($_SERVER['SERVER_PROTOCOL'] . $httpHeader, true);
75
+		header($_SERVER['SERVER_PROTOCOL'].$httpHeader, true);
76 76
 		header('Content-type: application/json');
77 77
 		die(json_encode($obj));
78 78
 	}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	private function stepRouting($step, $cmsComponent, $indexer)
86 86
 	{
87
-		switch($step) {
87
+		switch ($step) {
88 88
 			case 'resetIndex': $indexer->resetIndex(); break;
89 89
 			case 'createDocumentTermCount':
90 90
 				$documents = $cmsComponent->storage->getDocuments()->getDocuments();
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 			case 'createTermFieldLengthNorm': $indexer->createTermFieldLengthNorm(); break;
95 95
 			case 'createInverseDocumentFrequency': $indexer->createInverseDocumentFrequency(); break;
96 96
 			case 'replaceOldIndex': $indexer->replaceOldIndex(); break;
97
-			default : $this->showJson('Invalid step: ' . $step . '.', 'HTTP/1.0 500 Internal Server Error'); break;
97
+			default : $this->showJson('Invalid step: '.$step.'.', 'HTTP/1.0 500 Internal Server Error'); break;
98 98
 		}
99 99
 		$this->showJson('done');
100 100
 	}
Please login to merge, or discard this patch.
cloudcontrol/library/storage/Repository.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
             if (in_array($name, $this->fileBasedSubsets)) {
106 106
                 return $this->$name;
107 107
             } else {
108
-                throw new \Exception('Trying to get undefined property from Repository: ' . $name);
108
+                throw new \Exception('Trying to get undefined property from Repository: '.$name);
109 109
             }
110 110
         } else {
111 111
             if (in_array($name, $this->fileBasedSubsets)) {
112 112
                 return $this->loadSubset($name);
113 113
             } else {
114
-                throw new \Exception('Trying to get undefined property from Repository: ' . $name);
114
+                throw new \Exception('Trying to get undefined property from Repository: '.$name);
115 115
             }
116 116
         }
117 117
     }
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
     {
127 127
         if (in_array($name, $this->fileBasedSubsets)) {
128 128
             $this->$name = $value;
129
-            $changes = $name . 'Changes';
129
+            $changes = $name.'Changes';
130 130
             $this->$changes = true;
131 131
         } else {
132
-            throw new \Exception('Trying to persist unknown subset in repository: ' . $name . ' <br /><pre>' . print_r($value, true) . '</pre>');
132
+            throw new \Exception('Trying to persist unknown subset in repository: '.$name.' <br /><pre>'.print_r($value, true).'</pre>');
133 133
         }
134 134
     }
135 135
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      */
139 139
     public function save()
140 140
     {
141
-        array_map(function ($value) {
141
+        array_map(function($value) {
142 142
         	$this->saveSubset($value);
143 143
 		}, $this->fileBasedSubsets);
144 144
     }
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
      */
150 150
     protected function saveSubset($subset)
151 151
     {
152
-		$changes = $subset . 'Changes';
152
+		$changes = $subset.'Changes';
153 153
 		if ($this->$changes === true) {
154 154
 			$json = json_encode($this->$subset, JSON_PRETTY_PRINT);
155
-			$subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json';
155
+			$subsetStoragePath = $this->storagePath.DIRECTORY_SEPARATOR.$subset.'.json';
156 156
 			file_put_contents($subsetStoragePath, $json);
157 157
 
158 158
 			$this->$changes = false;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     protected function loadSubset($subset)
168 168
     {
169
-        $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json';
169
+        $subsetStoragePath = $this->storagePath.DIRECTORY_SEPARATOR.$subset.'.json';
170 170
         $json = file_get_contents($subsetStoragePath);
171 171
         $json = json_decode($json);
172 172
         $this->$subset = $json;
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     public function getContentDbHandle()
215 215
     {
216 216
         if ($this->contentDbHandle === null) {
217
-            $this->contentDbHandle = new \PDO('sqlite:' . $this->storagePath . DIRECTORY_SEPARATOR . 'content.db');
217
+            $this->contentDbHandle = new \PDO('sqlite:'.$this->storagePath.DIRECTORY_SEPARATOR.'content.db');
218 218
         }
219 219
         return $this->contentDbHandle;
220 220
     }
@@ -237,14 +237,14 @@  discard block
 block discarded – undo
237 237
     public function getDocumentsByPath($folderPath)
238 238
     {
239 239
         $db = $this->getContentDbHandle();
240
-        $folderPathWithWildcard = $folderPath . '%';
240
+        $folderPathWithWildcard = $folderPath.'%';
241 241
 
242 242
         $stmt = $this->getDbStatement('
243 243
             SELECT *
244 244
               FROM documents
245
-             WHERE `path` LIKE ' . $db->quote($folderPathWithWildcard) . '
246
-               AND substr(`path`, ' . (strlen($folderPath) + 1) . ') NOT LIKE "%/%"
247
-               AND path != ' . $db->quote($folderPath) . '
245
+             WHERE `path` LIKE ' . $db->quote($folderPathWithWildcard).'
246
+               AND substr(`path`, ' . (strlen($folderPath) + 1).') NOT LIKE "%/%"
247
+               AND path != ' . $db->quote($folderPath).'
248 248
           ORDER BY `type` DESC, `path` ASC
249 249
         ');
250 250
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         $document = $this->fetchDocument('
289 289
             SELECT *
290 290
               FROM documents
291
-             WHERE path = ' . $db->quote($path) . '
291
+             WHERE path = ' . $db->quote($path).'
292 292
         ');
293 293
         if ($document instanceof Document && $document->type === 'folder') {
294 294
             $document->dbHandle = $db;
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 			  FROM documents
309 309
 		');
310 310
 		$result = $stmt->fetch(\PDO::FETCH_ASSOC);
311
-		if (!is_array($result )) {
311
+		if (!is_array($result)) {
312 312
 			return 0;
313 313
 		}
314 314
 		return intval(current($result));
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         if ($stmt === false) {
352 352
             $errorInfo = $db->errorInfo();
353 353
             $errorMsg = $errorInfo[2];
354
-            throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
354
+            throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>');
355 355
         }
356 356
         return $stmt;
357 357
     }
@@ -381,19 +381,19 @@  discard block
 block discarded – undo
381 381
         $stmt = $this->getDbStatement('
382 382
             INSERT OR REPLACE INTO documents (`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,`state`,`lastModificationDate`,`creationDate`,`lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`)
383 383
             VALUES(
384
-              ' . $db->quote($documentObject->path) . ',
385
-              ' . $db->quote($documentObject->title) . ',
386
-              ' . $db->quote($documentObject->slug) . ',
387
-              ' . $db->quote($documentObject->type) . ',
388
-              ' . $db->quote($documentObject->documentType) . ',
389
-              ' . $db->quote($documentObject->documentTypeSlug) . ',
390
-              ' . $db->quote($documentObject->state) . ',
391
-              ' . $db->quote($documentObject->lastModificationDate) . ',
392
-              ' . $db->quote($documentObject->creationDate) . ',
393
-              ' . $db->quote($documentObject->lastModifiedBy) . ',
394
-              ' . $db->quote(json_encode($documentObject->fields)) . ',
395
-              ' . $db->quote(json_encode($documentObject->bricks)) . ',
396
-              ' . $db->quote(json_encode($documentObject->dynamicBricks)) . '
384
+              ' . $db->quote($documentObject->path).',
385
+              ' . $db->quote($documentObject->title).',
386
+              ' . $db->quote($documentObject->slug).',
387
+              ' . $db->quote($documentObject->type).',
388
+              ' . $db->quote($documentObject->documentType).',
389
+              ' . $db->quote($documentObject->documentTypeSlug).',
390
+              ' . $db->quote($documentObject->state).',
391
+              ' . $db->quote($documentObject->lastModificationDate).',
392
+              ' . $db->quote($documentObject->creationDate).',
393
+              ' . $db->quote($documentObject->lastModifiedBy).',
394
+              ' . $db->quote(json_encode($documentObject->fields)).',
395
+              ' . $db->quote(json_encode($documentObject->bricks)).',
396
+              ' . $db->quote(json_encode($documentObject->dynamicBricks)).'
397 397
             )
398 398
         ');
399 399
         $result = $stmt->execute();
@@ -414,16 +414,16 @@  discard block
 block discarded – undo
414 414
             if ($documentToDelete->type == 'document') {
415 415
                 $stmt = $this->getDbStatement('
416 416
                     DELETE FROM documents
417
-                          WHERE path = ' . $db->quote($path) . '
417
+                          WHERE path = ' . $db->quote($path).'
418 418
                 ');
419 419
                 $stmt->execute();
420 420
             } elseif ($documentToDelete->type == 'folder') {
421
-                $folderPathWithWildcard = $path . '%';
421
+                $folderPathWithWildcard = $path.'%';
422 422
                 $stmt = $this->getDbStatement('
423 423
                     DELETE FROM documents
424
-                          WHERE (path LIKE ' . $db->quote($folderPathWithWildcard) . '
425
-                            AND substr(`path`, ' . (strlen($path) + 1) . ', 1) = "/")
426
-                            OR path = ' . $db->quote($path) . '
424
+                          WHERE (path LIKE ' . $db->quote($folderPathWithWildcard).'
425
+                            AND substr(`path`, ' . (strlen($path) + 1).', 1) = "/")
426
+                            OR path = ' . $db->quote($path).'
427 427
                 ');
428 428
                 $stmt->execute();
429 429
             }
Please login to merge, or discard this patch.