Passed
Push — develop ( 319bd8...330c7a )
by Neill
16:41 queued 15s
created
neon/daedalus/controllers/common/DaedalusController.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -82,8 +82,9 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	protected function ddo()
84 84
 	{
85
-		if ($this->_ddo == null)
86
-			$this->_ddo = neon('dds')->IDdsObjectManagement;
85
+		if ($this->_ddo == null) {
86
+					$this->_ddo = neon('dds')->IDdsObjectManagement;
87
+		}
87 88
 		return $this->_ddo;
88 89
 	}
89 90
 
@@ -92,8 +93,9 @@  discard block
 block discarded – undo
92 93
 	 */
93 94
 	protected function ddc()
94 95
 	{
95
-		if ($this->_ddc == null)
96
-			$this->_ddc = neon('dds')->IDdsClassManagement;
96
+		if ($this->_ddc == null) {
97
+					$this->_ddc = neon('dds')->IDdsClassManagement;
98
+		}
97 99
 		return $this->_ddc;
98 100
 	}
99 101
 
@@ -102,8 +104,9 @@  discard block
 block discarded – undo
102 104
 	 */
103 105
 	protected function ddt()
104 106
 	{
105
-		if ($this->_ddt == null)
106
-			$this->_ddt = neon('dds')->IDdsDataTypeManagement;
107
+		if ($this->_ddt == null) {
108
+					$this->_ddt = neon('dds')->IDdsDataTypeManagement;
109
+		}
107 110
 		return $this->_ddt;
108 111
 	}
109 112
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 	 * @param array $options additional options for the form
40 40
 	 * @return \neon\core\form\Form
41 41
 	 */
42
-	protected function getPhoebeForm($type, $options=[])
42
+	protected function getPhoebeForm($type, $options = [])
43 43
 	{
44 44
 		return neon()->phoebe->getForm('daedalus', $type, $options);
45 45
 	}
Please login to merge, or discard this patch.
neon/daedalus/controllers/api/ClassController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 		} catch (\Exception $e) {
66 66
 			// error occured lets see if it's because the class does not exist
67 67
 			if (neon()->getDds()->IDdsClassManagement->getClass($class) === null) {
68
-				throw new HttpException(404, 'No class exists with name ' . $class);
68
+				throw new HttpException(404, 'No class exists with name '.$class);
69 69
 			}
70 70
 			throw new HttpException(500, $e->getMessage());
71 71
 		}
Please login to merge, or discard this patch.
neon/daedalus/controllers/api/MapController.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,15 +47,15 @@  discard block
 block discarded – undo
47 47
 	 * @return array uuid => map field
48 48
 	 * @throws
49 49
 	 */
50
-	public function actionObjects($class, $filter='', $length=100, $member='', $value='', $start=0)
50
+	public function actionObjects($class, $filter = '', $length = 100, $member = '', $value = '', $start = 0)
51 51
 	{
52 52
 		$mapFilter = [];
53 53
 		if (!$class)
54 54
 			throw new HttpException(404, "No class name provided");
55 55
 		if ($member && $value)
56
-			$mapFilter[$member]=$value;
56
+			$mapFilter[$member] = $value;
57 57
 		if ($filter && is_string($filter))
58
-			$mapFilter['_map_field_']=$filter;
58
+			$mapFilter['_map_field_'] = $filter;
59 59
 		return neon()->getDds()->IDdsObjectManagement->getObjectMap($class, $mapFilter, [], $start, $length);
60 60
 	}
61 61
 
@@ -64,17 +64,17 @@  discard block
 block discarded – undo
64 64
 		return neon('user')->getDataMapTypes();
65 65
 	}
66 66
 
67
-	public function actionUsers($filter='')
67
+	public function actionUsers($filter = '')
68 68
 	{
69 69
 		return neon('user')->getDataMap('users', $filter);
70 70
 	}
71 71
 
72
-	public function actionPages($filter='')
72
+	public function actionPages($filter = '')
73 73
 	{
74 74
 		return neon('cms')->getDataMap('pages', $filter);
75 75
 	}
76 76
 
77
-	public function actionPhoebe($type='', $filter='')
77
+	public function actionPhoebe($type = '', $filter = '')
78 78
 	{
79 79
 		$filters = [];
80 80
 		if (!$filter) {
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,12 +50,15 @@  discard block
 block discarded – undo
50 50
 	public function actionObjects($class, $filter='', $length=100, $member='', $value='', $start=0)
51 51
 	{
52 52
 		$mapFilter = [];
53
-		if (!$class)
54
-			throw new HttpException(404, "No class name provided");
55
-		if ($member && $value)
56
-			$mapFilter[$member]=$value;
57
-		if ($filter && is_string($filter))
58
-			$mapFilter['_map_field_']=$filter;
53
+		if (!$class) {
54
+					throw new HttpException(404, "No class name provided");
55
+		}
56
+		if ($member && $value) {
57
+					$mapFilter[$member]=$value;
58
+		}
59
+		if ($filter && is_string($filter)) {
60
+					$mapFilter['_map_field_']=$filter;
61
+		}
59 62
 		return neon()->getDds()->IDdsObjectManagement->getObjectMap($class, $mapFilter, [], $start, $length);
60 63
 	}
61 64
 
@@ -83,8 +86,7 @@  discard block
 block discarded – undo
83 86
 					['like', 'label', $filter],
84 87
 					['like', 'class_type', $filter]
85 88
 				];
86
-			}
87
-			else if ($type === 'phoebe_object') {
89
+			} else if ($type === 'phoebe_object') {
88 90
 				$filters = ['like', 'uuid', $filter];
89 91
 			}
90 92
 		}
Please login to merge, or discard this patch.
neon/daedalus/controllers/ChangeLogController.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		]);
40 40
 	}
41 41
 
42
-	public function actionList($type, $uuid=null)
42
+	public function actionList($type, $uuid = null)
43 43
 	{
44 44
 		// sort out where we're going back to
45 45
 		$goBackTo = url(['index/list', 'type'=>$type]);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 			$goBackTo = url(['index/list', 'type'=>$type, 'uuid' => $uuid]);
48 48
 
49 49
 		// check the class has a change log
50
-		$class = ['class_type' => $type, 'label'=>ucwords(str_replace('_',' ',$type))];
50
+		$class = ['class_type' => $type, 'label'=>ucwords(str_replace('_', ' ', $type))];
51 51
 		$hasChangeLog = $this->cl->hasChangeLog($type);
52 52
 		if (!$hasChangeLog) {
53 53
 			return $this->render('list.tpl', [
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 			case 'COMMENT':
103 103
 				if (!$uuid)
104 104
 					$render['title'] = "Comment added on ".date("d-m-Y \\a\\t H:i:s", strtotime($logEntry['when']));
105
-				if (is_array($logEntry['associated_objects']) && count($logEntry['associated_objects'])>0)
105
+				if (is_array($logEntry['associated_objects']) && count($logEntry['associated_objects']) > 0)
106 106
 					$render['associated_objects'] = implode(', ', $logEntry['associated_objects']);
107 107
 			case 'DESTROY':
108 108
 			case 'DELETE':
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@  discard block
 block discarded – undo
43 43
 	{
44 44
 		// sort out where we're going back to
45 45
 		$goBackTo = url(['index/list', 'type'=>$type]);
46
-		if ($uuid)
47
-			$goBackTo = url(['index/list', 'type'=>$type, 'uuid' => $uuid]);
46
+		if ($uuid) {
47
+					$goBackTo = url(['index/list', 'type'=>$type, 'uuid' => $uuid]);
48
+		}
48 49
 
49 50
 		// check the class has a change log
50 51
 		$class = ['class_type' => $type, 'label'=>ucwords(str_replace('_',' ',$type))];
@@ -77,16 +78,18 @@  discard block
 block discarded – undo
77 78
 	public function actionViewObject($uuid, $logUuid)
78 79
 	{
79 80
 		$logEntry = $this->cl->getLogEntry($logUuid);
80
-		if (!$logEntry)
81
-			return 'Log not found';
81
+		if (!$logEntry) {
82
+					return 'Log not found';
83
+		}
82 84
 		$type = $logEntry['class_type'];
83 85
 
84 86
 		$class = $this->getClassAsArray($type);
85 87
 		$goBackTo = url(['change-log/list', 'type'=>$type, 'uuid' => $uuid]);
86
-		if ($uuid)
87
-			$headerTitle = "$class[label] [Object '$uuid'] Change Log";
88
-		else
89
-			$headerTitle = "$class[label] Change Log";
88
+		if ($uuid) {
89
+					$headerTitle = "$class[label] [Object '$uuid'] Change Log";
90
+		} else {
91
+					$headerTitle = "$class[label] Change Log";
92
+		}
90 93
 
91 94
 		$title = "Status of $uuid on ".date("d-m-Y \\a\\t H:i:s", strtotime($logEntry['when']));
92 95
 		$render = [
@@ -100,10 +103,12 @@  discard block
 block discarded – undo
100 103
 		];
101 104
 		switch ($logEntry['change_key']) {
102 105
 			case 'COMMENT':
103
-				if (!$uuid)
104
-					$render['title'] = "Comment added on ".date("d-m-Y \\a\\t H:i:s", strtotime($logEntry['when']));
105
-				if (is_array($logEntry['associated_objects']) && count($logEntry['associated_objects'])>0)
106
-					$render['associated_objects'] = implode(', ', $logEntry['associated_objects']);
106
+				if (!$uuid) {
107
+									$render['title'] = "Comment added on ".date("d-m-Y \\a\\t H:i:s", strtotime($logEntry['when']));
108
+				}
109
+				if (is_array($logEntry['associated_objects']) && count($logEntry['associated_objects'])>0) {
110
+									$render['associated_objects'] = implode(', ', $logEntry['associated_objects']);
111
+				}
107 112
 			case 'DESTROY':
108 113
 			case 'DELETE':
109 114
 				$renderFile = 'viewLogEntry.tpl';
Please login to merge, or discard this patch.
neon/daedalus/migrations/m20200119_192834_dds_update_change_log.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 	public function safeDown()
16 16
 	{
17
-		$this->execute("ALTER TABLE dds_change_log MODIFY `object_uuid` char(22) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'The object that was changed'");		$this->execute("ALTER TABLE dds_change_log DROP COLUMN `before`;");
17
+		$this->execute("ALTER TABLE dds_change_log MODIFY `object_uuid` char(22) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'The object that was changed'"); $this->execute("ALTER TABLE dds_change_log DROP COLUMN `before`;");
18 18
 		$this->execute("ALTER TABLE dds_change_log DROP COLUMN `after`;");
19 19
 		$this->execute("ALTER TABLE dds_change_log ADD `changes` longblob COMMENT 'What the changes were' AFTER `when`;");
20 20
 	}
Please login to merge, or discard this patch.
neon/daedalus/migrations/m170724_112209_dds_link_table_creation.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
  */
10 10
 class m170724_112209_dds_link_table_creation extends Migration
11 11
 {
12
-    public function safeUp()
13
-    {
12
+	public function safeUp()
13
+	{
14 14
 		// create a linking table for links
15 15
 		$tableOptions = null;
16 16
 		if ($this->db->driverName === 'mysql') {
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 
41 41
 	}
42 42
 
43
-    public function safeDown()
44
-    {
43
+	public function safeDown()
44
+	{
45 45
 		$this->dropTable('dds_link');
46 46
 		$connection = neon()->db;
47 47
 		$sql =<<<EOQ
@@ -52,5 +52,5 @@  discard block
 block discarded – undo
52 52
 		$this->execute($sql);
53 53
 		$this->dropColumn('dds_member', 'link_class');
54 54
 
55
-    }
55
+	}
56 56
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		], $tableOptions);
27 27
 
28 28
 		// create the new link and link datatypes
29
-		$sql =<<<EOQ
29
+		$sql = <<<EOQ
30 30
 SET foreign_key_checks = 0;
31 31
 REPLACE INTO `dds_data_type` (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`)
32 32
 VALUES
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
 		$this->dropTable('dds_link');
46 46
 		$connection = neon()->db;
47
-		$sql =<<<EOQ
47
+		$sql = <<<EOQ
48 48
 SET foreign_key_checks=0;
49 49
 DELETE FROM `dds_data_type` WHERE `data_type_ref`='link';
50 50
 SET foreign_key_checks=1;
Please login to merge, or discard this patch.
neon/daedalus/migrations/m161201_170340_dds_add_map_field_to_members.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@
 block discarded – undo
5 5
 class m161201_170340_dds_add_map_field_to_members extends Migration
6 6
 {
7 7
 
8
-    public function safeUp()
9
-    {
8
+	public function safeUp()
9
+	{
10 10
 		$this->addColumn('dds_member', 'map_field', "TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'If true, then this is field data used in defining maps' AFTER `definition`");
11
-    }
11
+	}
12 12
 
13
-    public function safeDown()
14
-    {
13
+	public function safeDown()
14
+	{
15 15
 		$this->dropColumn('dds_member', 'map_field');
16
-    }
16
+	}
17 17
 
18 18
 }
Please login to merge, or discard this patch.
migrations/deprecatedMigrations/m170103_151935_dds_new_data_types.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 		$this->alterColumn('dds_storage', 'type', "enum('INTEGER_TINY','INTEGER_SHORT','INTEGER','INTEGER_LONG','FLOAT','DOUBLE','DATE','DATETIME','TEXT_SHORT','TEXT','TEXT_LONG','BINARY_SHORT','BINARY','BINARY_LONG','CHAR','TIME') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the storage type'");
12 12
 
13
-		$sql =<<<EOQ
13
+		$sql = <<<EOQ
14 14
 SET foreign_key_checks = 0;
15 15
 REPLACE INTO {{%dds_storage}} (`storage_ref`, `label`, `type`, `description`)
16 16
 VALUES
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		$connection->createCommand($sql)->execute();
22 22
 
23 23
 
24
-		$sql =<<<EOQ
24
+		$sql = <<<EOQ
25 25
 SET foreign_key_checks = 0;
26 26
 REPLACE INTO {{%dds_data_type}} (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`)
27 27
 VALUES
Please login to merge, or discard this patch.
deprecatedMigrations/m170121_171048_dds_dds_changes_for_choices.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 //		$connection->createCommand($sql)->execute();
26 26
 
27 27
 		// 1. add the choices datatype
28
-$sql =<<<EOQ
28
+$sql = <<<EOQ
29 29
 SET foreign_key_checks = 0;
30 30
 REPLACE INTO `dds_data_type` (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`)
31 31
 VALUES
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	{
47 47
 		$connection = neon()->db;
48 48
 
49
-$sql =<<<EOQ
49
+$sql = <<<EOQ
50 50
 SET foreign_key_checks = 0;
51 51
 DELETE FROM {{%dds_data_type}} WHERE `data_type_ref`='choice' LIMIT 1;
52 52
 SET foreign_key_checks = 1;
Please login to merge, or discard this patch.