Passed
Push — master ( 9c6499...c22bc5 )
by Jens
04:52 queued 02:21
created
src/search/Indexer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$this->storage->getDocuments()->cleanPublishedDeletedDocuments();
61 61
 		$this->addLog('Retrieving documents to be indexed.');
62 62
 		$documents = $this->storage->getDocuments()->getPublishedDocumentsNoFolders();
63
-		$this->addLog('Start Document Term Count for ' . count($documents) . ' documents');
63
+		$this->addLog('Start Document Term Count for '.count($documents).' documents');
64 64
 		$this->createDocumentTermCount($documents);
65 65
 		$this->addLog('Start Document Term Frequency.');
66 66
 		$this->createDocumentTermFrequency();
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	private function addLog($string)
162 162
 	{
163 163
 		$currentTime = round(microtime(true) * 1000);
164
-		$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;
164
+		$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;
165 165
 		$this->lastLog = round(microtime(true) * 1000);
166 166
 	}
167 167
 
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	protected function getSearchDbHandle()
174 174
 	{
175 175
 		if ($this->searchDbHandle === null) {
176
-			$path = $this->storageDir . DIRECTORY_SEPARATOR;
177
-			$this->searchDbHandle = new \PDO('sqlite:' . $path . self::SEARCH_TEMP_DB);
176
+			$path = $this->storageDir.DIRECTORY_SEPARATOR;
177
+			$this->searchDbHandle = new \PDO('sqlite:'.$path.self::SEARCH_TEMP_DB);
178 178
 		}
179 179
 		return $this->searchDbHandle;
180 180
 	}
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	public function replaceOldIndex()
186 186
 	{
187 187
 		$this->searchDbHandle = null;
188
-		$path = $this->storageDir . DIRECTORY_SEPARATOR;
189
-		rename($path . self::SEARCH_TEMP_DB, $path . 'search.db');
188
+		$path = $this->storageDir.DIRECTORY_SEPARATOR;
189
+		rename($path.self::SEARCH_TEMP_DB, $path.'search.db');
190 190
 	}
191 191
 }
192 192
\ No newline at end of file
Please login to merge, or discard this patch.
src/storage/Storage.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 					$repository->init();
114 114
 					$this->repository = $repository;
115 115
 				} else {
116
-					throw new \Exception('Could not create repository directory: ' . $storagePath);
116
+					throw new \Exception('Could not create repository directory: '.$storagePath);
117 117
 				}
118 118
 			} else {
119 119
 				$this->repository = new Repository($storagePath);
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 		{
157 157
 			$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues);
158 158
 			if ($postValues['path'] === '/') {
159
-				$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug;
159
+				$documentFolderObject->path = $postValues['path'].$documentFolderObject->slug;
160 160
 			} else {
161
-				$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug;
161
+				$documentFolderObject->path = $postValues['path'].'/'.$documentFolderObject->slug;
162 162
 			}
163 163
 			$this->repository->saveDocument($documentFolderObject, 'published');
164 164
 			$this->repository->saveDocument($documentFolderObject, 'unpublished');
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		 */
174 174
 		public function deleteDocumentFolderBySlug($slug)
175 175
 		{
176
-			$path = '/' . $slug;
176
+			$path = '/'.$slug;
177 177
 			$this->repository->deleteDocumentByPath($path, 'published');
178 178
 			$this->repository->deleteDocumentByPath($path, 'unpublished');
179 179
 			$this->repository->cleanPublishedDeletedDocuments();
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
 
182 182
 		public function publishDocumentBySlug($slug)
183 183
 		{
184
-			$path = '/' . $slug;
184
+			$path = '/'.$slug;
185 185
 			$this->repository->publishDocumentByPath($path);
186 186
 		}
187 187
 
188 188
 		public function unpublishDocumentBySlug($slug)
189 189
 		{
190
-			$path = '/' . $slug;
190
+			$path = '/'.$slug;
191 191
 			$this->repository->unpublishDocumentByPath($path);
192 192
 		}
193 193
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 		 */
202 202
 		public function getDocumentFolderBySlug($slug)
203 203
 		{
204
-			$path = '/' . $slug;
204
+			$path = '/'.$slug;
205 205
 
206 206
 			return $this->repository->getDocumentByPath($path);
207 207
 		}
Please login to merge, or discard this patch.
src/storage/storage/ImagesStorage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
         $destinationPath = $this->getDestinationPath();
46 46
 
47 47
         $filename = $this->validateFilename($postValues['name'], $destinationPath);
48
-        $destination = $destinationPath . DIRECTORY_SEPARATOR . $filename;
48
+        $destination = $destinationPath.DIRECTORY_SEPARATOR.$filename;
49 49
 
50 50
         if ($postValues['error'] != '0') {
51
-            throw new \Exception('Error uploading file. Error code: ' . $postValues['error']);
51
+            throw new \Exception('Error uploading file. Error code: '.$postValues['error']);
52 52
         }
53 53
 
54 54
         if (move_uploaded_file($postValues['tmp_name'], $destination)) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         foreach ($images as $key => $image) {
81 81
             if ($image->file == $filename) {
82 82
                 foreach ($image->set as $imageSetFilename) {
83
-                    $destination = $destinationPath . '/' . $imageSetFilename;
83
+                    $destination = $destinationPath.'/'.$imageSetFilename;
84 84
                     if (file_exists($destination)) {
85 85
                         unlink($destination);
86 86
                     } else {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     private function getDestinationPath()
130 130
     {
131
-        $destinationPath = realpath($this->imagesDir . DIRECTORY_SEPARATOR);
131
+        $destinationPath = realpath($this->imagesDir.DIRECTORY_SEPARATOR);
132 132
         return $destinationPath;
133 133
     }
134 134
 }
135 135
\ No newline at end of file
Please login to merge, or discard this patch.