Completed
Push — master ( 220de0...482fe1 )
by smiley
04:40 queued 02:38
created
src/Drivers/MSSqlSrvPDO.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		// @todo
41 41
 		$this->pdo_options[PDO::SQLSRV_ATTR_QUERY_TIMEOUT] = $options->mssql_timeout; // doesn't seem to have an effect
42 42
 		$this->pdo_options[PDO::SQLSRV_ATTR_FETCHES_NUMERIC_TYPE] = true;
43
-		$this->pdo_options[PDO::SQLSRV_ATTR_ENCODING ] = PDO::SQLSRV_ENCODING_UTF8;
43
+		$this->pdo_options[PDO::SQLSRV_ATTR_ENCODING] = PDO::SQLSRV_ENCODING_UTF8;
44 44
 
45 45
 		parent::__construct($options, $cache);
46 46
 	}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$dsn .= ':Server='.$this->options->host;
53 53
 
54 54
 		if(is_numeric($this->options->port)){
55
-			$dsn .=  ','.$this->options->port;
55
+			$dsn .= ','.$this->options->port;
56 56
 		}
57 57
 
58 58
 		$dsn .= ';Database='.$this->options->database;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	/** @inheritdoc */
75
-	public function getServerInfo():?string{
75
+	public function getServerInfo(): ?string{
76 76
 		$info = $this->db->getAttribute(PDO::ATTR_SERVER_INFO);
77 77
 
78 78
 		if(is_array($info) && !empty($info)){
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\Database\Drivers;
14 14
 
15
+use PDO;
15 16
 use chillerlan\Database\Dialects\MSSQL;
16 17
 use chillerlan\Traits\ContainerInterface;
17
-use PDO;
18 18
 use Psr\{
19 19
 	Log\LoggerInterface, SimpleCache\CacheInterface
20 20
 };
Please login to merge, or discard this patch.
src/Drivers/DriverInterface.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 	 *
70 70
 	 * @return string serverinfo string
71 71
 	 */
72
-	public function getServerInfo():?string;
72
+	public function getServerInfo(): ?string;
73 73
 
74 74
 	/**
75 75
 	 * Sanitizer.
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -28,6 +28,7 @@
 block discarded – undo
28 28
 	 * @param \chillerlan\Traits\ContainerInterface $options
29 29
 	 * @param \Psr\SimpleCache\CacheInterface|null  $cache
30 30
 	 * @param \Psr\Log\LoggerInterface|null         $logger
31
+	 * @return void
31 32
 	 */
32 33
 	public function __construct(ContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null);
33 34
 
Please login to merge, or discard this patch.
src/Drivers/FirebirdPDO.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 	}
84 84
 
85 85
 	/** @inheritdoc */
86
-	public function getServerInfo():?string{
86
+	public function getServerInfo(): ?string{
87 87
 		return $this->db->getAttribute(PDO::ATTR_SERVER_INFO).', connected to: '.$this->options->database;
88 88
 	}
89 89
 
Please login to merge, or discard this patch.
src/Drivers/SQLitePDO.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	/** @inheritdoc */
37
-	public function getServerInfo():?string {
37
+	public function getServerInfo(): ?string {
38 38
 		return $this->drivername.', connected to: '.$this->options->database.' (PDO::ATTR_SERVER_INFO not available)';
39 39
 	}
40 40
 
Please login to merge, or discard this patch.
src/Dialects/DialectAbstract.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	/** @inheritdoc */
206 206
 	public function cols(array $expressions):array {
207 207
 
208
-		$_col = function ($expr1, $expr2 = null, $func = null):string {
208
+		$_col = function($expr1, $expr2 = null, $func = null):string {
209 209
 			switch(true){
210 210
 				case  $expr2 && $func:
211 211
 					$col = sprintf('%s(%s) AS %s', strtoupper($func), $expr1, $this->quote($expr2));
@@ -247,12 +247,12 @@  discard block
 block discarded – undo
247 247
 	/** @inheritdoc */
248 248
 	public function from(array $expressions):array {
249 249
 
250
-		$_from = function (string $table, string $ref = null):string {
250
+		$_from = function(string $table, string $ref = null):string {
251 251
 			// @todo: quotes
252 252
 			$from = $this->quote($table);
253 253
 
254 254
 			if($ref){
255
-				$from = sprintf('%s AS %s', $this->quote($ref), $this->quote($table));// @todo: index hint
255
+				$from = sprintf('%s AS %s', $this->quote($ref), $this->quote($table)); // @todo: index hint
256 256
 			}
257 257
 
258 258
 			return $from;
Please login to merge, or discard this patch.
src/Dialects/MySQL.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
 
120 120
 		// @todo: whitelist types?
121 121
 		$nolengthtypes = ['DATE', 'TINYBLOB', 'TINYTEXT', 'BLOB', 'TEXT', 'MEDIUMBLOB',
122
-		                  'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'SERIAL', 'BOOLEAN', 'UUID'];
122
+						  'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'SERIAL', 'BOOLEAN', 'UUID'];
123 123
 
124 124
 		$field[] = (is_int($length) || (is_string($length) && count(explode(',', $length)) === 2)) && !in_array($type, $nolengthtypes, true)
125 125
 			? $type.'('. $length . ')'
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
 			$sql[] = 'TEMPORARY';
73 73
 		}
74 74
 
75
-		$sql[] = 'TABLE' ;
75
+		$sql[] = 'TABLE';
76 76
 
77 77
 		if($ifNotExists){
78
-			$sql[] =  'IF NOT EXISTS' ;
78
+			$sql[] = 'IF NOT EXISTS';
79 79
 		}
80 80
 
81
-		$sql[] =  $this->quote($table);
81
+		$sql[] = $this->quote($table);
82 82
 
83 83
 		if(!empty($cols)){
84 84
 			$sql[] = '(';
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			if(!empty($primaryKey)){
88 88
 				$sql[] = ', PRIMARY KEY (';
89 89
 				$sql[] = $this->quote($primaryKey);
90
-				$sql[] =  ')';
90
+				$sql[] = ')';
91 91
 			}
92 92
 
93 93
 			$sql[] = ')';
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		                  'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'SERIAL', 'BOOLEAN', 'UUID'];
123 123
 
124 124
 		$field[] = (is_int($length) || (is_string($length) && count(explode(',', $length)) === 2)) && !in_array($type, $nolengthtypes, true)
125
-			? $type.'('. $length . ')'
125
+			? $type.'('.$length.')'
126 126
 			: $type;
127 127
 
128 128
 		if($attribute){
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 					$field[] = 'DEFAULT NULL';
165 165
 					break;
166 166
 				default:
167
-					$field[] = 'DEFAULT '.(is_int($defaultValue) || is_float($defaultValue) ? $defaultValue : '\''.$defaultValue.'\'') ;
167
+					$field[] = 'DEFAULT '.(is_int($defaultValue) || is_float($defaultValue) ? $defaultValue : '\''.$defaultValue.'\'');
168 168
 			}
169 169
 
170 170
 		}
Please login to merge, or discard this patch.
src/Dialects/MSSQL.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 
57 57
 	/** @inheritdoc */
58 58
 	public function createDatabase(string $dbname, bool $ifNotExists = null, string $collate = null):array{
59
-		$sql = [ 'CREATE DATABASE'];
59
+		$sql = ['CREATE DATABASE'];
60 60
 		$sql[] = $this->quote($dbname);
61 61
 
62 62
 		if($collate){
Please login to merge, or discard this patch.
src/Dialects/Firebird.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@
 block discarded – undo
187 187
 
188 188
 	/** @inheritdoc */
189 189
 	public function truncate(string $table):array{
190
-		$sql = ['DELETE FROM'];// RECREATE TABLE [table spec] ...stupid firebird 2.5
190
+		$sql = ['DELETE FROM']; // RECREATE TABLE [table spec] ...stupid firebird 2.5
191 191
 		$sql[] = $this->quote($table);
192 192
 
193 193
 		return $sql;
Please login to merge, or discard this patch.
src/Dialects/SQLite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 
109 109
 	/** @inheritdoc */
110 110
 	public function truncate(string $table):array{
111
-		$sql = ['DELETE FROM'];// ??? sqlite
111
+		$sql = ['DELETE FROM']; // ??? sqlite
112 112
 		$sql[] = $this->quote($table);
113 113
 
114 114
 		return $sql;
Please login to merge, or discard this patch.