Completed
Branch master (1732ea)
by smiley
03:06
created
src/Drivers/PDO/PDOODBCDriver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  * Class PDOODBCDriver
17 17
  */
18
-class PDOODBCDriver extends PDODriver implements DBDriverInterface{
18
+class PDOODBCDriver extends PDODriver implements DBDriverInterface {
19 19
 
20 20
 	/**
21 21
 	 * The PDO drivername which is being used in the DSN
Please login to merge, or discard this patch.
src/Drivers/PDO/PDOPostgresDriver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  * Class PDOPostgresDriver
17 17
  */
18
-class PDOPostgresDriver extends PDODriver implements DBDriverInterface{
18
+class PDOPostgresDriver extends PDODriver implements DBDriverInterface {
19 19
 
20 20
 	/**
21 21
 	 * The PDO drivername which is being used in the DSN
Please login to merge, or discard this patch.
src/Drivers/PDO/PDOSQLiteDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 /**
16 16
  * Class PDOSQLiteDriver
17 17
  */
18
-class PDOSQLiteDriver extends PDODriver implements DBDriverInterface{
18
+class PDOSQLiteDriver extends PDODriver implements DBDriverInterface {
19 19
 
20 20
 	/**
21 21
 	 * The PDO drivername which is being used in the DSN
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @return string DSN
32 32
 	 */
33
-	protected function getDSN(){
33
+	protected function getDSN() {
34 34
 		return $this->drivername.':'.$this->options->database;
35 35
 	}
36 36
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @return string database's serverinfo string
41 41
 	 */
42
-	public function getServerInfo(){
42
+	public function getServerInfo() {
43 43
 		return $this->drivername.' (PDO::ATTR_SERVER_INFO not available)';
44 44
 	}
45 45
 
Please login to merge, or discard this patch.
src/Drivers/PostgreSQL/PostgreSQLDriver.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * Class PostgreSQLDriver
20 20
  */
21
-class PostgreSQLDriver extends DBBaseDriver implements DBDriverInterface{
21
+class PostgreSQLDriver extends DBBaseDriver implements DBDriverInterface {
22 22
 
23 23
 	/**
24 24
 	 * Holds the database resource object
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	 * @return resource the database resource object
34 34
 	 * @throws \chillerlan\Database\DBException
35 35
 	 */
36
-	public function connect(){
36
+	public function connect() {
37 37
 
38
-		if(gettype($this->db) === 'resource'){
38
+		if (gettype($this->db) === 'resource') {
39 39
 			return $this->db;
40 40
 		}
41 41
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 			'options=\''.implode(' ', $options).'\'',
55 55
 		];
56 56
 
57
-		if(!$this->db = pg_connect(implode(' ', $conn_str))){
57
+		if (!$this->db = pg_connect(implode(' ', $conn_str))) {
58 58
 			throw new DBException('Could not connect to the database.');
59 59
 		}
60 60
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 *
67 67
 	 * @return $this
68 68
 	 */
69
-	public function disconnect(){
69
+	public function disconnect() {
70 70
 		pg_close($this->db);
71 71
 	}
72 72
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @return string php's database client string
77 77
 	 */
78
-	public function getClientInfo(){
78
+	public function getClientInfo() {
79 79
 		$ver = pg_version($this->db);
80 80
 
81 81
 		return 'PostgreSQL '.$ver['client'].' ('.$ver['client_encoding'].')';
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @return string database's serverinfo string
88 88
 	 */
89
-	public function getServerInfo(){
89
+	public function getServerInfo() {
90 90
 		$ver = pg_version($this->db);
91 91
 
92 92
 		return 'PostgreSQL '.$ver['server'].' ('.$ver['server_encoding'].', date style: '.$ver['DateStyle'].', time zone: '.$ver['TimeZone'].')';
@@ -102,25 +102,25 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @return array|string array or string. escaped. obviously.
104 104
 	 */
105
-	public function escape($data, $specialchars = false){
105
+	public function escape($data, $specialchars = false) {
106 106
 
107
-		if(is_array($data)){
107
+		if (is_array($data)) {
108 108
 
109
-			foreach($data as $key => $value){
109
+			foreach ($data as $key => $value) {
110 110
 				$data[$key] = $this->escape($value, $specialchars);
111 111
 			}
112 112
 
113 113
 		}
114
-		else if(is_object($data)){
114
+		else if (is_object($data)) {
115 115
 
116
-			foreach($data as $key => $value){
116
+			foreach ($data as $key => $value) {
117 117
 				$data->{$key} = $this->escape($value, $specialchars);
118 118
 			}
119 119
 
120 120
 		}
121
-		else{
121
+		else {
122 122
 
123
-			if($specialchars){
123
+			if ($specialchars) {
124 124
 				$data = htmlspecialchars($data, ENT_HTML5, 'UTF-8', false);
125 125
 			}
126 126
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 * @return array|bool array with results, true on void query success, otherwise false.
148 148
 	 * @throws \mysqli_sql_exception
149 149
 	 */
150
-	public function raw($sql, $index = '', $assoc = true, $fetch_array = false){
150
+	public function raw($sql, $index = '', $assoc = true, $fetch_array = false) {
151 151
 		// TODO: Implement raw() method.
152 152
 	}
153 153
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 *
166 166
 	 * @return array|bool Array with results, true on void query success, otherwise false
167 167
 	 */
168
-	public function prepared($sql, array $values = [], $index = '', $assoc = true, $fetch_array = false){
168
+	public function prepared($sql, array $values = [], $index = '', $assoc = true, $fetch_array = false) {
169 169
 		// TODO: Implement prepared() method.
170 170
 	}
171 171
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 *
180 180
 	 * @return bool true query success, otherwise false
181 181
 	 */
182
-	public function multi($sql, array $values){
182
+	public function multi($sql, array $values) {
183 183
 		// TODO: Implement multi() method.
184 184
 	}
185 185
 }
Please login to merge, or discard this patch.
src/Drivers/SQLite/SQLite3Driver.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  *
23 23
  */
24
-class SQLite3Driver extends DBBaseDriver implements DBDriverInterface{
24
+class SQLite3Driver extends DBBaseDriver implements DBDriverInterface {
25 25
 
26 26
 	/**
27 27
 	 * Holds the database resource object
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
 	 * @return \SQLite3 the database resource object
37 37
 	 * @throws \chillerlan\Database\DBException
38 38
 	 */
39
-	public function connect(){
39
+	public function connect() {
40 40
 
41
-		if($this->db instanceof SQLite3){
41
+		if ($this->db instanceof SQLite3) {
42 42
 			return $this->db;
43 43
 		}
44 44
 
45
-		try{
45
+		try {
46 46
 			$this->db = new SQLite3(
47 47
 				$this->options->database, 
48 48
 				$this->options->sqlite_flags, 
49 49
 				$this->options->sqlite_encryption_key
50 50
 			);
51 51
 		}
52
-		catch(Exception $Exception){
52
+		catch (Exception $Exception) {
53 53
 			throw new DBException($Exception->getMessage());
54 54
 		}
55 55
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 *
62 62
 	 * @return $this
63 63
 	 */
64
-	public function disconnect(){
64
+	public function disconnect() {
65 65
 		$this->db->close();
66 66
 	}
67 67
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return string php's database client string
72 72
 	 */
73
-	public function getClientInfo(){
73
+	public function getClientInfo() {
74 74
 		return 'SQLite '.SQLite3::version()['versionString'];
75 75
 	}
76 76
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 *
80 80
 	 * @return string database's serverinfo string
81 81
 	 */
82
-	public function getServerInfo(){
82
+	public function getServerInfo() {
83 83
 		return 'N/A (SQLite '.SQLite3::version()['versionString'].')';
84 84
 	}
85 85
 
@@ -93,25 +93,25 @@  discard block
 block discarded – undo
93 93
 	 *
94 94
 	 * @return array|string array or string. escaped. obviously.
95 95
 	 */
96
-	public function escape($data, $specialchars = false){
96
+	public function escape($data, $specialchars = false) {
97 97
 
98
-		if(is_array($data)){
98
+		if (is_array($data)) {
99 99
 
100
-			foreach($data as $key => $value){
100
+			foreach ($data as $key => $value) {
101 101
 				$data[$key] = $this->escape($value, $specialchars);
102 102
 			}
103 103
 
104 104
 		}
105
-		else if(is_object($data)){
105
+		else if (is_object($data)) {
106 106
 
107
-			foreach($data as $key => $value){
107
+			foreach ($data as $key => $value) {
108 108
 				$data->{$key} = $this->escape($value, $specialchars);
109 109
 			}
110 110
 
111 111
 		}
112
-		else{
112
+		else {
113 113
 
114
-			if($specialchars){
114
+			if ($specialchars) {
115 115
 				$data = htmlspecialchars($data, ENT_HTML5, 'UTF-8', false);
116 116
 			}
117 117
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * @return array|bool array with results, true on void query success, otherwise false.
139 139
 	 * @throws \mysqli_sql_exception
140 140
 	 */
141
-	public function raw($sql, $index = '', $assoc = true, $fetch_array = false){
141
+	public function raw($sql, $index = '', $assoc = true, $fetch_array = false) {
142 142
 		// TODO: Implement raw() method.
143 143
 	}
144 144
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 *
157 157
 	 * @return array|bool Array with results, true on void query success, otherwise false
158 158
 	 */
159
-	public function prepared($sql, array $values = [], $index = '', $assoc = true, $fetch_array = false){
159
+	public function prepared($sql, array $values = [], $index = '', $assoc = true, $fetch_array = false) {
160 160
 		// TODO: Implement prepared() method.
161 161
 	}
162 162
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 *
171 171
 	 * @return bool true query success, otherwise false
172 172
 	 */
173
-	public function multi($sql, array $values){
173
+	public function multi($sql, array $values) {
174 174
 		// TODO: Implement multi() method.
175 175
 	}
176 176
 }
Please login to merge, or discard this patch.
src/Querystats.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  * A result class to hold statistics for a query
17 17
  */
18
-class Querystats{
18
+class Querystats {
19 19
 
20 20
 	/**
21 21
 	 * Affected rows of the last query.
Please login to merge, or discard this patch.
src/Traits/ClassLoaderTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * A simple class loader
20 20
  */
21
-trait ClassLoaderTrait{
21
+trait ClassLoaderTrait {
22 22
 
23 23
 	/**
24 24
 	 * A simple class loader
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	 * @return object of type $interface
32 32
 	 * @throws \chillerlan\Database\DBException
33 33
 	 */
34
-	protected function __loadClass($class, $interface, ...$params){ // phpDocumentor stumbles across the ... syntax
34
+	protected function __loadClass($class, $interface, ...$params) { // phpDocumentor stumbles across the ... syntax
35 35
 
36
-		if(class_exists($class)){
36
+		if (class_exists($class)) {
37 37
 			$reflectionClass = new ReflectionClass($class);
38 38
 
39
-			if(!$reflectionClass->implementsInterface($interface)) {
39
+			if (!$reflectionClass->implementsInterface($interface)) {
40 40
 				throw new DBException($class.' does not implement '.$interface);
41 41
 			}
42 42
 
Please login to merge, or discard this patch.
src/Traits/DatabaseTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * Note: this trait also includes the ClassLoader trait
20 20
  */
21
-trait DatabaseTrait{
21
+trait DatabaseTrait {
22 22
 	use ClassLoaderTrait;
23 23
 
24 24
 	/**
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return \chillerlan\Database\Drivers\DBDriverInterface
39 39
 	 */
40
-	protected function dbconnect($driver, DBOptions $options = null){
40
+	protected function dbconnect($driver, DBOptions $options = null) {
41 41
 
42
-		if(!$options){
42
+		if (!$options) {
43 43
 			$options = new DBOptions;
44 44
 		}
45 45
 
Please login to merge, or discard this patch.