Passed
Push — develop ( 39fefa...eeeda6 )
by Jens
03:13
created
cloudcontrol/library/cc/Application.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		 */
64 64
 		private function config()
65 65
 		{
66
-			$configPath = __DIR__ . '/../../config.json';
66
+			$configPath = __DIR__.'/../../config.json';
67 67
 			if (realpath($configPath) !== false) {
68 68
 				$json = file_get_contents($configPath);
69 69
 				$this->config = json_decode($json);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		private function sitemapMatching($request)
91 91
 		{
92 92
 			$sitemap = $this->storage->getSitemap()->getSitemap();
93
-			$relativeUri = '/' . $request::$relativeUri;
93
+			$relativeUri = '/'.$request::$relativeUri;
94 94
 
95 95
 			foreach ($sitemap as $sitemapItem) {
96 96
 				if ($sitemapItem->regex) {
@@ -153,17 +153,17 @@  discard block
 block discarded – undo
153 153
 		 * @return mixed
154 154
 		 * @throws \Exception
155 155
 		 */
156
-		private function getComponentObject($class='', $template='', $parameters=array(), $matchedSitemapItem)
156
+		private function getComponentObject($class = '', $template = '', $parameters = array(), $matchedSitemapItem)
157 157
 		{
158
-			$libraryComponentName = '\\library\\components\\' . $class;
159
-			$userComponentName = '\\components\\' . $class;
158
+			$libraryComponentName = '\\library\\components\\'.$class;
159
+			$userComponentName = '\\components\\'.$class;
160 160
 
161 161
 			if (AutoloadUtil::autoLoad($libraryComponentName, false)) {
162 162
 				$component = new $libraryComponentName($template, $this->request, $parameters, $matchedSitemapItem);
163 163
 			} elseif (AutoloadUtil::autoLoad($userComponentName, false)) {
164 164
 				$component = new $userComponentName($template, $this->request, $parameters, $matchedSitemapItem);
165 165
 			} else {
166
-				throw new \Exception('Could not load component ' . $class);
166
+				throw new \Exception('Could not load component '.$class);
167 167
 			}
168 168
 			
169 169
 			if (!$component instanceof Component) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		public function setCachingHeaders()
223 223
 		{
224 224
 			header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days
225
-			header("Cache-Control: max-age=" . (60 * 60 * 24 * 2));
225
+			header("Cache-Control: max-age=".(60 * 60 * 24 * 2));
226 226
 		}
227 227
 
228 228
 		/**
Please login to merge, or discard this patch.
cloudcontrol/library/storage/Storage.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 		/**
331 331
 		 * Convert path to indeces
332 332
 		 *
333
-		 * @param $path
333
+		 * @param string $path
334 334
 		 *
335 335
 		 * @return array
336 336
 		 * @throws \Exception
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 		 *
584 584
 		 */
585 585
 		/**
586
-		 * @return array
586
+		 * @return \stdClass[]
587 587
 		 */
588 588
 		public function getBricks()
589 589
 		{
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		 */
58 58
 		private function config()
59 59
 		{
60
-			$storagePath = __DIR__ . '/../../' . $this->storageDir;
60
+			$storagePath = __DIR__.'/../../'.$this->storageDir;
61 61
 			if (realpath($storagePath) === false) {
62 62
 				initFramework();
63 63
 				if (Repository::create($storagePath)) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 					$repository->init();
66 66
 					$this->repository = $repository;
67 67
 				} else {
68
-					throw new \Exception('Could not create repository directory: ' . $storagePath);
68
+					throw new \Exception('Could not create repository directory: '.$storagePath);
69 69
 				}
70 70
 			} else {
71 71
 				$this->repository = new Repository($storagePath);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 		 */
229 229
 		public function getDocumentBySlug($slug)
230 230
 		{
231
-			$path = '/' . $slug;
231
+			$path = '/'.$slug;
232 232
 
233 233
 			return $this->repository->getDocumentByPath($path);
234 234
 		}
@@ -238,14 +238,14 @@  discard block
 block discarded – undo
238 238
 		 */
239 239
 		public function saveDocument($postValues)
240 240
 		{
241
-			$oldPath = '/' . $postValues['path'];
241
+			$oldPath = '/'.$postValues['path'];
242 242
 
243 243
 			$container = $this->getDocumentContainerByPath($oldPath);
244 244
 			$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, $this);
245 245
 			if ($container->path === '/') {
246
-				$newPath = $container->path . $documentObject->slug;
246
+				$newPath = $container->path.$documentObject->slug;
247 247
 			} else {
248
-				$newPath = $container->path . '/' . $documentObject->slug;
248
+				$newPath = $container->path.'/'.$documentObject->slug;
249 249
 			}
250 250
 			$documentObject->path = $newPath;
251 251
 			$this->repository->saveDocument($documentObject);
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
 		{
256 256
 			$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, $this);
257 257
 			if ($postValues['path'] === '/') {
258
-				$documentObject->path = $postValues['path'] . $documentObject->slug;
258
+				$documentObject->path = $postValues['path'].$documentObject->slug;
259 259
 			} else {
260
-				$documentObject->path = $postValues['path'] . '/' . $documentObject->slug;
260
+				$documentObject->path = $postValues['path'].'/'.$documentObject->slug;
261 261
 			}
262 262
 
263 263
 			$this->repository->saveDocument($documentObject);
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
 		public function deleteDocumentBySlug($slug)
267 267
 		{
268
-			$path = '/' . $slug;
268
+			$path = '/'.$slug;
269 269
 			$this->repository->deleteDocumentByPath($path);
270 270
 		}
271 271
 
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
 		{
281 281
 			$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues);
282 282
 			if ($postValues['path'] === '/') {
283
-				$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug;
283
+				$documentFolderObject->path = $postValues['path'].$documentFolderObject->slug;
284 284
 			} else {
285
-				$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug;
285
+				$documentFolderObject->path = $postValues['path'].'/'.$documentFolderObject->slug;
286 286
 			}
287 287
 			$this->repository->saveDocument($documentFolderObject);
288 288
 		}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 		 */
297 297
 		public function deleteDocumentFolderBySlug($slug)
298 298
 		{
299
-			$path = '/' . $slug;
299
+			$path = '/'.$slug;
300 300
 			$this->repository->deleteDocumentByPath($path);
301 301
 		}
302 302
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		 */
311 311
 		public function getDocumentFolderBySlug($slug)
312 312
 		{
313
-			$path = '/' . $slug;
313
+			$path = '/'.$slug;
314 314
 
315 315
 			return $this->repository->getDocumentByPath($path);
316 316
 		}
@@ -407,13 +407,13 @@  discard block
 block discarded – undo
407 407
 
408 408
 		public function addFile($postValues)
409 409
 		{
410
-			$destinationPath = realpath(__DIR__ . '/../../www/files/');
410
+			$destinationPath = realpath(__DIR__.'/../../www/files/');
411 411
 
412 412
 			$filename = $this->validateFilename($postValues['name'], $destinationPath);
413
-			$destination = $destinationPath . '/' . $filename;
413
+			$destination = $destinationPath.'/'.$filename;
414 414
 
415 415
 			if ($postValues['error'] != '0') {
416
-				throw new \Exception('Error uploading file. Error code: ' . $postValues['error']);
416
+				throw new \Exception('Error uploading file. Error code: '.$postValues['error']);
417 417
 			}
418 418
 
419 419
 			if (move_uploaded_file($postValues['tmp_name'], $destination)) {
@@ -455,8 +455,8 @@  discard block
 block discarded – undo
455 455
 		 */
456 456
 		public function deleteFileByName($filename)
457 457
 		{
458
-			$destinationPath = realpath(__DIR__ . '/../../www/files/');
459
-			$destination = $destinationPath . '/' . $filename;
458
+			$destinationPath = realpath(__DIR__.'/../../www/files/');
459
+			$destination = $destinationPath.'/'.$filename;
460 460
 
461 461
 			if (file_exists($destination)) {
462 462
 				$files = $this->getFiles();
Please login to merge, or discard this patch.
cloudcontrol/library/components/cms/configuration/ImageSetRouting.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		$imageSet = $cmsComponent->storage->getImageSet()->getImageSetBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
57 57
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
58 58
 			$cmsComponent->storage->getImageSet()->saveImageSet($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post);
59
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/image-set');
59
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/image-set');
60 60
 			exit;
61 61
 		}
62 62
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_IMAGE_SET, $imageSet);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION);
73 73
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
74 74
 			$cmsComponent->storage->getImageSet()->addImageSet($request::$post);
75
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/image-set');
75
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/image-set');
76 76
 			exit;
77 77
 		}
78 78
 	}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	private function deleteRoute($request, $cmsComponent)
85 85
 	{
86 86
 		$cmsComponent->storage->getImageSet()->deleteImageSetBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
87
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/image-set');
87
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/image-set');
88 88
 		exit;
89 89
 	}
90 90
 }
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/storage/storage/Storage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,19 +35,19 @@
 block discarded – undo
35 35
 			array_pop($fileParts);
36 36
 			$fileNameWithoutExtension = implode('-', $fileParts);
37 37
 			$fileNameWithoutExtension = slugify($fileNameWithoutExtension);
38
-			$filename = $fileNameWithoutExtension . '.' . $extension;
38
+			$filename = $fileNameWithoutExtension.'.'.$extension;
39 39
 		} else {
40 40
 			$filename = slugify($filename);
41 41
 		}
42 42
 
43
-		if (file_exists($path . '/' . $filename)) {
43
+		if (file_exists($path.'/'.$filename)) {
44 44
 			$fileParts = explode('.', $filename);
45 45
 			if (count($fileParts) > 1) {
46 46
 				$extension = end($fileParts);
47 47
 				array_pop($fileParts);
48 48
 				$fileNameWithoutExtension = implode('-', $fileParts);
49 49
 				$fileNameWithoutExtension .= '-copy';
50
-				$filename = $fileNameWithoutExtension . '.' . $extension;
50
+				$filename = $fileNameWithoutExtension.'.'.$extension;
51 51
 			} else {
52 52
 				$filename .= '-copy';
53 53
 			}
Please login to merge, or discard this patch.
cloudcontrol/library/storage/storage/ImagesStorage.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	public function addImage($postValues)
35 35
 	{
36
-		$destinationPath = realpath(__DIR__ . '/../../../www/images/');
36
+		$destinationPath = realpath(__DIR__.'/../../../www/images/');
37 37
 
38 38
 		$filename = $this->validateFilename($postValues['name'], $destinationPath);
39
-		$destination = $destinationPath . '/' . $filename;
39
+		$destination = $destinationPath.'/'.$filename;
40 40
 
41 41
 		if ($postValues['error'] != '0') {
42
-			throw new \Exception('Error uploading file. Error code: ' . $postValues['error']);
42
+			throw new \Exception('Error uploading file. Error code: '.$postValues['error']);
43 43
 		}
44 44
 
45 45
 		if (move_uploaded_file($postValues['tmp_name'], $destination)) {
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function deleteImageByName($filename)
66 66
 	{
67
-		$destinationPath = realpath(__DIR__ . '/../../../www/images/');
67
+		$destinationPath = realpath(__DIR__.'/../../../www/images/');
68 68
 
69 69
 		$images = $this->getImages();
70 70
 
71 71
 		foreach ($images as $key => $image) {
72 72
 			if ($image->file == $filename) {
73 73
 				foreach ($image->set as $imageSetFilename) {
74
-					$destination = $destinationPath . '/' . $imageSetFilename;
74
+					$destination = $destinationPath.'/'.$imageSetFilename;
75 75
 					if (file_exists($destination)) {
76 76
 						unlink($destination);
77 77
 					} else {
Please login to merge, or discard this patch.