@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | */ |
18 | 18 | trait PropertiesTrait |
19 | 19 | { |
20 | - public function toArray($except=[]) |
|
20 | + public function toArray($except = []) |
|
21 | 21 | { |
22 | - $array= []; |
|
22 | + $array = []; |
|
23 | 23 | $properties = $this->getProperties(); |
24 | - foreach($properties as $key => $value) { |
|
24 | + foreach ($properties as $key => $value) { |
|
25 | 25 | if (in_array($value, $except)) { continue; } |
26 | 26 | list($prop, $value) = $this->resolveProperty($key, $value); |
27 | 27 | $array[$prop] = $this->valueToArray($value); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function valueToArray($value) |
48 | 48 | { |
49 | 49 | if (is_array($value)) { |
50 | - foreach($value as $key => $val) { |
|
50 | + foreach ($value as $key => $val) { |
|
51 | 51 | $value[$key] = $this->valueToArray($val); |
52 | 52 | } |
53 | 53 | } else if (is_object($value) && $value instanceof IArrayable) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require NEON_VENDOR . '/yiisoft/yii2/BaseYii.php'; |
|
3 | +require NEON_VENDOR.'/yiisoft/yii2/BaseYii.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * The Neon class extends YiiBase and is a convenience class for setting up a Yii application |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public static function getVersion() |
20 | 20 | { |
21 | - return trim(file_get_contents(__DIR__ . '/../../version')); |
|
21 | + return trim(file_get_contents(__DIR__.'/../../version')); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public static function powered() |
105 | 105 | { |
106 | - return 'Powered by <a href="' . self::neonLink() . '" rel="external" target="_blank">Neon</a>'; |
|
106 | + return 'Powered by <a href="'.self::neonLink().'" rel="external" target="_blank">Neon</a>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $stop = microtime(true); |
152 | 152 | $bootstrapTime = $stop - $start; |
153 | 153 | if ($bootstrapTime > $maxTime) { |
154 | - $error = $error ? $error : 'The profile "' . $token . '" took longer than ' . $maxTime . ' seconds'; |
|
154 | + $error = $error ? $error : 'The profile "'.$token.'" took longer than '.$maxTime.' seconds'; |
|
155 | 155 | \Neon::error($error, $category); |
156 | 156 | } |
157 | 157 | self::endProfile($token, $category); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | - public static function endProfile($token=null, $category = 'application') |
|
171 | + public static function endProfile($token = null, $category = 'application') |
|
172 | 172 | { |
173 | 173 | if (neon()->debug) { |
174 | 174 | if ($token === null) |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param int $length - the number of rows to return |
36 | 36 | * @return array an array of key value pairs |
37 | 37 | */ |
38 | - public function getDataMap($key, $query='', $filters=[], $fields=[], $start = 0, $length = 100); |
|
38 | + public function getDataMap($key, $query = '', $filters = [], $fields = [], $start = 0, $length = 100); |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Looks up maps from the map ids. |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * If not set then return the default map field for the class. |
51 | 51 | * @return string |
52 | 52 | */ |
53 | - public function makeMapLookupRequest($key, $ids, $fields=[]); |
|
53 | + public function makeMapLookupRequest($key, $ids, $fields = []); |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Return results from a previously called makeMapLookupRequest request |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | // Register the core apps |
166 | 166 | $this->registerApps($this->getCoreApps()); |
167 | 167 | // Check neon is installed |
168 | - if (! $this->isInstalled() || InstallHelper::isInstallRoute()) { |
|
168 | + if (!$this->isInstalled() || InstallHelper::isInstallRoute()) { |
|
169 | 169 | // We can not bootstrap the apps as they can not rely on a database connection |
170 | 170 | // so conclude the bootstrap process |
171 | 171 | return; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getDocsPath() |
186 | 186 | { |
187 | - return __DIR__ . '/docs'; |
|
187 | + return __DIR__.'/docs'; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -28,7 +28,7 @@ |
||
28 | 28 | public function getClientOptions($model, $attribute) |
29 | 29 | { |
30 | 30 | $options = parent::getClientOptions($model, $attribute); |
31 | - $options['integerOnly']=$this->integerOnly; |
|
31 | + $options['integerOnly'] = $this->integerOnly; |
|
32 | 32 | return $options; |
33 | 33 | } |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -29,7 +29,7 @@ |
||
29 | 29 | 'message' => $this->formatMessage($this->message, [ |
30 | 30 | 'attribute' => $model->getAttributeLabel($attribute), |
31 | 31 | ]), |
32 | - 'enableIDN' => (bool)$this->enableIDN, |
|
32 | + 'enableIDN' => (bool) $this->enableIDN, |
|
33 | 33 | ]; |
34 | 34 | if ($this->skipOnEmpty) { |
35 | 35 | $options['skipOnEmpty'] = 1; |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | 'captcha' => ['class'=>'yii\captcha\CaptchaValidator'], |
20 | 20 | 'compare' => ['class'=>'yii\validators\CompareValidator'], |
21 | 21 | 'date' => ['class'=>'neon\core\validators\DateValidator'], |
22 | - 'datetime' => ['class' => 'neon\core\validators\DateValidator', 'type' => DateValidator::TYPE_DATETIME,], |
|
23 | - 'time' => ['class' => 'yii\validators\DateValidator', 'type' => DateValidator::TYPE_TIME,], |
|
22 | + 'datetime' => ['class' => 'neon\core\validators\DateValidator', 'type' => DateValidator::TYPE_DATETIME, ], |
|
23 | + 'time' => ['class' => 'yii\validators\DateValidator', 'type' => DateValidator::TYPE_TIME, ], |
|
24 | 24 | 'default' => ['class'=>'yii\validators\DefaultValueValidator'], |
25 | 25 | 'double' => ['class'=>'neon\core\validators\NumberValidator'], |
26 | 26 | 'each' => ['class'=>'yii\validators\EachValidator'], |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | 'filter' => ['class'=>'yii\validators\FilterValidator'], |
31 | 31 | 'image' => ['class'=>'yii\validators\ImageValidator'], |
32 | 32 | 'in' => ['class'=>'yii\validators\RangeValidator'], |
33 | - 'integer' => ['class' => 'neon\core\validators\NumberValidator', 'integerOnly' => true,], |
|
33 | + 'integer' => ['class' => 'neon\core\validators\NumberValidator', 'integerOnly' => true, ], |
|
34 | 34 | 'match' => ['class'=>'neon\core\validators\RegularExpressionValidator'], |
35 | 35 | 'number' => ['class'=>'neon\core\validators\NumberValidator'], |
36 | 36 | 'required' => ['class'=>'neon\core\validators\RequiredValidator'], |
37 | 37 | 'safe' => ['class'=>'yii\validators\SafeValidator'], |
38 | 38 | 'string' => ['class'=>'neon\core\validators\StringValidator'], |
39 | - 'trim' => ['class' => 'yii\validators\FilterValidator', 'filter' => 'trim', 'skipOnArray' => true,], |
|
39 | + 'trim' => ['class' => 'yii\validators\FilterValidator', 'filter' => 'trim', 'skipOnArray' => true, ], |
|
40 | 40 | 'unique' => ['class'=>'yii\validators\UniqueValidator'], |
41 | 41 | 'url' => ['class'=>'neon\core\validators\UrlValidator'], |
42 | 42 | 'ip' => ['class'=>'yii\validators\IpValidator'], |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | if ($type instanceof \Closure || ($model->hasMethod($type) && !isset(static::$builtInValidators[$type]))) { |
65 | 65 | // method-based validator |
66 | - $params['class'] = __NAMESPACE__ . '\InlineValidator'; |
|
66 | + $params['class'] = __NAMESPACE__.'\InlineValidator'; |
|
67 | 67 | $params['method'] = $type; |
68 | 68 | } else { |
69 | 69 | if (isset(static::$builtInValidators[$type])) { |
@@ -17,9 +17,9 @@ |
||
17 | 17 | * @param string $label |
18 | 18 | * @return MockModel|null |
19 | 19 | */ |
20 | - public static function get($label='') |
|
20 | + public static function get($label = '') |
|
21 | 21 | { |
22 | - if (self::$mock===null) |
|
22 | + if (self::$mock === null) |
|
23 | 23 | self::$mock = new self(); |
24 | 24 | self::$mock->label = $label; |
25 | 25 | return self::$mock; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | /** |
233 | 233 | * Add the edit and delete DDS object buttons to the grid |
234 | 234 | */ |
235 | - public function addActionButtonColumn($title=false) |
|
235 | + public function addActionButtonColumn($title = false) |
|
236 | 236 | { |
237 | 237 | $buttonCol = $this->addButtonColumn('edit')->setTitle($title); |
238 | 238 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | if ($this->hasScope('deleted') && $this->isScopeActive('deleted')) { |
248 | 248 | if ($this->showGridUndeleteButton) { |
249 | - $buttonCol->addButton('undelete', '','', 'fa fa-undo', 'btn-default', [ |
|
249 | + $buttonCol->addButton('undelete', '', '', 'fa fa-undo', 'btn-default', [ |
|
250 | 250 | 'data-toggle' => 'tooltip', |
251 | 251 | 'title' => 'Restore', |
252 | 252 | 'data-action' => 'actionUndelete' |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | * Load appropriate columns based on DDS details |
378 | 378 | * @deprecated - just set the classType - either in the init or the config |
379 | 379 | */ |
380 | - public function ddsLoadGrid($classType, $includeDeleted=false, $pageSize=50) |
|
380 | + public function ddsLoadGrid($classType, $includeDeleted = false, $pageSize = 50) |
|
381 | 381 | { |
382 | 382 | if ($this->title == null) |
383 | 383 | $this->title = $classType; |