@@ -2,12 +2,12 @@ |
||
2 | 2 | |
3 | 3 | namespace Opeyemiabiodun\PotatoORM\Models; |
4 | 4 | |
5 | -use RuntimeException; |
|
6 | 5 | use InvalidArgumentException; |
7 | 6 | use Opeyemiabiodun\PotatoORM\Connections\Connection; |
8 | 7 | use Opeyemiabiodun\PotatoORM\Connections\PgSqlConnection; |
9 | 8 | use Opeyemiabiodun\PotatoORM\Exceptions\AssignmentException; |
10 | 9 | use Opeyemiabiodun\PotatoORM\Exceptions\PropertyNotFoundException; |
10 | +use RuntimeException; |
|
11 | 11 | |
12 | 12 | trait Model |
13 | 13 | { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @param int $number Specifies which model instance to find; the 1st, 2nd, 3rd, ..... |
125 | 125 | * |
126 | - * @return array Returns the particular instance of the model. |
|
126 | + * @return Model Returns the particular instance of the model. |
|
127 | 127 | */ |
128 | 128 | public static function find($number) |
129 | 129 | { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | /** |
207 | 207 | * Sets the model's connection. |
208 | 208 | * |
209 | - * @param Opeyemiabiodun\PotatoORM\Connections\Connection $connection An instance of Opeyemiabiodun\PotatoORM\Connections\Connection. |
|
209 | + * @param Connection $connection An instance of Opeyemiabiodun\PotatoORM\Connections\Connection. |
|
210 | 210 | */ |
211 | 211 | protected function setConnection(Connection $connection) |
212 | 212 | { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Opeyemiabiodun\PotatoORM\Connections; |
4 | 4 | |
5 | -use Exception; |
|
6 | 5 | use Dotenv\Dotenv; |
6 | +use Exception; |
|
7 | 7 | use RuntimeException; |
8 | 8 | |
9 | 9 | trait LoadEnvVariablesTrait |
@@ -95,6 +95,9 @@ |
||
95 | 95 | return $this->keys[$table][0]; |
96 | 96 | } |
97 | 97 | |
98 | + /** |
|
99 | + * @param string $table |
|
100 | + */ |
|
98 | 101 | private function loadColumnInfo($table) |
99 | 102 | { |
100 | 103 | $query = "PRAGMA table_info('{$table}')"; |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Opeyemiabiodun\PotatoORM\Connections; |
4 | 4 | |
5 | +use InvalidArgumentException; |
|
5 | 6 | use PDO; |
6 | 7 | use PDOException; |
7 | -use InvalidArgumentException; |
|
8 | 8 | |
9 | 9 | final class SqliteConnection implements Connection |
10 | 10 | { |
@@ -16,6 +16,9 @@ |
||
16 | 16 | { |
17 | 17 | } |
18 | 18 | |
19 | + /** |
|
20 | + * @return Connection |
|
21 | + */ |
|
19 | 22 | public static function load() |
20 | 23 | { |
21 | 24 | $dotenv = new Dotenv(__DIR__.'/../..'); |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Opeyemiabiodun\PotatoORM\Connections; |
4 | 4 | |
5 | +use InvalidArgumentException; |
|
5 | 6 | use PDO; |
6 | 7 | use PDOException; |
7 | -use InvalidArgumentException; |
|
8 | 8 | |
9 | 9 | final class MySqlConnection implements Connection |
10 | 10 | { |
@@ -2,10 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace Opeyemiabiodun\PotatoORM\Connections; |
4 | 4 | |
5 | +use InvalidArgumentException; |
|
5 | 6 | use PDO; |
6 | 7 | use PDOException; |
7 | 8 | use RuntimeException; |
8 | -use InvalidArgumentException; |
|
9 | 9 | |
10 | 10 | final class PgSqlConnection implements Connection |
11 | 11 | { |