@@ -42,12 +42,10 @@ |
||
42 | 42 | if ($this->driver === 'pgsql' || $this->driver === 'postgres') |
43 | 43 | { |
44 | 44 | parent::__construct($this->pgsqlConnectionString()); |
45 | - } |
|
46 | - elseif ($this->driver === 'mysql') |
|
45 | + } elseif ($this->driver === 'mysql') |
|
47 | 46 | { |
48 | 47 | parent::__construct($this->mysqlConnectionString(), $this->user, $this->password); |
49 | - } |
|
50 | - elseif($this->driver === 'sqlite') |
|
48 | + } elseif($this->driver === 'sqlite') |
|
51 | 49 | { |
52 | 50 | parent::__construct($this->sqlitConnectionString()); |
53 | 51 | } |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This class handles database connection. |
|
4 | - * |
|
5 | - * @package Ibonly\PotatoORM\DBConfig |
|
6 | - * @author Ibraheem ADENIYI <[email protected]> |
|
7 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | - */ |
|
3 | + * This class handles database connection. |
|
4 | + * |
|
5 | + * @package Ibonly\PotatoORM\DBConfig |
|
6 | + * @author Ibraheem ADENIYI <[email protected]> |
|
7 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Ibonly\PotatoORM; |
11 | 11 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This class handles building sql query statement and check |
|
4 | - * that the table exist in the database. |
|
5 | - * |
|
6 | - * @package Ibonly\PotatoORM\DatabaseQuery |
|
7 | - * @author Ibraheem ADENIYI <[email protected]> |
|
8 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
9 | - */ |
|
3 | + * This class handles building sql query statement and check |
|
4 | + * that the table exist in the database. |
|
5 | + * |
|
6 | + * @package Ibonly\PotatoORM\DatabaseQuery |
|
7 | + * @author Ibraheem ADENIYI <[email protected]> |
|
8 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | namespace Ibonly\PotatoORM; |
12 | 12 |
@@ -136,8 +136,9 @@ discard block |
||
136 | 136 | { |
137 | 137 | $counter++; |
138 | 138 | $insertQuery .= self::sanitize($key); |
139 | - if( $arraySize > $counter ) |
|
140 | - $insertQuery .= ", "; |
|
139 | + if( $arraySize > $counter ) { |
|
140 | + $insertQuery .= ", "; |
|
141 | + } |
|
141 | 142 | } |
142 | 143 | return $insertQuery; |
143 | 144 | } |
@@ -159,8 +160,9 @@ discard block |
||
159 | 160 | { |
160 | 161 | $counter++; |
161 | 162 | $insertQuery .= "'".self::sanitize($value) ."'"; |
162 | - if( $arraySize > $counter ) |
|
163 | - $insertQuery .= ", "; |
|
163 | + if( $arraySize > $counter ) { |
|
164 | + $insertQuery .= ", "; |
|
165 | + } |
|
164 | 166 | } |
165 | 167 | return $insertQuery; |
166 | 168 | } |
@@ -240,8 +242,7 @@ discard block |
||
240 | 242 | if( $arraySize > 1 && $condition == NULL) |
241 | 243 | { |
242 | 244 | $query = "Please Supply the condition"; |
243 | - } |
|
244 | - else |
|
245 | + } else |
|
245 | 246 | { |
246 | 247 | $columnName = self::whereAndClause($tableName, $data, $condition); |
247 | 248 | $query = "SELECT * FROM $tableName WHERE $columnName"; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Exception for user not found |
|
4 | - * |
|
5 | - * @package Ibonly\PotatoORM\ColumnNotExistExeption |
|
6 | - * @author Ibraheem ADENIYI <[email protected]> |
|
7 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | - */ |
|
3 | + * Exception for user not found |
|
4 | + * |
|
5 | + * @package Ibonly\PotatoORM\ColumnNotExistExeption |
|
6 | + * @author Ibraheem ADENIYI <[email protected]> |
|
7 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Ibonly\PotatoORM; |
11 | 11 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Exception for user already exist |
|
4 | - * |
|
5 | - * @package Ibonly\PotatoORM\ErrorInsertingException |
|
6 | - * @author Ibraheem ADENIYI <[email protected]> |
|
7 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | - */ |
|
3 | + * Exception for user already exist |
|
4 | + * |
|
5 | + * @package Ibonly\PotatoORM\ErrorInsertingException |
|
6 | + * @author Ibraheem ADENIYI <[email protected]> |
|
7 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Ibonly\PotatoORM; |
11 | 11 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Exception for user not found |
|
4 | - * |
|
5 | - * @package Ibonly\PotatoORM\InvalidConnectionException |
|
6 | - * @author Ibraheem ADENIYI <[email protected]> |
|
7 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | - */ |
|
3 | + * Exception for user not found |
|
4 | + * |
|
5 | + * @package Ibonly\PotatoORM\InvalidConnectionException |
|
6 | + * @author Ibraheem ADENIYI <[email protected]> |
|
7 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Ibonly\PotatoORM; |
11 | 11 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Exception for user not found |
|
4 | - * |
|
5 | - * @package Ibonly\PotatoORM\TableDoesNotExistException |
|
6 | - * @author Ibraheem ADENIYI <[email protected]> |
|
7 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | - */ |
|
3 | + * Exception for user not found |
|
4 | + * |
|
5 | + * @package Ibonly\PotatoORM\TableDoesNotExistException |
|
6 | + * @author Ibraheem ADENIYI <[email protected]> |
|
7 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Ibonly\PotatoORM; |
11 | 11 |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | trait Inflector |
40 | 40 | { |
41 | 41 | /** |
42 | - * Pluralizes English nouns. |
|
43 | - * |
|
44 | - * @access public |
|
45 | - * @static |
|
46 | - * @param string $word English noun to pluralize |
|
47 | - * @return string Plural noun |
|
48 | - */ |
|
42 | + * Pluralizes English nouns. |
|
43 | + * |
|
44 | + * @access public |
|
45 | + * @static |
|
46 | + * @param string $word English noun to pluralize |
|
47 | + * @return string Plural noun |
|
48 | + */ |
|
49 | 49 | public static function pluralize($word) |
50 | 50 | { |
51 | 51 | $plural = array( |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
105 | - * Singularizes English nouns. |
|
106 | - * |
|
107 | - * @access public |
|
108 | - * @static |
|
109 | - * @param string $word English noun to singularize |
|
110 | - * @return string Singular noun. |
|
111 | - */ |
|
105 | + * Singularizes English nouns. |
|
106 | + * |
|
107 | + * @access public |
|
108 | + * @static |
|
109 | + * @param string $word English noun to singularize |
|
110 | + * @return string Singular noun. |
|
111 | + */ |
|
112 | 112 | public function singularize($word) |
113 | 113 | { |
114 | 114 | $singular = array ( |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * PotatoORM manages the persistence of database CRUD operations. |
|
4 | - * |
|
5 | - * @package Ibonly\PotatoORM\Model |
|
6 | - * @author Ibraheem ADENIYI <[email protected]> |
|
7 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | - */ |
|
3 | + * PotatoORM manages the persistence of database CRUD operations. |
|
4 | + * |
|
5 | + * @package Ibonly\PotatoORM\Model |
|
6 | + * @author Ibraheem ADENIYI <[email protected]> |
|
7 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Ibonly\PotatoORM; |
11 | 11 |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * SugarORM\Schema manages the creation of database table. |
|
4 | - * |
|
5 | - * @package Ibonly\SugarORM\Schema |
|
6 | - * @author Ibraheem ADENIYI <[email protected]> |
|
7 | - * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | - */ |
|
3 | + * SugarORM\Schema manages the creation of database table. |
|
4 | + * |
|
5 | + * @package Ibonly\SugarORM\Schema |
|
6 | + * @author Ibraheem ADENIYI <[email protected]> |
|
7 | + * @license MIT <https://opensource.org/licenses/MIT> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Ibonly\PotatoORM; |
11 | 11 | |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | public function field($type, $fieldName, $length=NULL) |
29 | 29 | { |
30 | 30 | if(is_null($length)){ |
31 | - $this->fieldDescription[] = $type ." ".$fieldName; |
|
31 | + $this->fieldDescription[] = $type ." ".$fieldName; |
|
32 | 32 | }else |
33 | 33 | { |
34 | - $this->fieldDescription[] = $type ." ".$fieldName." ".$length; |
|
34 | + $this->fieldDescription[] = $type ." ".$fieldName." ".$length; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | if(is_null($length)){ |
31 | 31 | $this->fieldDescription[] = $type ." ".$fieldName; |
32 | - }else |
|
32 | + } else |
|
33 | 33 | { |
34 | 34 | $this->fieldDescription[] = $type ." ".$fieldName." ".$length; |
35 | 35 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | if(sizeof($e) == 2) |
53 | 53 | { |
54 | 54 | $query .= $this->$e[0]($e[1], 20) .", ".PHP_EOL; |
55 | - }else |
|
55 | + } else |
|
56 | 56 | { |
57 | 57 | $query .= $this->$e[0]($e[1], $e[2]) .", ".PHP_EOL; |
58 | 58 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | return true; |
96 | 96 | } |
97 | - }catch(PDOException $e){ |
|
97 | + } catch(PDOException $e){ |
|
98 | 98 | return $e->getMessage(); |
99 | 99 | } |
100 | 100 | } |