Completed
Branch 0.2.3 (4e241d)
by Anton
15:52 queued 09:37
created
www/engine/Framework/Main.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@
 block discarded – undo
2 2
 
3 3
 # Define constants
4 4
 
5
-define('DIR_FRAMEWORK',     (dirname(__FILE__) . '/'));
5
+define('DIR_FRAMEWORK', (dirname(__FILE__) . '/'));
6 6
 
7
-define('DIR_CLASSES',       (DIR_FRAMEWORK . 'Classes/'));
8
-define('DIR_DATA',          (DIR_FRAMEWORK . 'Data/'));
9
-define('DIR_INCLUDES',      (DIR_FRAMEWORK . 'Includes/'));
10
-define('DIR_TEMPLATES',     (DIR_FRAMEWORK . 'Templates/'));
7
+define('DIR_CLASSES', (DIR_FRAMEWORK . 'Classes/'));
8
+define('DIR_DATA', (DIR_FRAMEWORK . 'Data/'));
9
+define('DIR_INCLUDES', (DIR_FRAMEWORK . 'Includes/'));
10
+define('DIR_TEMPLATES', (DIR_FRAMEWORK . 'Templates/'));
11 11
 
12 12
 # Require classes
13 13
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 
24 24
 # Set defaults
25 25
 
26
-if (function_exists('mb_internal_encoding')) mb_internal_encoding('UTF-8');
26
+if (function_exists('mb_internal_encoding')) {
27
+	mb_internal_encoding('UTF-8');
28
+}
27 29
 
28 30
 date_default_timezone_set('UTC');
29 31
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/Language/Language.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,16 +10,22 @@
 block discarded – undo
10 10
 
11 11
 		private static function addPhrase(string $name, string $value) {
12 12
 
13
-			if (preg_match(REGEX_LANGUAGE_PHRASE_NAME, $name)) self::$phrases[$name] = $value;
13
+			if (preg_match(REGEX_LANGUAGE_PHRASE_NAME, $name)) {
14
+				self::$phrases[$name] = $value;
15
+			}
14 16
 		}
15 17
 
16 18
 		# Load phrases file
17 19
 
18 20
 		public static function load(string $file_name) {
19 21
 
20
-			if (!is_array($phrases = Explorer::php($file_name))) return false;
22
+			if (!is_array($phrases = Explorer::php($file_name))) {
23
+				return false;
24
+			}
21 25
 
22
-			foreach ($phrases as $name => $value) self::addPhrase($name, $value);
26
+			foreach ($phrases as $name => $value) {
27
+				self::addPhrase($name, $value);
28
+			}
23 29
 
24 30
 			# ------------------------
25 31
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/Url/Url.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,18 +10,24 @@  discard block
 block discarded – undo
10 10
 
11 11
 		public function __construct(string $url = '') {
12 12
 
13
-			if (false === ($url = parse_url($url))) return;
13
+			if (false === ($url = parse_url($url))) {
14
+				return;
15
+			}
14 16
 
15 17
 			# Parse path
16 18
 
17
-			if (isset($url['path'])) foreach (explode('/', $url['path']) as $part) {
19
+			if (isset($url['path'])) {
20
+				foreach (explode('/', $url['path']) as $part) {
18 21
 
19 22
 				if ('' !== $part) $this->path[] = urldecode($part);
20 23
 			}
24
+			}
21 25
 
22 26
 			# Parse query
23 27
 
24
-			if (isset($url['query'])) parse_str($url['query'], $this->query);
28
+			if (isset($url['query'])) {
29
+				parse_str($url['query'], $this->query);
30
+			}
25 31
 		}
26 32
 
27 33
 		# Return path
@@ -53,7 +59,9 @@  discard block
 block discarded – undo
53 59
 
54 60
 			$path = [];
55 61
 
56
-			foreach ($this->path as $value) $path[] = urlencode($value);
62
+			foreach ($this->path as $value) {
63
+				$path[] = urlencode($value);
64
+			}
57 65
 
58 66
 			$path = implode('/', $path); $query = http_build_query($this->query);
59 67
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/DB.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,19 +12,29 @@  discard block
 block discarded – undo
12 12
 
13 13
 			# Establish connection
14 14
 
15
-			if (false === ($link = @mysqli_connect($server, $user, $password))) throw new Exception\DBConnect();
15
+			if (false === ($link = @mysqli_connect($server, $user, $password))) {
16
+				throw new Exception\DBConnect();
17
+			}
16 18
 
17 19
 			# Select database
18 20
 
19
-			if (!@mysqli_select_db($link, $name)) throw new Exception\DBSelect();
21
+			if (!@mysqli_select_db($link, $name)) {
22
+				throw new Exception\DBSelect();
23
+			}
20 24
 
21 25
 			# Set encoding
22 26
 
23
-			if (!@mysqli_query($link, "SET character_set_client = 'utf8'")) throw new Exception\DBCharset();
27
+			if (!@mysqli_query($link, "SET character_set_client = 'utf8'")) {
28
+				throw new Exception\DBCharset();
29
+			}
24 30
 
25
-			if (!@mysqli_query($link, "SET character_set_results = 'utf8'")) throw new Exception\DBCharset();
31
+			if (!@mysqli_query($link, "SET character_set_results = 'utf8'")) {
32
+				throw new Exception\DBCharset();
33
+			}
26 34
 
27
-			if (!@mysqli_query($link, "SET collation_connection = 'utf8_general_ci'")) throw new Exception\DBCharset();
35
+			if (!@mysqli_query($link, "SET collation_connection = 'utf8_general_ci'")) {
36
+				throw new Exception\DBCharset();
37
+			}
28 38
 
29 39
 			# ------------------------
30 40
 
@@ -35,7 +45,9 @@  discard block
 block discarded – undo
35 45
 
36 46
 		public static function send(string $query) {
37 47
 
38
-			if (null === self::$link) return (self::$last = false);
48
+			if (null === self::$link) {
49
+				return (self::$last = false);
50
+			}
39 51
 
40 52
 			$time = microtime(true); $result = mysqli_query(self::$link, $query); $time = (microtime(true) - $time);
41 53
 
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/Query/Select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@
 block discarded – undo
22 22
 
23 23
 			# Build query
24 24
 
25
-			$this->query = ('SELECT ' . $selection . ' FROM ' . $table . ($condition ? (' WHERE (' .  $condition . ')') : '') .
25
+			$this->query = ('SELECT ' . $selection . ' FROM ' . $table . ($condition ? (' WHERE (' . $condition . ')') : '') .
26 26
 
27
-				($order ? (' ORDER BY ' .  $order) : '') . ($limit ? (' LIMIT ' .  $limit) : ''));
27
+				($order ? (' ORDER BY ' . $order) : '') . ($limit ? (' LIMIT ' . $limit) : ''));
28 28
 		}
29 29
 	}
30 30
 }
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/Query/Insert.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,9 +20,11 @@
 block discarded – undo
20 20
 
21 21
 			$names = ''; $values = [];
22 22
 
23
-			foreach ($dataset as $key => $row) if (is_array($row)) {
23
+			foreach ($dataset as $key => $row) {
24
+				if (is_array($row)) {
24 25
 
25 26
 				if (0 === $key) $names = $this->getString(array_keys($row), '$name', ', ');
27
+			}
26 28
 
27 29
 				$values[] = ('(' . $this->getString(array_values($row), '$value', ', ') . ')');
28 30
 			}
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/Query/Update.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
 			# Build query
22 22
 
23
-			$this->query = ('UPDATE ' . $table . ' SET ' . $dataset . ($condition ? (' WHERE (' .  $condition . ')') : ''));
23
+			$this->query = ('UPDATE ' . $table . ' SET ' . $dataset . ($condition ? (' WHERE (' . $condition . ')') : ''));
24 24
 		}
25 25
 	}
26 26
 }
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/Query/Delete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
 			# Build query
20 20
 
21
-			$this->query = ('DELETE FROM ' . $table . ($condition ? (' WHERE (' .  $condition . ')') : ''));
21
+			$this->query = ('DELETE FROM ' . $table . ($condition ? (' WHERE (' . $condition . ')') : ''));
22 22
 		}
23 23
 	}
24 24
 }
Please login to merge, or discard this patch.
www/engine/Framework/Classes/DB/Utils/Result.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@  discard block
 block discarded – undo
40 40
 
41 41
 		public function row() {
42 42
 
43
-			if (!is_object($this->result)) return null;
43
+			if (!is_object($this->result)) {
44
+				return null;
45
+			}
44 46
 
45 47
 			return mysqli_fetch_assoc($this->result);
46 48
 		}
@@ -49,9 +51,13 @@  discard block
 block discarded – undo
49 51
 
50 52
 		public function rows() {
51 53
 
52
-			if (!is_object($this->result)) return [];
54
+			if (!is_object($this->result)) {
55
+				return [];
56
+			}
53 57
 
54
-			$rows = []; while (null !== ($row = $this->row())) $rows[] = $row;
58
+			$rows = []; while (null !== ($row = $this->row())) {
59
+				$rows[] = $row;
60
+			}
55 61
 
56 62
 			# ------------------------
57 63
 
Please login to merge, or discard this patch.