Passed
Push — releases ( 51c2cc...e1d10c )
by steve
39:06 queued 13:38
created
neon/admin/App.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 					['class'=>'email'],
32 32
 					['class'=>'required']
33 33
 				],
34
-				'placeholder' => 'e.g. robot@' . strtolower(setting('core', 'site_name', neon()->name)) . '.com'
34
+				'placeholder' => 'e.g. robot@'.strtolower(setting('core', 'site_name', neon()->name)).'.com'
35 35
 			],
36 36
 			'fromEmailName' => [
37 37
 				'name' => 'fromEmailName',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 				'name' => 'sslOnly',
44 44
 				'class' => '\neon\core\form\fields\SwitchButton',
45 45
 				'label' => 'Force SSL (https) everywhere',
46
-				'hint' => 'The application will redirect all requests to secure https requests. ' .
46
+				'hint' => 'The application will redirect all requests to secure https requests. '.
47 47
 					(neon()->isDevMode() ? 'Note: You are currently in dev mode so the redirects to https will not happen' : '')
48 48
 			],
49 49
 		];
Please login to merge, or discard this patch.
neon/install/helpers/requirements.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         (for example, plural in
72 72
         <a href=\"http://www.yiiframework.com/doc-2.0/yii-i18n-formatter.html#asRelativeTime%28%29-detail\">
73 73
         Formatter::asRelativeTime()</a>) in the <code>yii\i18n\Formatter</code> class. Your current ICU version is ' .
74
-			(defined('INTL_ICU_VERSION') ? INTL_ICU_VERSION : '(ICU is missing)') . '.'
74
+			(defined('INTL_ICU_VERSION') ? INTL_ICU_VERSION : '(ICU is missing)').'.'
75 75
 	],
76 76
 	[
77 77
 		'name' => 'ICU Data version',
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         (for example, plural in
83 83
         <a href=\"http://www.yiiframework.com/doc-2.0/yii-i18n-formatter.html#asRelativeTime%28%29-detail\">
84 84
         Formatter::asRelativeTime()</a>) in the <code>yii\i18n\Formatter</code> class. Your current ICU Data version is ' .
85
-			(defined('INTL_ICU_DATA_VERSION') ? INTL_ICU_DATA_VERSION : '(ICU Data is missing)') . '.'
85
+			(defined('INTL_ICU_DATA_VERSION') ? INTL_ICU_DATA_VERSION : '(ICU Data is missing)').'.'
86 86
 	],
87 87
 	[
88 88
 		'name' => 'Fileinfo extension',
Please login to merge, or discard this patch.
neon/install/helpers/InstallHelper.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -335,7 +335,7 @@
 block discarded – undo
335 335
 	 * Check the system requirements
336 336
 	 * Returns an array of tests that detect if the system meats the requirements for Neon
337 337
 	 *
338
-	* @return array of requirement tests:
338
+	 * @return array of requirement tests:
339 339
 	 *  for e.g:
340 340
 	 *
341 341
 	 * ```php
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public static function getLocalConfigFile()
23 23
 	{
24
-		return \Neon::getALias(DIR_CONFIG . '/env.ini');
24
+		return \Neon::getALias(DIR_CONFIG.'/env.ini');
25 25
 	}
26 26
 
27 27
 	/**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 			0 => 'Ready Check', // (a requirements check stage)
44 44
 			1 => 'Configure', // condition=>self::hasLocalConfigFile  // create config file
45
-			2 => 'Database Install',// condition=>self::tablesExist  // install tables
45
+			2 => 'Database Install', // condition=>self::tablesExist  // install tables
46 46
 			3 => 'Account', // condition=>self::hasUserAccount // install user admin account
47 47
 			4 => 'Log In' // (just a "well done, all done", link to log in page)
48 48
 		];
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		try {
113 113
 			\Neon::$app->db->open();
114 114
 			return true;
115
-		} catch(\Exception $e) {
115
+		} catch (\Exception $e) {
116 116
 			return false;
117 117
 		}
118 118
 	}
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
 	public static function getAllMigrations()
226 226
 	{
227 227
 		$migrations = ['core' => [], 'apps' => []];
228
-		foreach(neon()->getCoreApps() as $appName => $config) {
228
+		foreach (neon()->getCoreApps() as $appName => $config) {
229 229
 			$app = neon()->getApp($appName);
230 230
 			if ($app) {
231 231
 				$ms = $app->getNewMigrations();
232 232
 				$migrations['core'][$appName] = $ms;
233 233
 			}
234 234
 		}
235
-		foreach(neon()->getApps() as $appName => $config) {
235
+		foreach (neon()->getApps() as $appName => $config) {
236 236
 			$app = neon()->getApp($appName);
237 237
 			if ($app) {
238 238
 				$ms = $app->getNewMigrations();
@@ -397,11 +397,11 @@  discard block
 block discarded – undo
397 397
 	 * @return boolean
398 398
 	 * @throws \yii\db\Exception
399 399
 	 */
400
-	private static function checkForUserAccounts($super=false)
400
+	private static function checkForUserAccounts($super = false)
401 401
 	{
402 402
 		$userTable = \neon\user\models\User::tableName();
403 403
 		try {
404
-			$query = 'SELECT `id` from ' . $userTable;
404
+			$query = 'SELECT `id` from '.$userTable;
405 405
 			if ($super)
406 406
 				$query .= " WHERE `super`=1";
407 407
 			$result = neon()->db->createCommand($query)->queryOne();
Please login to merge, or discard this patch.
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -377,14 +377,11 @@  discard block
 block discarded – undo
377 377
 			$msg = $e->getMessage();
378 378
 			if (preg_match('/\bUnknown database\b/i', $msg)) {
379 379
 				return static::ERROR_DB_UNKNOWN_DATABASE;
380
-			}
381
-			else if (preg_match('/\bUnknown .* server host\b/i', $msg)) {
380
+			} else if (preg_match('/\bUnknown .* server host\b/i', $msg)) {
382 381
 				return static::ERROR_DB_UNKNOWN_HOST;
383
-			}
384
-			else if (preg_match('/\bAccess denied for user\b/i', $msg)) {
382
+			} else if (preg_match('/\bAccess denied for user\b/i', $msg)) {
385 383
 				return static::ERROR_DB_ACCESS_DENIED;
386
-			}
387
-			else {
384
+			} else {
388 385
 				return static::ERROR_DB;
389 386
 			}
390 387
 		}
@@ -402,8 +399,9 @@  discard block
 block discarded – undo
402 399
 		$userTable = \neon\user\models\User::tableName();
403 400
 		try {
404 401
 			$query = 'SELECT `id` from ' . $userTable;
405
-			if ($super)
406
-				$query .= " WHERE `super`=1";
402
+			if ($super) {
403
+							$query .= " WHERE `super`=1";
404
+			}
407 405
 			$result = neon()->db->createCommand($query)->queryOne();
408 406
 		} catch (\yii\db\Exception $e) {
409 407
 			// if this has thrown an exception because the user table does not exist.
Please login to merge, or discard this patch.
neon/install/controllers/AccountController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 		if ($model->load(\Yii::$app->request->post()) && $model->validate()) {
36 36
 			$success = $model->createUser($user);
37 37
 			if ($success === false) {
38
-				throw new \Exception('Unable to create and save a valid user ' . print_r($user->getErrors(), true));
38
+				throw new \Exception('Unable to create and save a valid user '.print_r($user->getErrors(), true));
39 39
 			} else {
40 40
 				return $this->redirect(['/install/account/complete']);
41 41
 			}
Please login to merge, or discard this patch.
neon/install/controllers/DatabaseController.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 	 */
47 47
 	public function actionMigrations()
48 48
 	{
49
-	    ob_start();
49
+		ob_start();
50 50
 		$migrator = new \neon\core\db\Migrator();
51 51
 		$migrator->runAllMigrations();
52 52
 		$migrations = ob_get_clean();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,10 +106,10 @@
 block discarded – undo
106 106
 			// show message saying no config file found
107 107
 			// and provide a button to go back to the config step /install/config
108 108
 			$errorResponse = $this->render('/install/_error.tpl', [
109
-				'message' => 'Could not find the database <strong>' . env('DB_NAME') . '</strong>',
109
+				'message' => 'Could not find the database <strong>'.env('DB_NAME').'</strong>',
110 110
 				'buttons' => [
111 111
 					[
112
-						'label' => 'Try to Create &amp; Install Database <strong>' . env('DB_NAME') . '</strong>',
112
+						'label' => 'Try to Create &amp; Install Database <strong>'.env('DB_NAME').'</strong>',
113 113
 						'url' => Url::toRoute(['/install/database/create-database']),
114 114
 						'iconClass' => 'fa fa-plus',
115 115
 						'type' => 'primary',
Please login to merge, or discard this patch.
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,10 +26,12 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		neon()->view->params['step'] = 2;
28 28
 
29
-		if ($this->hasLocalConfigError($errorResponse))
30
-			return $errorResponse;
31
-		if ($this->hasDatabaseError($errorResponse))
32
-			return $errorResponse;
29
+		if ($this->hasLocalConfigError($errorResponse)) {
30
+					return $errorResponse;
31
+		}
32
+		if ($this->hasDatabaseError($errorResponse)) {
33
+					return $errorResponse;
34
+		}
33 35
 
34 36
 		// check if tables have already been installed:
35 37
 		if (InstallHelper::coreInstalled()) {
@@ -123,8 +125,7 @@  discard block
 block discarded – undo
123 125
 				]
124 126
 			]);
125 127
 			return true;
126
-		}
127
-		else if ($error !== 0) {
128
+		} else if ($error !== 0) {
128 129
 			// show message saying no config file found
129 130
 			// and provide a button to go back to the config step /install/config
130 131
 			$errorResponse = $this->render('/install/_error.tpl', [
Please login to merge, or discard this patch.
neon/install/controllers/ConfigController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 					InstallHelper::createConfigFile($installer);
54 54
 					return $this->render('_created');
55 55
 				}
56
-				return $this->render('_show', [ 'config' => InstallHelper::createConfigFileContents($installer) ]);
56
+				return $this->render('_show', ['config' => InstallHelper::createConfigFileContents($installer)]);
57 57
 			}
58 58
 		}
59 59
 		return $this->render('index', ['model'=>$installer]);
Please login to merge, or discard this patch.
neon/install/forms/InstallDatabase.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
 class InstallDatabase extends \yii\base\Model
8 8
 {
9
-	public $name='';
9
+	public $name = '';
10 10
 	public $username;
11 11
 	public $password;
12 12
 	public $host = 'localhost';
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
 		} else {
53 53
 			if ($result == InstallHelper::ERROR_DB_UNKNOWN_DATABASE) {
54 54
 				// Attempt to create the database (if asked to do so)
55
-				if ($this->create_database == 1 ) {
56
-					if (! $this->createDatabase($exception)) {
55
+				if ($this->create_database == 1) {
56
+					if (!$this->createDatabase($exception)) {
57 57
 						$this->error_message = 'cant_create_database';
58
-						$this->addError('name', 'Failed to create database "' . $this->name . '" Database error: ' . $exception);
58
+						$this->addError('name', 'Failed to create database "'.$this->name.'" Database error: '.$exception);
59 59
 					}
60
-				}  else {
60
+				} else {
61 61
 					$this->error_message = 'unknown_database';
62
-					$this->addError('name', 'Unknown database name "' . $this->name . '"');
62
+					$this->addError('name', 'Unknown database name "'.$this->name.'"');
63 63
 				}
64 64
 			} else if ($result == InstallHelper::ERROR_DB_UNKNOWN_HOST) {
65 65
 				$this->error_message = 'unknown_host';
66
-				$this->addError('host', 'Unknown host name "' . $this->host . '"');
66
+				$this->addError('host', 'Unknown host name "'.$this->host.'"');
67 67
 			} else if ($result == InstallHelper::ERROR_DB_ACCESS_DENIED) {
68 68
 				$this->error_message = 'access_denied';
69 69
 				$this->addError('username', 'The username either does not exist or does not work with the given password');
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			$config['dsn'] = 'mysql:host='.$this->host.';';
88 88
 			$connection = new \neon\core\db\Connection($config);
89 89
 			try {
90
-				$connection->createCommand('CREATE DATABASE ' . $this->name)->execute();
90
+				$connection->createCommand('CREATE DATABASE '.$this->name)->execute();
91 91
 			} catch (\yii\db\Exception $e) {
92 92
 				// could not create the database
93 93
 				$exception = $e->getMessage();
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 						$this->error_message = 'cant_create_database';
58 58
 						$this->addError('name', 'Failed to create database "' . $this->name . '" Database error: ' . $exception);
59 59
 					}
60
-				}  else {
60
+				} else {
61 61
 					$this->error_message = 'unknown_database';
62 62
 					$this->addError('name', 'Unknown database name "' . $this->name . '"');
63 63
 				}
Please login to merge, or discard this patch.
neon/install/forms/InstallUser.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@
 block discarded – undo
43 43
 	 */
44 44
 	public function createUser(&$user)
45 45
 	{
46
-		if (!$this->validate())
47
-			return false;
46
+		if (!$this->validate()) {
47
+					return false;
48
+		}
48 49
 		$user = new User();
49 50
 		$user->username = $this->username;
50 51
 		$user->email = $this->email;
Please login to merge, or discard this patch.
neon/daedalus/interfaces/IDdsChangeLogManagement.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @param \neon\core\helpers\Iterator $iterator  Iterate over the results.
64 64
 	 * @return array  the change log data
65 65
 	 */
66
-	public function listChangeLog($fromDate=null, Iterator $iterator=null);
66
+	public function listChangeLog($fromDate = null, Iterator $iterator = null);
67 67
 
68 68
 	/**
69 69
 	 * List an object's change log, if the object's class has been set up to store changes
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 * @return If the object's class is set to have a change log, this will return the
74 74
 	 *   change log for this object. Otherwise it will return a blank array.
75 75
 	 */
76
-	public function listObjectChangeLog($uuid, $fromDate=null, Iterator $iterator=null);
76
+	public function listObjectChangeLog($uuid, $fromDate = null, Iterator $iterator = null);
77 77
 
78 78
 	/**
79 79
 	 * List the history of an object, if the object's class has been set up to store changes.
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 * @return If the object's class is set to have a change log, this will return the
85 85
 	 *   history for this object. Otherwise it will return a blank array.
86 86
 	 */
87
-	public function listObjectHistory($uuid, $fromDate=null, Iterator $iterator=null);
87
+	public function listObjectHistory($uuid, $fromDate = null, Iterator $iterator = null);
88 88
 
89 89
 	/**
90 90
 	 * Clear change log to a certain date and optionally for particular class types
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 *   then the $classList is the set of log items to be preserved and all
99 99
 	 *   others are cleared.
100 100
 	 */
101
-	public function clearChangeLog($toDate, $classList=[], $clearClassList=true);
101
+	public function clearChangeLog($toDate, $classList = [], $clearClassList = true);
102 102
 
103 103
 	/**
104 104
 	 * Clear an object's change log
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 *   This can be empty, if the item was deleted or destroyed for example.
125 125
 	 * @return string  the uuid of the created log entry
126 126
 	 */
127
-	public function addLogEntry($objectUuid, $class, $changeKey, $before=[], $after=[]);
127
+	public function addLogEntry($objectUuid, $class, $changeKey, $before = [], $after = []);
128 128
 
129 129
 	/**
130 130
 	 * Get the log entry
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 * @param array $associateObjectUuids  any associated objects that are related to the principal one.
164 164
 	 * @return string  the uuid of the created log entry
165 165
 	 */
166
-	public function addGeneralComment($module, $classType, $comment, $objectUuid=null, array $associateObjectUuids=[]);
166
+	public function addGeneralComment($module, $classType, $comment, $objectUuid = null, array $associateObjectUuids = []);
167 167
 
168 168
 	/**
169 169
 	 * Get an object's value at a particular log point.
Please login to merge, or discard this patch.