Test Failed
Push — develop ( ff58ad...b8f9b2 )
by steve
13:44 queued 12s
created
firefly/migrations/m170830_121945_firefly_change_local_drive_to_media.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,17 +4,17 @@
 block discarded – undo
4 4
 
5 5
 class m170830_121945_firefly_change_local_drive_to_media extends Migration
6 6
 {
7
-    public function safeUp()
8
-    {
9
-        $this->execute('UPDATE firefly_file_manager SET drive = "media" WHERE drive = "local"');
10
-    }
7
+	public function safeUp()
8
+	{
9
+		$this->execute('UPDATE firefly_file_manager SET drive = "media" WHERE drive = "local"');
10
+	}
11 11
 
12
-    public function safeDown()
13
-    {
14
-        $this->execute('UPDATE firefly_file_manager SET drive = "local" WHERE drive = "media"');
15
-    }
12
+	public function safeDown()
13
+	{
14
+		$this->execute('UPDATE firefly_file_manager SET drive = "local" WHERE drive = "media"');
15
+	}
16 16
 
17
-    /*
17
+	/*
18 18
     // Use up()/down() to run migration code without a transaction.
19 19
     public function up()
20 20
     {
Please login to merge, or discard this patch.
neon/firefly/migrations/m161123_191412_firefly_files_table.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
 
6 6
 class m161123_191412_firefly_files_table extends Migration
7 7
 {
8
-    public function safeUp()
9
-    {
8
+	public function safeUp()
9
+	{
10 10
 		$this->createTable(DbFile::tableName(), [
11 11
 			// limit the path size on the db file storage driver.
12 12
 			// otherwise the key gets too big.
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 			'created_at' => $this->datetime()->comment('When the file was first created'),
36 36
 			'PRIMARY KEY (`path`(150))'
37 37
 		]);
38
-    }
38
+	}
39 39
 
40
-    public function safeDown()
41
-    {
40
+	public function safeDown()
41
+	{
42 42
 		$this->dropTable(DbFile::tableName());
43
-    }
43
+	}
44 44
 
45 45
 }
Please login to merge, or discard this patch.
firefly/migrations/m170312_165920_firefly_firefly_fix_uuid_collation.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,15 +4,15 @@
 block discarded – undo
4 4
 
5 5
 class m170312_165920_firefly_firefly_fix_uuid_collation extends Migration
6 6
 {
7
-    public function safeUp()
8
-    {
7
+	public function safeUp()
8
+	{
9 9
 		$query = "ALTER TABLE `firefly_file_manager` CHANGE `uuid` `uuid` CHAR(22) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'The unique identifier for this file'";
10 10
 		$this->execute($query);
11
-    }
11
+	}
12 12
 
13
-    public function safeDown()
14
-    {
13
+	public function safeDown()
14
+	{
15 15
 		$query = "ALTER TABLE `firefly_file_manager` CHANGE `uuid` `uuid` CHAR(22) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'The unique identifier for this file'";
16 16
 		$this->execute($query);
17
-    }
17
+	}
18 18
 }
Please login to merge, or discard this patch.
neon/firefly/migrations/m161126_123100_firefly_file_manager.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 class m161126_123100_firefly_file_manager extends Migration
7 7
 {
8 8
 
9
-    public function safeUp()
10
-    {
9
+	public function safeUp()
10
+	{
11 11
 		$this->createTable(FileManager::tableName(), [
12 12
 
13 13
 			'uuid' => $this->char(36)->notNull()->comment('The uuid for this file'),
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 			'PRIMARY KEY (uuid)'
36 36
 
37 37
 		]);
38
-    }
38
+	}
39 39
 
40
-    public function safeDown()
41
-    {
40
+	public function safeDown()
41
+	{
42 42
 		$this->dropTable(FileManager::tableName());
43
-    }
43
+	}
44 44
 
45 45
 }
Please login to merge, or discard this patch.
neon/firefly/migrations/m161130_132459_firefly_uuid_change_to_22_chars.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 
5 5
 class m161130_132459_firefly_uuid_change_to_22_chars extends Migration
6 6
 {
7
-    public function safeUp()
8
-    {
7
+	public function safeUp()
8
+	{
9 9
 		$this->alterColumn('firefly_file_manager', 'uuid', "CHAR(22) NOT NULL COMMENT 'The unique identifier for this file'");
10
-    }
10
+	}
11 11
 
12
-    public function safeDown()
13
-    {
12
+	public function safeDown()
13
+	{
14 14
 		$this->alterColumn('firefly_file_manager', 'uuid', "CHAR(36) NOT NULL COMMENT 'The uuid for this file'");
15
-    }
15
+	}
16 16
 }
Please login to merge, or discard this patch.
neon/firefly/migrations/m190204_134239_firefly_interface_change_db_fix.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	private function convertFireflyGetsToFiles($search, $replace)
34 34
 	{
35 35
 		$potentiallyAffected = $this->db->createCommand("SELECT `class_type`, `member_ref` FROM `dds_member` WHERE `data_type_ref`='textlong'")->queryAll();
36
-		if (count($potentiallyAffected)==0)
36
+		if (count($potentiallyAffected) == 0)
37 37
 			return;
38 38
 		$classes = [];
39 39
 		foreach ($potentiallyAffected as $pa)
@@ -70,21 +70,21 @@  discard block
 block discarded – undo
70 70
 
71 71
 		$dds = neon('dds')->IDdsObjectManagement;
72 72
 		foreach ($wysiwygFields as $classType => $fields) {
73
-			$start=0;
73
+			$start = 0;
74 74
 			do {
75 75
 				$found = $dds->listObjects($classType, $total, true, true, $start, 100);
76 76
 				$start += count($found);
77 77
 				foreach ($found as $objectData) {
78 78
 					$changes = [];
79 79
 					foreach ($fields as $field) {
80
-						if (!empty($objectData[$field]) && strpos($objectData[$field],$search)!==false)
80
+						if (!empty($objectData[$field]) && strpos($objectData[$field], $search) !== false)
81 81
 							$changes[$field] = str_replace($search, $replace, $objectData[$field]);
82 82
 					}
83 83
 					if (count($changes)) {
84 84
 						$dds->editObject($objectData['_uuid'], $changes);
85 85
 					}
86 86
 				}
87
-			} while (count($found)>0);
87
+			} while (count($found) > 0);
88 88
 		}
89 89
 
90 90
 		return true;
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,22 +33,26 @@  discard block
 block discarded – undo
33 33
 	private function convertFireflyGetsToFiles($search, $replace)
34 34
 	{
35 35
 		$potentiallyAffected = $this->db->createCommand("SELECT `class_type`, `member_ref` FROM `dds_member` WHERE `data_type_ref`='textlong'")->queryAll();
36
-		if (count($potentiallyAffected)==0)
37
-			return;
36
+		if (count($potentiallyAffected)==0) {
37
+					return;
38
+		}
38 39
 		$classes = [];
39
-		foreach ($potentiallyAffected as $pa)
40
-			$classes[$pa['class_type']][] = $pa['member_ref'];
40
+		foreach ($potentiallyAffected as $pa) {
41
+					$classes[$pa['class_type']][] = $pa['member_ref'];
42
+		}
41 43
 		$phoebeClasses = array_keys($classes);
42 44
 		$phoebe = neon('phoebe')->getIPhoebeType('daedalus');
43 45
 
44 46
 		$phoebeDefinition = [];
45
-		foreach ($phoebeClasses as $pc)
46
-			$phoebeDefinition[$pc] = $phoebe->getClass($pc, null, false);
47
+		foreach ($phoebeClasses as $pc) {
48
+					$phoebeDefinition[$pc] = $phoebe->getClass($pc, null, false);
49
+		}
47 50
 
48 51
 		$potentiallyAffectedLookup = [];
49 52
 		foreach ($potentiallyAffected as $pa) {
50
-			if (empty($potentiallyAffectedLookup[$pa['class_type']]))
51
-				$potentiallyAffectedLookup[$pa['class_type']] = [];
53
+			if (empty($potentiallyAffectedLookup[$pa['class_type']])) {
54
+							$potentiallyAffectedLookup[$pa['class_type']] = [];
55
+			}
52 56
 			$potentiallyAffectedLookup[$pa['class_type']][] = $pa['member_ref'];
53 57
 		}
54 58
 
@@ -77,8 +81,9 @@  discard block
 block discarded – undo
77 81
 				foreach ($found as $objectData) {
78 82
 					$changes = [];
79 83
 					foreach ($fields as $field) {
80
-						if (!empty($objectData[$field]) && strpos($objectData[$field],$search)!==false)
81
-							$changes[$field] = str_replace($search, $replace, $objectData[$field]);
84
+						if (!empty($objectData[$field]) && strpos($objectData[$field],$search)!==false) {
85
+													$changes[$field] = str_replace($search, $replace, $objectData[$field]);
86
+						}
82 87
 					}
83 88
 					if (count($changes)) {
84 89
 						$dds->editObject($objectData['_uuid'], $changes);
Please login to merge, or discard this patch.
neon/firefly/App.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	/**
204 204
 	 * @inheritdoc
205 205
 	 */
206
-	public function getImage($uuid, $params=[])
206
+	public function getImage($uuid, $params = [])
207 207
 	{
208 208
 		return $this->fileManager->getImage($uuid, $params);
209 209
 	}
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	 * @param  string  $name
301 301
 	 * @return \neon\firefly\services\driveManager\interfaces\IFileSystem
302 302
 	 */
303
-	public function drive($name=null)
303
+	public function drive($name = null)
304 304
 	{
305 305
 		return $this->driveManager->drive($name);
306 306
 	}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	/**
309 309
 	 * @inheritdoc
310 310
 	 */
311
-	public function sendFile($uuid, $download=false)
311
+	public function sendFile($uuid, $download = false)
312 312
 	{
313 313
 		return $this->fileManager->sendFile($uuid, $download);
314 314
 	}
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 * @param boolean $throwExceptions - whether to throw exceptions on validation failure
365 365
 	 * @return boolean
366 366
 	 */
367
-	public function isFileObjectValid($file, $throwExceptions=true)
367
+	public function isFileObjectValid($file, $throwExceptions = true)
368 368
 	{
369 369
 		if ($file instanceof IFile)
370 370
 			return true;
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 			&& method_exists($file, 'getRealPath')
375 375
 			&& method_exists($file, 'getFilename');
376 376
 		// the $file param must be an object with getRealPath and getFilename functions
377
-		if (! $objectIsValid && $throwExceptions) {
377
+		if (!$objectIsValid && $throwExceptions) {
378 378
 			throw new \InvalidArgumentException('$file param must be an object with a getRealPath and getFilename method');
379 379
 		}
380 380
 		return $objectIsValid;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -366,8 +366,9 @@
 block discarded – undo
366 366
 	 */
367 367
 	public function isFileObjectValid($file, $throwExceptions=true)
368 368
 	{
369
-		if ($file instanceof IFile)
370
-			return true;
369
+		if ($file instanceof IFile) {
370
+					return true;
371
+		}
371 372
 		// not all objects have the privilege of implementing the IFile interface like \SplFileObject
372 373
 		// Firefly only cares about these two functions 'getRealPath' and 'getFilename'
373 374
 		$objectIsValid = is_object($file)
Please login to merge, or discard this patch.
neon/cms/components/Theme.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 * @param array &$read - the set of read components to prevent infinite looping
67 67
 	 * @return array  the set of components
68 68
 	 */
69
-	private static function &getComponents($path, &$components=[], &$read=[])
69
+	private static function &getComponents($path, &$components = [], &$read = [])
70 70
 	{
71 71
 		$root = self::getRoot();
72 72
 		$configFile = $root.$path.'/_config.php';
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 					}
92 92
 				}
93 93
 			} catch (\Exception $e) {
94
-				throw new \InvalidArgumentException("Something went wrong when trying to parse the config file $configFile. The error was ".$e->getMessage(). ". The file contained <pre>".print_r($config,true)."</pre>.");
94
+				throw new \InvalidArgumentException("Something went wrong when trying to parse the config file $configFile. The error was ".$e->getMessage().". The file contained <pre>".print_r($config, true)."</pre>.");
95 95
 			}
96 96
 		}
97 97
 		return $components;
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,9 @@  discard block
 block discarded – undo
29 29
 			if (is_string($root) && count($themes)) {
30 30
 				foreach ($themes as $theme) {
31 31
 					$themePath = $root.$theme;
32
-					if (!isset($hierarchy[$theme]))
33
-						$hierarchy[$theme] = [];
32
+					if (!isset($hierarchy[$theme])) {
33
+											$hierarchy[$theme] = [];
34
+					}
34 35
 
35 36
 					// add the default template and plugin directories
36 37
 					$hierarchy[$theme]['templates'][] = $themePath;
@@ -104,8 +105,9 @@  discard block
 block discarded – undo
104 105
 	private static function getRoot()
105 106
 	{
106 107
 		static $root = null;
107
-		if ($root === null)
108
-			$root = Neon::getAlias('@root/themes/');
108
+		if ($root === null) {
109
+					$root = Neon::getAlias('@root/themes/');
110
+		}
109 111
 		return $root;
110 112
 	}
111 113
 }
Please login to merge, or discard this patch.
neon/cms/grid/PageGrid.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 
51 51
 
52 52
 		$this->addButtonColumn('edit')
53
-			->addButton('edit', ['/cms/editor/index' , 'id' => '{{nice_id}}'], '', '', '', ['data-toggle' => 'tooltip', 'title'=>'Edit']);
53
+			->addButton('edit', ['/cms/editor/index', 'id' => '{{nice_id}}'], '', '', '', ['data-toggle' => 'tooltip', 'title'=>'Edit']);
54 54
 
55 55
 		$this->addScope('published', 'Published');
56 56
 		$this->addScope('draft', 'Draft');
Please login to merge, or discard this patch.