@@ -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 | { |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class User |
| 8 | 8 | { |
| 9 | - use Model; |
|
| 9 | + use Model; |
|
| 10 | 10 | } |
| 11 | 11 | \ No newline at end of file |
@@ -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 |
@@ -2,12 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Opeyemiabiodun\PotatoORM\Connections; |
| 4 | 4 | |
| 5 | -use PDO; |
|
| 6 | -use PDOException; |
|
| 7 | 5 | use InvalidArgumentException; |
| 8 | 6 | use Opeyemiabiodun\PotatoORM\Connections\Connection; |
| 9 | -use Opeyemiabiodun\PotatoORM\Connections\LoadEnvVariablesTrait; |
|
| 10 | 7 | use Opeyemiabiodun\PotatoORM\Connections\DatabaseTransactionsTrait; |
| 8 | +use Opeyemiabiodun\PotatoORM\Connections\LoadEnvVariablesTrait; |
|
| 9 | +use PDO; |
|
| 10 | +use PDOException; |
|
| 11 | 11 | |
| 12 | 12 | final class MySqlConnection implements Connection |
| 13 | 13 | { |
@@ -2,13 +2,13 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Opeyemiabiodun\PotatoORM\Connections; |
| 4 | 4 | |
| 5 | -use PDO; |
|
| 6 | -use PDOException; |
|
| 7 | -use RuntimeException; |
|
| 8 | 5 | use InvalidArgumentException; |
| 9 | 6 | use Opeyemiabiodun\PotatoORM\Connections\Connection; |
| 10 | -use Opeyemiabiodun\PotatoORM\Connections\LoadEnvVariablesTrait; |
|
| 11 | 7 | use Opeyemiabiodun\PotatoORM\Connections\DatabaseTransactionsTrait; |
| 8 | +use Opeyemiabiodun\PotatoORM\Connections\LoadEnvVariablesTrait; |
|
| 9 | +use PDO; |
|
| 10 | +use PDOException; |
|
| 11 | +use RuntimeException; |
|
| 12 | 12 | |
| 13 | 13 | final class PgSqlConnection implements Connection |
| 14 | 14 | { |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | namespace Opeyemiabiodun\PotatoORM\Connections; |
| 4 | 4 | |
| 5 | 5 | use Dotenv\Dotenv; |
| 6 | -use Opeyemiabiodun\PotatoORM\Connections\PgSqlConnection; |
|
| 7 | 6 | use Opeyemiabiodun\PotatoORM\Connections\MySqlConnection; |
| 7 | +use Opeyemiabiodun\PotatoORM\Connections\PgSqlConnection; |
|
| 8 | 8 | use Opeyemiabiodun\PotatoORM\Connections\SqliteConnection; |
| 9 | 9 | |
| 10 | 10 | class ConnectionFactory |
@@ -9,12 +9,12 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class ConnectionFactory |
| 11 | 11 | { |
| 12 | - private function __construct() |
|
| 13 | - { |
|
| 14 | - } |
|
| 12 | + private function __construct() |
|
| 13 | + { |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - public static function load() |
|
| 17 | - { |
|
| 16 | + public static function load() |
|
| 17 | + { |
|
| 18 | 18 | |
| 19 | 19 | $dotenv = new Dotenv(__DIR__.'/../..'); |
| 20 | 20 | $dotenv->load(); |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | switch (getenv('DB_ENGINE')) |
| 25 | 25 | { |
| 26 | - case 'mysql': |
|
| 27 | - return new MySqlConnection(); |
|
| 28 | - break; |
|
| 26 | + case 'mysql': |
|
| 27 | + return new MySqlConnection(); |
|
| 28 | + break; |
|
| 29 | 29 | |
| 30 | - case 'pgsql': |
|
| 31 | - return new PgSqlConnection(); |
|
| 32 | - break; |
|
| 30 | + case 'pgsql': |
|
| 31 | + return new PgSqlConnection(); |
|
| 32 | + break; |
|
| 33 | 33 | |
| 34 | 34 | case 'sqlite': |
| 35 | 35 | return new SqliteConnection(); |
| 36 | 36 | break; |
| 37 | 37 | } |
| 38 | - } |
|
| 38 | + } |
|
| 39 | 39 | } |
| 40 | 40 | \ No newline at end of file |