Completed
Push — master ( bb05b7...be40dc )
by Nazar
07:42
created
modules/Photo_gallery/Photo_gallery.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		$module_data	= Config::instance()->module('Photo_gallery');
39 39
 		if (!$module_data->directory_created) {
40 40
 			$this->storage()->mkdir('Photo_gallery');
41
-			$module_data->directory_created	= 1;
41
+			$module_data->directory_created = 1;
42 42
 		}
43 43
 	}
44 44
 	/**
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 		if (is_array($id)) {
71 71
 			return array_map([$this, 'get'], $id);
72 72
 		}
73
-		$L			= Language::instance();
74
-		$id			= (int)$id;
73
+		$L = Language::instance();
74
+		$id = (int)$id;
75 75
 		return $this->cache->get("images/$id/$L->clang", function () use ($id) {
76 76
 			$data = $this->db()->qf(
77 77
 				"SELECT
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 				$id
90 90
 			);
91 91
 			if ($data) {
92
-				$data['title']			= $this->ml_process($data['title']);
93
-				$data['description']	= $this->ml_process($data['description']);
92
+				$data['title'] = $this->ml_process($data['title']);
93
+				$data['description'] = $this->ml_process($data['description']);
94 94
 			}
95 95
 			return $data;
96 96
 		});
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		if (!filter_var($original, FILTER_VALIDATE_URL)) {
113 113
 			return false;
114 114
 		}
115
-		$gallery		= (int)$gallery;
115
+		$gallery = (int)$gallery;
116 116
 		if ($this->db_prime()->q(
117 117
 			"INSERT INTO `[prefix]photo_gallery_images`
118 118
 				(
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 			time(),
134 134
 			$original
135 135
 		)) {
136
-			$id	= $this->db_prime()->id();
136
+			$id = $this->db_prime()->id();
137 137
 			if ($this->set($id, $title, $description)) {
138 138
 				Event::instance()->fire(
139 139
 					'System/upload_files/add_tag',
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
 						'url'	=> $original
143 143
 					]
144 144
 				);
145
-				$hash		= md5(random_bytes(1000));
146
-				$tmp_file	= TEMP.'/'.User::instance()->id."_$hash";
145
+				$hash = md5(random_bytes(1000));
146
+				$tmp_file = TEMP.'/'.User::instance()->id."_$hash";
147 147
 				try {
148
-					$SimpleImage	= new SimpleImage($original);
148
+					$SimpleImage = new SimpleImage($original);
149 149
 					$SimpleImage->thumbnail(256)->save($tmp_file = "$tmp_file.".$SimpleImage->get_original_info()['format']);
150 150
 					unset($SimpleImage);
151 151
 				} catch (Exception $e) {
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 					trigger_error($e->getMessage(), E_USER_WARNING);
154 154
 					return false;
155 155
 				}
156
-				$storage	= $this->storage();
156
+				$storage = $this->storage();
157 157
 				if (!$storage->file_exists("Photo_gallery/$gallery")) {
158 158
 					$storage->mkdir("Photo_gallery/$gallery");
159 159
 				}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 	 * @return bool
195 195
 	 */
196 196
 	public function set ($id, $title, $description) {
197
-		$User			= User::instance();
198
-		$id				= (int)$id;
199
-		$title			= xap(trim($title));
200
-		$description	= xap(trim($description));
197
+		$User = User::instance();
198
+		$id = (int)$id;
199
+		$title = xap(trim($title));
200
+		$description = xap(trim($description));
201 201
 		if ($this->db_prime()->q(
202 202
 			"UPDATE `[prefix]photo_gallery_images`
203 203
 			SET
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
 	 * @return bool
229 229
 	 */
230 230
 	public function del ($id) {
231
-		$id		= (int)$id;
232
-		$data	= $this->get($id);
231
+		$id = (int)$id;
232
+		$data = $this->get($id);
233 233
 		if ($this->db_prime()->q(
234 234
 			"DELETE FROM `[prefix]photo_gallery_images`
235 235
 			WHERE `id` = $id"
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 			if ($data['preview']) {
246 246
 				$this->storage()->unlink($this->storage()->source_by_url($data['preview']));
247 247
 			}
248
-			$Cache	= $this->cache;
248
+			$Cache = $this->cache;
249 249
 			unset(
250 250
 				$Cache->{"images/$id"},
251 251
 				$Cache->{"galleries/$data[gallery]"}
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 		if (is_array($id)) {
294 294
 			return array_map([$this, 'get_gallery'], $id);
295 295
 		}
296
-		$L		= Language::instance();
297
-		$id		= (int)$id;
296
+		$L = Language::instance();
297
+		$id = (int)$id;
298 298
 		return $this->cache->get("galleries/$id/$L->clang", function () use ($id) {
299 299
 			if ($data = $this->db()->qf(
300 300
 				"SELECT
@@ -314,17 +314,17 @@  discard block
 block discarded – undo
314 314
 				LIMIT 1",
315 315
 				$id
316 316
 			)) {
317
-				$data['title']			= $this->ml_process($data['title']);
318
-				$data['path']			= $this->ml_process($data['path']);
319
-				$data['description']	= $this->ml_process($data['description']);
320
-				$order					= $data['preview_image'] == 'first' ? 'ASC' : 'DESC';
321
-				$data['preview']		= $this->db()->qfs(
317
+				$data['title'] = $this->ml_process($data['title']);
318
+				$data['path'] = $this->ml_process($data['path']);
319
+				$data['description'] = $this->ml_process($data['description']);
320
+				$order = $data['preview_image'] == 'first' ? 'ASC' : 'DESC';
321
+				$data['preview'] = $this->db()->qfs(
322 322
 					"SELECT `preview`
323 323
 					FROM `[prefix]photo_gallery_images`
324 324
 					WHERE `gallery` = $data[id]
325 325
 					ORDER BY `id` $order"
326 326
 				) ?: '';
327
-				$data['images']			= $this->db()->qfas(
327
+				$data['images'] = $this->db()->qfas(
328 328
 					"SELECT `id`
329 329
 					FROM `[prefix]photo_gallery_images`
330 330
 					WHERE `gallery` = $data[id]
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 				('%s')",
354 354
 			(int)(bool)$active
355 355
 		)) {
356
-			$id		= $this->db_prime()->id();
356
+			$id = $this->db_prime()->id();
357 357
 			$this->set_gallery($id, $title, $path, $description, $active, $preview_image);
358 358
 			return $id;
359 359
 		}
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
 	 * @return bool
373 373
 	 */
374 374
 	public function set_gallery ($id, $title, $path, $description, $active, $preview_image) {
375
-		$path			= path($path ?: $title);
376
-		$title			= xap(trim($title));
377
-		$description	= xap(trim($description));
378
-		$id				= (int)$id;
375
+		$path = path($path ?: $title);
376
+		$title = xap(trim($title));
377
+		$description = xap(trim($description));
378
+		$id = (int)$id;
379 379
 		if ($this->db_prime()->q(
380 380
 			"UPDATE `[prefix]photo_gallery_galleries`
381 381
 			SET
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 			$preview_image,
393 393
 			$id
394 394
 		)) {
395
-			$Cache	= $this->cache;
395
+			$Cache = $this->cache;
396 396
 			unset(
397 397
 				$Cache->{"galleries/$id"},
398 398
 				$Cache->{'galleries/list'}
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 * @return bool
411 411
 	 */
412 412
 	public function del_gallery ($id) {
413
-		$id		= (int)$id;
413
+		$id = (int)$id;
414 414
 		if (!$this->db_prime()->q(
415 415
 			"DELETE FROM `[prefix]photo_gallery_galleries`
416 416
 			WHERE `id` = '%s'",
@@ -421,12 +421,12 @@  discard block
 block discarded – undo
421 421
 		$this->ml_del('Photo_gallery/galleries/title', $id);
422 422
 		$this->ml_del('Photo_gallery/galleries/path', $id);
423 423
 		$this->ml_del('Photo_gallery/galleries/description', $id);
424
-		$Cache	= $this->cache;
424
+		$Cache = $this->cache;
425 425
 		unset(
426 426
 			$Cache->{"galleries/$id"},
427 427
 			$Cache->{'galleries/list'}
428 428
 		);
429
-		$images	= $this->db()->qfas(
429
+		$images = $this->db()->qfas(
430 430
 			"SELECT `id`
431 431
 			FROM `[prefix]photo_gallery_images`
432 432
 			WHERE `gallery` = '%s'",
Please login to merge, or discard this patch.
modules/System/events.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@
 block discarded – undo
65 65
 			$Page             = Page::instance();
66 66
 			$core_url         = $Config->core_url();
67 67
 			$base_url         = $Config->base_url();
68
-			$Page->Head       .= h::link(
68
+			$Page->Head .= h::link(
69 69
 				[
70 70
 					'hreflang' => 'x-default',
71 71
 					'href'     => $Request->home_page ? $core_url : "$core_url/$relative_address",
72 72
 					'rel'      => 'alternate'
73 73
 				]
74 74
 			);
75
-			$clangs           = Cache::instance()->get(
75
+			$clangs = Cache::instance()->get(
76 76
 				'languages/clangs',
77 77
 				function () use ($Config) {
78 78
 					$clangs = [];
Please login to merge, or discard this patch.
build/Builder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@
 block discarded – undo
194 194
 			"$this->root/index.php",
195 195
 			"$this->root/package.json"
196 196
 		];
197
-		$files            = [];
197
+		$files = [];
198 198
 		foreach ($files_to_include as $s) {
199 199
 			if (is_file($s)) {
200 200
 				$files[] = $s;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	Phar::webPhar(null, 'web.php');
158 158
 }
159 159
 __HALT_COMPILER();
160
-STUB
160
+stub
161 161
 		);
162 162
 		$phar->stopBuffering();
163 163
 		return "Done! CleverStyle Framework $version";
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 </FilesMatch>
283 283
 
284 284
 RewriteRule .* index.php
285
-HTACCESS;
285
+htaccess;
286 286
 	}
287 287
 	/**
288 288
 	 * @param string      $module
Please login to merge, or discard this patch.
build/cli.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
   php build.php -M core -m Plupload,Static_pages
55 55
   php build.php -M core -p TinyMCE -t DarkEnergy -s custom
56 56
   php build.php -M module -m Plupload,Static_pages
57
-HELP;
57
+help;
58 58
 } elseif ($mode == 'core') {
59 59
 	echo $Builder->core($modules, $themes, $suffix)."\n";
60 60
 } else {
Please login to merge, or discard this patch.
modules/Composer/cli/Controller.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
   Clean Composer's files:
28 28
     <g>./cli clean:Composer</g>
29 29
 
30
-HELP;
30
+help;
31 31
 	}
32 32
 	/**
33 33
 	 * @param \cs\Request  $Request
Please login to merge, or discard this patch.
modules/Composer_assets/Assets_processing.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 <FilesMatch "\.css$">
40 40
 	Header set Content-Type text/css
41 41
 </FilesMatch>
42
-HTACCESS
42
+htaccess
43 43
 		);
44 44
 		return self::save_content(
45 45
 			self::get_content($Config, $files, $package_dir, $target_dir),
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 	 * @return string[]
73 73
 	 */
74 74
 	protected static function extract_files ($meta, $package_name) {
75
-		$meta     += ['require_bower' => [], 'require_npm' => []];
75
+		$meta += ['require_bower' => [], 'require_npm' => []];
76 76
 		$packages = $meta['require_bower'] + $meta['require_npm'];
77 77
 		return isset($packages[$package_name]['files']) ? $packages[$package_name]['files'] : [];
78 78
 	}
Please login to merge, or discard this patch.
modules/Deferred_tasks/Deferred_tasks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 		'module'       => 'text',
32 32
 		'data'         => 'json'
33 33
 	];
34
-	protected $table      = '[prefix]deferred_tasks_tasks';
34
+	protected $table = '[prefix]deferred_tasks_tasks';
35 35
 	/**
36 36
 	 * @var int
37 37
 	 */
Please login to merge, or discard this patch.
modules/Static_pages/Pages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	use
22 22
 		CRUD_helpers,
23 23
 		Singleton;
24
-	protected $data_model                  = [
24
+	protected $data_model = [
25 25
 		'id'        => 'int',
26 26
 		'category'  => 'int',
27 27
 		'title'     => 'ml:text',
Please login to merge, or discard this patch.
modules/Static_pages/Categories.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	use
22 22
 		CRUD_helpers,
23 23
 		Singleton;
24
-	protected $data_model          = [
24
+	protected $data_model = [
25 25
 		'id'     => 'int',
26 26
 		'title'  => 'ml:text',
27 27
 		'path'   => 'ml:text',
Please login to merge, or discard this patch.