Completed
Push — master ( fd9190...6d3836 )
by Ron
02:26
created
src/Builder/Traits/OffsetBuilder.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
 	 * @return string
22 22
 	 */
23 23
 	protected function buildOffset($query) {
24
-		if($this->offset !== null) {
24
+		if ($this->offset !== null) {
25 25
 			$query .= "OFFSET\n\t{$this->offset}\n";
26 26
 		}
27 27
 		return $query;
Please login to merge, or discard this patch.
src/Builder/Traits/UnionBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,21 +30,21 @@
 block discarded – undo
30 30
 	 * @return string
31 31
 	 */
32 32
 	protected function buildUnions($query) {
33
-		$wrap = function ($query) {
33
+		$wrap = function($query) {
34 34
 			$query = trim($query);
35 35
 			$query = join("\n\t", explode("\n", $query));
36 36
 			return sprintf("(\n\t%s\n)", $query);
37 37
 		};
38 38
 		$queries = [$wrap($query)];
39
-		foreach($this->unions as $unionQuery) {
40
-			if($unionQuery[0] === 'ALL') {
39
+		foreach ($this->unions as $unionQuery) {
40
+			if ($unionQuery[0] === 'ALL') {
41 41
 				$queries[] = 'UNION ALL';
42 42
 			} else {
43 43
 				$queries[] = 'UNION';
44 44
 			}
45 45
 			$queries[] = $wrap($unionQuery[1]);
46 46
 		}
47
-		if(count($queries) > 1) {
47
+		if (count($queries) > 1) {
48 48
 			return join(" ", $queries);
49 49
 		}
50 50
 		return $query;
Please login to merge, or discard this patch.
src/Builder/Delete.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return $this
30 30
 	 */
31 31
 	public function from($alias, $table = null) {
32
-		if($table !== null) {
32
+		if ($table !== null) {
33 33
 			$this->aliases[] = $alias;
34 34
 		}
35 35
 		$this->addTable($alias, $table);
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	public function __toString() {
44 44
 		$query = "DELETE ";
45 45
 		$query .= join(', ', $this->aliases);
46
-		$query = trim($query) . " FROM\n";
46
+		$query = trim($query)." FROM\n";
47 47
 		$query = $this->buildTables($query);
48 48
 		$query = $this->buildJoins($query);
49 49
 		$query = $this->buildWhereConditions($query);
Please login to merge, or discard this patch.
src/Builder/Helpers/FieldValueConverter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 	 * @return array
9 9
 	 */
10 10
 	public static function convertValues(array $row, array $columnDefinitions) {
11
-		foreach($row as $key => &$value) {
12
-			if($value !== null) {
11
+		foreach ($row as $key => &$value) {
12
+			if ($value !== null) {
13 13
 				$value = self::convertValue($value, $columnDefinitions[$key]);
14 14
 			}
15 15
 		}
Please login to merge, or discard this patch.
src/Builder/Internal/ConditionBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
 	 * @return string
13 13
 	 */
14 14
 	public static function build(Database $db, $query, array $conditions, $token) {
15
-		if(!count($conditions)) {
15
+		if (!count($conditions)) {
16 16
 			return $query;
17 17
 		}
18 18
 		$query .= "{$token}\n";
19 19
 		$arr = [];
20
-		foreach($conditions as $condition) {
20
+		foreach ($conditions as $condition) {
21 21
 			list($expression, $arguments) = $condition;
22
-			if(is_array($expression)) {
23
-				foreach($expression as $key => $value) {
22
+			if (is_array($expression)) {
23
+				foreach ($expression as $key => $value) {
24 24
 					$arr = self::buildCondition($arr, "`{$key}`=?", [$value], $db);
25 25
 				}
26 26
 			} else {
Please login to merge, or discard this patch.
src/Builder/Expr/RequiredDBFilterMap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 	 * @return DBExprFilter
28 28
 	 */
29 29
 	public function __invoke($expression, $keyPath, $validator = null) {
30
-		return new DBExprFilter($expression, $this->map, $keyPath, $validator, function ($result, array $data) {
31
-			if(!$result) {
30
+		return new DBExprFilter($expression, $this->map, $keyPath, $validator, function($result, array $data) {
31
+			if (!$result) {
32 32
 				throw new RequiredValueNotFoundException(sprintf("Required value %s not found", $data['key']));
33 33
 			}
34 34
 		});
Please login to merge, or discard this patch.
src/Builder/Select.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 	}
79 79
 
80 80
 	/**
81
-	 * @return array
81
+	 * @return string[]
82 82
 	 */
83 83
 	public function getFields() {
84 84
 		return $this->fields;
Please login to merge, or discard this patch.
src/Builder/Traits/LimitBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
 	 */
29 29
 	protected function buildLimit($query, $offset = null) {
30 30
 		$limit = $this->limit;
31
-		if($limit === null && $offset !== null) {
31
+		if ($limit === null && $offset !== null) {
32 32
 			$limit = '18446744073709551615';
33 33
 		}
34
-		if($limit !== null) {
34
+		if ($limit !== null) {
35 35
 			$query .= "LIMIT\n\t{$limit}\n";
36 36
 		}
37 37
 		return $query;
Please login to merge, or discard this patch.
src/Builder/QueryStatement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 	 * @return $this
47 47
 	 */
48 48
 	public function setFetchMode($mode, $arg0 = null, array $arg1 = null) {
49
-		if($arg1 !== null) {
49
+		if ($arg1 !== null) {
50 50
 			/** @noinspection PhpMethodParametersCountMismatchInspection */
51 51
 			$this->statement->setFetchMode($mode, $arg0, $arg1);
52 52
 			return $this;
53 53
 		}
54
-		if($arg0 !== null) {
54
+		if ($arg0 !== null) {
55 55
 			/** @noinspection PhpMethodParametersCountMismatchInspection */
56 56
 			$this->statement->setFetchMode($mode, $arg0);
57 57
 			return $this;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 			$timer = microtime(true);
71 71
 			$response = $this->statement->execute($params);
72 72
 			$this->queryLoggers->log($this->query, microtime(true)-$timer);
73
-			if(!$response) {
73
+			if (!$response) {
74 74
 				throw new SqlException('Execution returned with "false".');
75 75
 			}
76 76
 		});
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public function fetchAll($fetchStyle = null, $fetchArgument = null, array $ctorArgs = []) {
87 87
 		return $this->exceptionHandler(function() use ($fetchStyle, $fetchArgument, $ctorArgs) {
88
-			if($fetchArgument !== null) {
88
+			if ($fetchArgument !== null) {
89 89
 				return $this->statement->fetchAll($fetchStyle, $fetchArgument, $ctorArgs);
90 90
 			}
91 91
 			return $this->statement->fetchAll($fetchStyle);
Please login to merge, or discard this patch.