Completed
Push — master ( a730e3...bdeeaf )
by Nazar
04:43
created
core/functions.php 3 patches
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -28,21 +28,21 @@  discard block
 block discarded – undo
28 28
 	if (isset($cache[$class])) {
29 29
 		return require_once $cache[$class];
30 30
 	}
31
-	$prepared_class_name	= ltrim($class, '\\');
31
+	$prepared_class_name = ltrim($class, '\\');
32 32
 	if (substr($prepared_class_name, 0, 3) == 'cs\\') {
33
-		$prepared_class_name	= substr($prepared_class_name, 3);
33
+		$prepared_class_name = substr($prepared_class_name, 3);
34 34
 	}
35
-	$prepared_class_name	= explode('\\', $prepared_class_name);
36
-	$namespace				= count($prepared_class_name) > 1 ? implode('/', array_slice($prepared_class_name, 0, -1)) : '';
37
-	$class_name				= array_pop($prepared_class_name);
35
+	$prepared_class_name = explode('\\', $prepared_class_name);
36
+	$namespace = count($prepared_class_name) > 1 ? implode('/', array_slice($prepared_class_name, 0, -1)) : '';
37
+	$class_name = array_pop($prepared_class_name);
38 38
 	/**
39 39
 	 * Try to load classes from different places. If not found in one place - try in another.
40 40
 	 */
41 41
 	if (
42
-		_require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) ||		//Core classes
43
-		_require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) ||	//Third party classes
44
-		_require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) ||		//Core traits
45
-		_require_once($file = ENGINES."/$namespace/$class_name.php", false) ||				//Core engines
42
+		_require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes
43
+		_require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) || //Third party classes
44
+		_require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits
45
+		_require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines
46 46
 		_require_once($file = MODULES."/../$namespace/$class_name.php", false)				//Classes in modules and plugins
47 47
 	) {
48 48
 		$cache[$class] = realpath($file);
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
  * Enabling of page interface
121 121
  */
122 122
 function interface_on () {
123
-	Page::instance()->interface	= true;
123
+	Page::instance()->interface = true;
124 124
 }
125 125
 /**
126 126
  * Disabling of page interface
127 127
  */
128 128
 function interface_off () {
129
-	Page::instance()->interface	= false;
129
+	Page::instance()->interface = false;
130 130
 }
131 131
 /**
132 132
  * Easy getting of translations
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
  * @return false|string
154 154
  */
155 155
 function url_by_source ($source) {
156
-	$Config	= Config::instance(true);
156
+	$Config = Config::instance(true);
157 157
 	if (!$Config) {
158 158
 		return false;
159 159
 	}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
  * @return false|string
172 172
  */
173 173
 function source_by_url ($url) {
174
-	$Config	= Config::instance(true);
174
+	$Config = Config::instance(true);
175 175
 	if (!$Config) {
176 176
 		return false;
177 177
 	}
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
 	if (!is_numeric($time)) {
210 210
 		return $time;
211 211
 	}
212
-	$L		= Language::instance();
213
-	$res	= [];
212
+	$L = Language::instance();
213
+	$res = [];
214 214
 	if ($time >= 31536000) {
215 215
 		$time_x = round($time / 31536000);
216 216
 		$time -= $time_x * 31536000;
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
 		$time -= $time_x * 2592000;
222 222
 		$res[] = $L->time($time_x, 'M');
223 223
 	}
224
-	if($time >= 86400) {
224
+	if ($time >= 86400) {
225 225
 		$time_x = round($time / 86400);
226 226
 		$time -= $time_x * 86400;
227 227
 		$res[] = $L->time($time_x, 'd');
228 228
 	}
229
-	if($time >= 3600) {
229
+	if ($time >= 3600) {
230 230
 		$time_x = round($time / 3600);
231 231
 		$time -= $time_x * 3600;
232 232
 		$res[] = $L->time($time_x, 'h');
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
 	if (!is_numeric($size)) {
254 254
 		return $size;
255 255
 	}
256
-	$L		= Language::instance();
257
-	$unit	= '';
258
-	if($size >= 1099511627776) {
256
+	$L = Language::instance();
257
+	$unit = '';
258
+	if ($size >= 1099511627776) {
259 259
 		$size /= 1099511627776;
260 260
 		$unit = " $L->TB";
261
-	} elseif($size >= 1073741824) {
261
+	} elseif ($size >= 1073741824) {
262 262
 		$size /= 1073741824;
263 263
 		$unit = " $L->GB";
264 264
 	} elseif ($size >= 1048576) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		$timezones_ = $timezones = [];
288 288
 		foreach ($tzs as $tz) {
289 289
 			$offset		= (new DateTimeZone($tz))->getOffset(new DateTime);
290
-			$offset_	=	($offset < 0 ? '-' : '+').
290
+			$offset_	= ($offset < 0 ? '-' : '+').
291 291
 							str_pad(floor(abs($offset / 3600)), 2, 0, STR_PAD_LEFT).':'.
292 292
 							str_pad(abs(($offset % 3600) / 60), 2, 0, STR_PAD_LEFT);
293 293
 			$timezones_[(39600 + $offset).$tz] = [
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
  * @return false|string
320 320
  */
321 321
 function get_core_ml_text ($item) {
322
-	$Config	= Config::instance(true);
322
+	$Config = Config::instance(true);
323 323
 	if (!$Config) {
324 324
 		return false;
325 325
 	}
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
  *
350 350
  * @return null|string
351 351
  */
352
-function status_code_string ($code){
352
+function status_code_string ($code) {
353 353
 	switch ($code) {
354 354
 		case 201:
355 355
 			$string_code = '201 Created';
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 			]
461 461
 		);
462 462
 	};
463
-	$render_page_item  = function ($i) use ($page, $url, $head_links, $render_head_links) {
463
+	$render_page_item = function ($i) use ($page, $url, $head_links, $render_head_links) {
464 464
 		if ($head_links) {
465 465
 			$render_head_links($i);
466 466
 		}
@@ -553,14 +553,14 @@  discard block
 block discarded – undo
553 553
 	}
554 554
 	$output	= [];
555 555
 	if (!is_callable($url)) {
556
-		$original_url	= $url;
556
+		$original_url = $url;
557 557
 		$url			= function ($page) use ($original_url) {
558 558
 			return sprintf($original_url, $page);
559 559
 		};
560 560
 	}
561 561
 	if ($total <= 11) {
562 562
 		for ($i = 1; $i <= $total; ++$i) {
563
-			$output[]	= [
563
+			$output[] = [
564 564
 				$i,
565 565
 				[
566 566
 					'is'			=> 'cs-button',
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	} else {
575 575
 		if ($page <= 6) {
576 576
 			for ($i = 1; $i <= 7; ++$i) {
577
-				$output[]	= [
577
+				$output[] = [
578 578
 					$i,
579 579
 					[
580 580
 						'is'			=> 'cs-button',
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 					]
586 586
 				];
587 587
 			}
588
-			$output[]	= [
588
+			$output[] = [
589 589
 				'...',
590 590
 				[
591 591
 					'is'			=> 'cs-button',
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 				]
595 595
 			];
596 596
 			for ($i = $total - 2; $i <= $total; ++$i) {
597
-				$output[]	= [
597
+				$output[] = [
598 598
 					$i,
599 599
 					[
600 600
 						'is'			=> 'cs-button',
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			}
607 607
 		} elseif ($page >= $total - 5) {
608 608
 			for ($i = 1; $i <= 3; ++$i) {
609
-				$output[]	= [
609
+				$output[] = [
610 610
 					$i,
611 611
 					[
612 612
 						'is'			=> 'cs-button',
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 					]
617 617
 				];
618 618
 			}
619
-			$output[]	= [
619
+			$output[] = [
620 620
 				'...',
621 621
 				[
622 622
 					'is'			=> 'cs-button',
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 				]
626 626
 			];
627 627
 			for ($i = $total - 6; $i <= $total; ++$i) {
628
-				$output[]	= [
628
+				$output[] = [
629 629
 					$i,
630 630
 					[
631 631
 						'is'			=> 'cs-button',
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 			}
639 639
 		} else {
640 640
 			for ($i = 1; $i <= 2; ++$i) {
641
-				$output[]	= [
641
+				$output[] = [
642 642
 					$i,
643 643
 					[
644 644
 						'is'			=> 'cs-button',
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 					]
649 649
 				];
650 650
 			}
651
-			$output[]	= [
651
+			$output[] = [
652 652
 				'...',
653 653
 				[
654 654
 					'is'			=> 'cs-button',
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 				]
658 658
 			];
659 659
 			for ($i = $page - 2; $i <= $page + 2; ++$i) {
660
-				$output[]	= [
660
+				$output[] = [
661 661
 					$i,
662 662
 					[
663 663
 						'is'			=> 'cs-button',
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 					]
669 669
 				];
670 670
 			}
671
-			$output[]	= [
671
+			$output[] = [
672 672
 				'...',
673 673
 				[
674 674
 					'is'			=> 'cs-button',
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 				]
678 678
 			];
679 679
 			for ($i = $total - 1; $i <= $total; ++$i) {
680
-				$output[]	= [
680
+				$output[] = [
681 681
 					$i,
682 682
 					[
683 683
 						'is'			=> 'cs-button',
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -349,7 +349,7 @@
 block discarded – undo
349 349
  *
350 350
  * @return null|string
351 351
  */
352
-function status_code_string ($code){
352
+function status_code_string ($code) {
353 353
 	switch ($code) {
354 354
 		case 201:
355 355
 			$string_code = '201 Created';
Please login to merge, or discard this patch.
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 /**
9
- * Base system functions, do not edit this file, or make it very carefully
10
- * otherwise system workability may be broken
11
- */
9
+	 * Base system functions, do not edit this file, or make it very carefully
10
+	 * otherwise system workability may be broken
11
+	 */
12 12
 use
13 13
 	cs\Cache,
14 14
 	cs\Config,
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 	cs\Text,
19 19
 	cs\User;
20 20
 /**
21
- * Auto Loading of classes
22
- */
21
+	 * Auto Loading of classes
22
+	 */
23 23
 spl_autoload_register(function ($class) {
24 24
 	static $cache;
25 25
 	if (!isset($cache)) {
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	return false;
56 56
 }, true, true);
57 57
 /**
58
- * Clean cache of classes autoload and customization
59
- */
58
+	 * Clean cache of classes autoload and customization
59
+	 */
60 60
 function clean_classes_cache () {
61 61
 	if (file_exists(CACHE.'/classes/autoload')) {
62 62
 		unlink(CACHE.'/classes/autoload');
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 }
68 68
 /**
69
- * Get or set modified classes (used in Singleton trait)
70
- *
71
- * @param array|null $updated_modified_classes
72
- *
73
- * @return array
74
- */
69
+	 * Get or set modified classes (used in Singleton trait)
70
+	 *
71
+	 * @param array|null $updated_modified_classes
72
+	 *
73
+	 * @return array
74
+	 */
75 75
 function modified_classes ($updated_modified_classes = null) {
76 76
 	static $modified_classes;
77 77
 	if (!isset($modified_classes)) {
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 	return $modified_classes;
85 85
 }
86 86
 /**
87
- * Correct termination
88
- *
89
- * @param bool|null $enable	Allows to disable shutdown function execution since there is no good way to un-register it
90
- */
87
+	 * Correct termination
88
+	 *
89
+	 * @param bool|null $enable	Allows to disable shutdown function execution since there is no good way to un-register it
90
+	 */
91 91
 function shutdown_function ($enable = null) {
92 92
 	static $enable_internal = true;
93 93
 	if ($enable !== null) {
@@ -105,38 +105,38 @@  discard block
 block discarded – undo
105 105
 	User::instance(true)->__finish();
106 106
 }
107 107
 /**
108
- * Enable of errors processing
109
- */
108
+	 * Enable of errors processing
109
+	 */
110 110
 function errors_on () {
111 111
 	error_reporting(defined('DEBUG') && DEBUG ? E_ALL : E_ERROR | E_WARNING | E_PARSE);
112 112
 }
113 113
 /**
114
- * Disabling of errors processing
115
- */
114
+	 * Disabling of errors processing
115
+	 */
116 116
 function errors_off () {
117 117
 	error_reporting(0);
118 118
 }
119 119
 /**
120
- * Enabling of page interface
121
- */
120
+	 * Enabling of page interface
121
+	 */
122 122
 function interface_on () {
123 123
 	Page::instance()->interface	= true;
124 124
 }
125 125
 /**
126
- * Disabling of page interface
127
- */
126
+	 * Disabling of page interface
127
+	 */
128 128
 function interface_off () {
129 129
 	Page::instance()->interface	= false;
130 130
 }
131 131
 /**
132
- * Easy getting of translations
133
- *
134
- * @param string $item
135
- * @param mixed  $arguments There can be any necessary number of arguments here
136
- * @param mixed  $_
137
- *
138
- * @return string
139
- */
132
+	 * Easy getting of translations
133
+	 *
134
+	 * @param string $item
135
+	 * @param mixed  $arguments There can be any necessary number of arguments here
136
+	 * @param mixed  $_
137
+	 *
138
+	 * @return string
139
+	 */
140 140
 function __ ($item, $arguments = null, $_ = null) {
141 141
 	$L = Language::instance();
142 142
 	if (func_num_args() > 1) {
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
 	}
147 147
 }
148 148
 /**
149
- * Get file url by it's destination in file system
150
- *
151
- * @param string		$source
152
- *
153
- * @return false|string
154
- */
149
+	 * Get file url by it's destination in file system
150
+	 *
151
+	 * @param string		$source
152
+	 *
153
+	 * @return false|string
154
+	 */
155 155
 function url_by_source ($source) {
156 156
 	$Config	= Config::instance(true);
157 157
 	if (!$Config) {
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
 	return false;
165 165
 }
166 166
 /**
167
- * Get file destination in file system by it's url
168
- *
169
- * @param string		$url
170
- *
171
- * @return false|string
172
- */
167
+	 * Get file destination in file system by it's url
168
+	 *
169
+	 * @param string		$url
170
+	 *
171
+	 * @return false|string
172
+	 */
173 173
 function source_by_url ($url) {
174 174
 	$Config	= Config::instance(true);
175 175
 	if (!$Config) {
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 	return false;
182 182
 }
183 183
 /**
184
- * Public cache cleaning
185
- *
186
- * @return bool
187
- */
184
+	 * Public cache cleaning
185
+	 *
186
+	 * @return bool
187
+	 */
188 188
 function clean_pcache () {
189 189
 	$ok = true;
190 190
 	$list = get_files_list(PUBLIC_CACHE, false, 'fd', true, true, 'name|desc');
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 	return $ok;
200 200
 }
201 201
 /**
202
- * Formatting of time in seconds to human-readable form
203
- *
204
- * @param int		$time	Time in seconds
205
- *
206
- * @return string
207
- */
202
+	 * Formatting of time in seconds to human-readable form
203
+	 *
204
+	 * @param int		$time	Time in seconds
205
+	 *
206
+	 * @return string
207
+	 */
208 208
 function format_time ($time) {
209 209
 	if (!is_numeric($time)) {
210 210
 		return $time;
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	return implode(' ', $res);
243 243
 }
244 244
 /**
245
- * Formatting of data size in bytes to human-readable form
246
- *
247
- * @param int		$size
248
- * @param bool|int	$round
249
- *
250
- * @return float|string
251
- */
245
+	 * Formatting of data size in bytes to human-readable form
246
+	 *
247
+	 * @param int		$size
248
+	 * @param bool|int	$round
249
+	 *
250
+	 * @return float|string
251
+	 */
252 252
 function format_filesize ($size, $round = false) {
253 253
 	if (!is_numeric($size)) {
254 254
 		return $size;
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
 	return $round ? round($size, $round).$unit : $size.$unit;
274 274
 }
275 275
 /**
276
- * Get list of timezones
277
- *
278
- * @return array
279
- */
276
+	 * Get list of timezones
277
+	 *
278
+	 * @return array
279
+	 */
280 280
 function get_timezones_list () {
281 281
 	if (
282 282
 		!class_exists('\\cs\\Cache', false) ||
@@ -312,12 +312,12 @@  discard block
 block discarded – undo
312 312
 	return $timezones;
313 313
 }
314 314
 /**
315
- * Get multilingual value from $Config->core array
316
- *
317
- * @param string $item
318
- *
319
- * @return false|string
320
- */
315
+	 * Get multilingual value from $Config->core array
316
+	 *
317
+	 * @param string $item
318
+	 *
319
+	 * @return false|string
320
+	 */
321 321
 function get_core_ml_text ($item) {
322 322
 	$Config	= Config::instance(true);
323 323
 	if (!$Config) {
Please login to merge, or discard this patch.
core/loader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @license   MIT License, see license.txt
7 7
  */
8 8
 namespace cs;
9
-require __DIR__.'/loader_base.php';      //Inclusion of loader base
9
+require __DIR__.'/loader_base.php'; //Inclusion of loader base
10 10
 require __DIR__.'/functions_global.php'; //Inclusion of functions that work with global state
11 11
 /**
12 12
  * Wrapper around default `$_SERVER` superglobal
Please login to merge, or discard this patch.
core/loader_base.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
  * @copyright Copyright (c) 2011-2015, Nazar Mokrynskyi
6 6
  * @license   MIT License, see license.txt
7 7
  */
8
-require DIR.'/core/thirdparty/upf.php';           //Inclusion of Useful PHP Functions
8
+require DIR.'/core/thirdparty/upf.php'; //Inclusion of Useful PHP Functions
9 9
 _require_once(DIR.'/vendor/autoload.php', false); //Inclusion of composer's autoloader.php with user's dependencies
10
-require DIR.'/core/functions.php';                //Inclusion of general system functions and system autoloader
10
+require DIR.'/core/functions.php'; //Inclusion of general system functions and system autoloader
11 11
 
12 12
 error_reporting(E_ALL);
13 13
 
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\User;
9 9
 use
10 10
 	cs\Config,
Please login to merge, or discard this patch.
core/traits/CRUD.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 				)",
59 59
 			$prepared_arguments
60 60
 		);
61
-		$id      = $insert_id !== false ? $insert_id : $this->db_prime()->id();
61
+		$id = $insert_id !== false ? $insert_id : $this->db_prime()->id();
62 62
 		/**
63 63
 		 * Id might be 0 if insertion failed or if we insert duplicate entry (which is fine since we use 'INSERT IGNORE'
64 64
 		 */
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			}
156 156
 			return $id;
157 157
 		}
158
-		$columns      = array_filter(
158
+		$columns = array_filter(
159 159
 			$data_model,
160 160
 			function ($column) {
161 161
 				return !is_array($column) || !isset($column['data_model']);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 				$id
224 224
 			]
225 225
 		) ?: [];
226
-		$language_field           = isset($model['language_field']) ? $model['language_field'] : null;
226
+		$language_field = isset($model['language_field']) ? $model['language_field'] : null;
227 227
 		/**
228 228
 		 * If no rows found for current language - find another language that should contain some rows
229 229
 		 */
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 			$data_before = $this->read_internal($table, $data_model, $id);
295 295
 		}
296 296
 		list($prepared_arguments, $joined_tables) = self::crud_arguments_preparation(array_slice($data_model, 1), $prepared_arguments, $id);
297
-		$columns              = implode(
297
+		$columns = implode(
298 298
 			',',
299 299
 			array_map(
300 300
 				function ($column) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$first_column = array_keys($data_model)[0];
166 166
 		$data         = $this->db()->qf(
167 167
 			[
168
-				"SELECT $columns
168
+				"select $columns
169 169
 				FROM `$table`
170 170
 				WHERE `$first_column` = '%s'
171 171
 				LIMIT 1",
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		$fields                   = '`'.implode('`,`', array_keys($model['data_model'])).'`';
216 216
 		$rows                     = $this->db_prime()->qfa(
217 217
 			[
218
-				"SELECT $fields
218
+				"select $fields
219 219
 				FROM `{$this->table}_$table`
220 220
 				WHERE
221 221
 						`$id_field`	= '%s'
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\CRUD;
9 9
 use
10 10
 	cs\Event,
Please login to merge, or discard this patch.
core/traits/Page/Includes.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -370,7 +370,7 @@
 block discarded – undo
370 370
 	 * @return array
371 371
 	 */
372 372
 	protected function get_includes_prepare ($dependencies, $separator) {
373
-		$includes              = [
373
+		$includes = [
374 374
 			'css'  => [],
375 375
 			'js'   => [],
376 376
 			'html' => []
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2014-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\Page;
9 9
 use
10 10
 	cs\Core,
Please login to merge, or discard this patch.
core/traits/Singleton/Base.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 				'aliases'     => &$aliases,
61 61
 				'final_class' => &$next_alias
62 62
 			];
63
-			$classes                  = glob(CUSTOM.'/classes/'.substr($class, 2).'_*.php');
63
+			$classes = glob(CUSTOM.'/classes/'.substr($class, 2).'_*.php');
64 64
 			foreach ($classes as $custom_class) {
65 65
 				// Path to file with customized class
66 66
 				$custom_class = str_replace(CUSTOM.'/classes/', '', substr($custom_class, 0, -4));
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 					'alias'    => "cs\\custom\\$_custom_class",
74 74
 					'path'     => $custom_class
75 75
 				];
76
-				$next_alias      = "cs\\custom\\$custom_class";
76
+				$next_alias = "cs\\custom\\$custom_class";
77 77
 			}
78 78
 			if (!is_dir(CACHE.'/classes')) {
79 79
 				@mkdir(CACHE.'/classes', 0770, true);
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\Singleton;
9 9
 use
10 10
 	cs\False_class;
11 11
 /**
12
- * Singleton trait
13
- *
14
- * Provides Singleton pattern implementation
15
- */
12
+	 * Singleton trait
13
+	 *
14
+	 * Provides Singleton pattern implementation
15
+	 */
16 16
 trait Base {
17 17
 	final protected function __construct () {
18 18
 	}
Please login to merge, or discard this patch.
core/traits/User/Data.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -439,7 +439,7 @@
 block discarded – undo
439 439
 		if (!$user || !$item || $user == User::GUEST_ID) {
440 440
 			return false;
441 441
 		}
442
-		$item   = implode(
442
+		$item = implode(
443 443
 			',',
444 444
 			$this->db_prime()->s((array)$item)
445 445
 		);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
 			 */
120 120
 			$new_items = '`'.implode('`, `', $new_items).'`';
121 121
 			$res       = $this->db()->qf(
122
-				"SELECT $new_items
122
+				"select $new_items
123 123
 				FROM `[prefix]users`
124 124
 				WHERE `id` = '$user'
125 125
 				LIMIT 1"
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\User;
9 9
 use
10 10
 	cs\Config,
Please login to merge, or discard this patch.
core/traits/User/Management.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@
 block discarded – undo
269 269
 	 * Checks for unconfirmed registrations and deletes expired
270 270
 	 */
271 271
 	protected function delete_unconfirmed_users () {
272
-		$reg_date = time() - Config::instance()->core['registration_confirmation_time'] * 86400;    //1 day = 86400 seconds
272
+		$reg_date = time() - Config::instance()->core['registration_confirmation_time'] * 86400; //1 day = 86400 seconds
273 273
 		$ids      = $this->db_prime()->qfas(
274 274
 			[
275 275
 				"SELECT `id`
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\User;
9 9
 use
10 10
 	cs\Config,
Please login to merge, or discard this patch.
index.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
  * Time of start of execution, is used as current time
32 32
  */
33 33
 define('MICROTIME', microtime(true)); //Time in seconds (float)
34
-define('TIME', floor(MICROTIME));     //Time in seconds (integer)
35
-define('DIR', __DIR__);               //Root directory
34
+define('TIME', floor(MICROTIME)); //Time in seconds (integer)
35
+define('DIR', __DIR__); //Root directory
36 36
 chdir(DIR);
37
-require_once DIR.'/core/loader.php';  //Loader starting
37
+require_once DIR.'/core/loader.php'; //Loader starting
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -1,35 +1,35 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 /**
9
- * Requirements:
10
- * * Apache2
11
- *  Apache2 modules MUST be enabled:
12
- *  * rewrite
13
- *  * headers
14
- *  Optional Apache2 modules:
15
- *  * expires
16
- * * or Nginx
17
- * * PHP 5.5+
18
- *  PHP libraries MUST be present:
19
- *  * cURL
20
- *  Optional PHP libraries:
21
- *  * APCu, Memcached
22
- * * or HHVM 3.3.2+ LTS or HHVM 3.4.1+
23
- * * MySQL 5.6+
24
- * * or MariaDB 10.0.5+
25
- */
9
+	 * Requirements:
10
+	 * * Apache2
11
+	 *  Apache2 modules MUST be enabled:
12
+	 *  * rewrite
13
+	 *  * headers
14
+	 *  Optional Apache2 modules:
15
+	 *  * expires
16
+	 * * or Nginx
17
+	 * * PHP 5.5+
18
+	 *  PHP libraries MUST be present:
19
+	 *  * cURL
20
+	 *  Optional PHP libraries:
21
+	 *  * APCu, Memcached
22
+	 * * or HHVM 3.3.2+ LTS or HHVM 3.4.1+
23
+	 * * MySQL 5.6+
24
+	 * * or MariaDB 10.0.5+
25
+	 */
26 26
 if (version_compare(PHP_VERSION, '5.5', '<')) {
27 27
 	echo 'CleverStyle CMS require PHP 5.5 or higher';
28 28
 	return;
29 29
 }
30 30
 /**
31
- * Time of start of execution, is used as current time
32
- */
31
+	 * Time of start of execution, is used as current time
32
+	 */
33 33
 define('MICROTIME', microtime(true)); //Time in seconds (float)
34 34
 define('TIME', floor(MICROTIME));     //Time in seconds (integer)
35 35
 define('DIR', __DIR__);               //Root directory
Please login to merge, or discard this patch.