Passed
Push — develop ( e3baf2...b0eb3e )
by Jens
03:01
created
cloudcontrol/library/components/cms/configuration/DocumentTypeRouting.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
 		$bricks = $cmsComponent->storage->getBricks()->getBricks();
57 57
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
58 58
 			$cmsComponent->storage->getDocumentTypes()->addDocumentType($request::$post);
59
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types');
59
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types');
60 60
 			exit;
61 61
 		}
62 62
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_BRICKS, $bricks);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$bricks = $cmsComponent->storage->getBricks()->getBricks();
75 75
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
76 76
 			$cmsComponent->storage->getDocumentTypes()->saveDocumentType($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post);
77
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types');
77
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types');
78 78
 			exit;
79 79
 		}
80 80
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $documentType);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	private function deleteRoute($request, $cmsComponent)
89 89
 	{
90 90
 		$cmsComponent->storage->getDocumentTypes()->deleteDocumentTypeBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
91
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types');
91
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types');
92 92
 		exit;
93 93
 	}
94 94
 }
95 95
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/search/DocumentTokenizer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
 	private function tokenizeBrick($brick, $brickSlug)
91 91
 	{
92
-		$fields  = $brick->fields;
92
+		$fields = $brick->fields;
93 93
 		$brickDefinition = $this->storage->getBricks()->getBrickBySlug($brick->type);
94 94
 		foreach ($fields as $fieldName => $field) {
95 95
 			$fieldType = $this->getFieldType($fieldName, $brickDefinition);
96
-			$this->tokenizeField($field, $brickSlug . '__' . $fieldName, $fieldType);
96
+			$this->tokenizeField($field, $brickSlug.'__'.$fieldName, $fieldType);
97 97
 		}
98 98
 	}
99 99
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	{
102 102
 		$dynamicBricks = $this->document->dynamicBricks;
103 103
 		foreach ($dynamicBricks as $key => $brick) {
104
-			$this->tokenizeBrick($brick, 'dynamicBricks__' . $brick->type . $key);
104
+			$this->tokenizeBrick($brick, 'dynamicBricks__'.$brick->type.$key);
105 105
 		}
106 106
 	}
107 107
 
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 			}
155 155
 		}
156 156
 
157
-		throw new \Exception('Unknown field type for field' . $fieldName . ' in document ' . $this->document->path);
157
+		throw new \Exception('Unknown field type for field'.$fieldName.' in document '.$this->document->path);
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
library/components/cms/configuration/ApplicationComponentRouting.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION);
56 56
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
57 57
 			$cmsComponent->storage->getApplicationComponents()->addApplicationComponent($request::$post);
58
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components');
58
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components');
59 59
 			exit;
60 60
 		}
61 61
 	}
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		$applicationComponent = $cmsComponent->storage->getApplicationComponents()->getApplicationComponentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
72 72
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
73 73
 			$cmsComponent->storage->getApplicationComponents()->saveApplicationComponent($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post);
74
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components');
74
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components');
75 75
 			exit;
76 76
 		}
77 77
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	private function deleteRoute($request, $cmsComponent)
86 86
 	{
87 87
 		$cmsComponent->storage->getApplicationComponents()->deleteApplicationComponentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
88
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components');
88
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components');
89 89
 		exit;
90 90
 	}
91 91
 }
92 92
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/storage/storage/DocumentStorage.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 	/**
86 86
 	 * Returns the folder containing the document
87 87
 	 *
88
-	 * @param $path
88
+	 * @param string $path
89 89
 	 *
90 90
 	 * @return bool|\library\storage\Document
91 91
 	 * @throws \Exception
Please login to merge, or discard this 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, $this);
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/storage/Storage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		 */
83 83
 		private function config()
84 84
 		{
85
-			$storagePath = __DIR__ . '/../../' . $this->storageDir;
85
+			$storagePath = __DIR__.'/../../'.$this->storageDir;
86 86
 			if (realpath($storagePath) === false) {
87 87
 				initFramework();
88 88
 				if (Repository::create($storagePath)) {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 					$repository->init();
91 91
 					$this->repository = $repository;
92 92
 				} else {
93
-					throw new \Exception('Could not create repository directory: ' . $storagePath);
93
+					throw new \Exception('Could not create repository directory: '.$storagePath);
94 94
 				}
95 95
 			} else {
96 96
 				$this->repository = new Repository($storagePath);
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 		{
134 134
 			$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues);
135 135
 			if ($postValues['path'] === '/') {
136
-				$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug;
136
+				$documentFolderObject->path = $postValues['path'].$documentFolderObject->slug;
137 137
 			} else {
138
-				$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug;
138
+				$documentFolderObject->path = $postValues['path'].'/'.$documentFolderObject->slug;
139 139
 			}
140 140
 			$this->repository->saveDocument($documentFolderObject);
141 141
 		}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		 */
150 150
 		public function deleteDocumentFolderBySlug($slug)
151 151
 		{
152
-			$path = '/' . $slug;
152
+			$path = '/'.$slug;
153 153
 			$this->repository->deleteDocumentByPath($path);
154 154
 		}
155 155
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		 */
164 164
 		public function getDocumentFolderBySlug($slug)
165 165
 		{
166
-			$path = '/' . $slug;
166
+			$path = '/'.$slug;
167 167
 
168 168
 			return $this->repository->getDocumentByPath($path);
169 169
 		}
Please login to merge, or discard this patch.
cloudcontrol/library/search/Indexer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		$this->resetIndex();
59 59
 		$this->addLog('Retrieving documents to be indexed.');
60 60
 		$documents = $this->storage->getDocuments()->getDocuments();
61
-		$this->addLog('Start Document Term Count for ' . count($documents) . ' documents');
61
+		$this->addLog('Start Document Term Count for '.count($documents).' documents');
62 62
 		$this->createDocumentTermCount($documents);
63 63
 		$this->addLog('Start Document Term Frequency.');
64 64
 		$this->createDocumentTermFrequency();
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	private function addLog($string)
160 160
 	{
161 161
 		$currentTime = round(microtime(true) * 1000);
162
-		$this->log .= date('d-m-Y H:i:s - ') . str_pad($string, 50, " ", STR_PAD_RIGHT) . "\t" . ($currentTime - $this->lastLog) . 'ms since last log. ' . "\t" . ($currentTime - $this->loggingStart) . 'ms since start.' . PHP_EOL;
162
+		$this->log .= date('d-m-Y H:i:s - ').str_pad($string, 50, " ", STR_PAD_RIGHT)."\t".($currentTime - $this->lastLog).'ms since last log. '."\t".($currentTime - $this->loggingStart).'ms since start.'.PHP_EOL;
163 163
 		$this->lastLog = round(microtime(true) * 1000);
164 164
 	}
165 165
 
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	protected function getSearchDbHandle()
172 172
 	{
173 173
 		if ($this->searchDbHandle === null) {
174
-			$path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $this->storageDir . DIRECTORY_SEPARATOR;
175
-			$this->searchDbHandle = new \PDO('sqlite:' . $path . self::SEARCH_TEMP_DB);
174
+			$path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$this->storageDir.DIRECTORY_SEPARATOR;
175
+			$this->searchDbHandle = new \PDO('sqlite:'.$path.self::SEARCH_TEMP_DB);
176 176
 		}
177 177
 		return $this->searchDbHandle;
178 178
 	}
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	public function replaceOldIndex()
184 184
 	{
185 185
 		$this->searchDbHandle = null;
186
-		$path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $this->storageDir . DIRECTORY_SEPARATOR;
187
-		rename($path . self::SEARCH_TEMP_DB, $path . 'search.db');
186
+		$path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$this->storageDir.DIRECTORY_SEPARATOR;
187
+		rename($path.self::SEARCH_TEMP_DB, $path.'search.db');
188 188
 	}
189 189
 }
190 190
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/components/DocumentComponent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			if (isset($this->parameters['document'])) {
86 86
 				$this->runByDocumentParameter();
87 87
 			} else {
88
-				throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: ' . $this->matchedSitemapItem->title);
88
+				throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: '.$this->matchedSitemapItem->title);
89 89
 			}
90 90
 		}
91 91
 
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 				$relativeDocumentUri = current($this->matchedSitemapItem->matches[1]);
103 103
 				if (isset($this->parameters['folder'])) {
104 104
 					if (substr($this->parameters['folder'], -1) !== '/') {
105
-						$this->parameters['folder'] = $this->parameters['folder'] . '/';
105
+						$this->parameters['folder'] = $this->parameters['folder'].'/';
106 106
 					}
107
-					$relativeDocumentUri = $this->parameters['folder'] . $relativeDocumentUri;
107
+					$relativeDocumentUri = $this->parameters['folder'].$relativeDocumentUri;
108 108
 				}
109 109
 
110 110
 				$document = $this->storage->getDocuments()->getDocumentBySlug($relativeDocumentUri);
Please login to merge, or discard this patch.