Passed
Push — main ( 4e95be...aeb352 )
by Miaad
01:27
created
database/database.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@
 block discarded – undo
17 17
    /**
18 18
    * @const types database
19 19
    */
20
-   const TYPES = array('Mysqli','Medoo','Json');
20
+   const TYPES = array('Mysqli', 'Medoo', 'Json');
21 21
  
22 22
    /**
23 23
     * @const Medoo database types
24 24
     */
25
-   const Medoo_Types = array('mysql','mariadb','pgsql','sybase','oracle','mssql', 'sqlite');
25
+   const Medoo_Types = array('mysql', 'mariadb', 'pgsql', 'sybase', 'oracle', 'mssql', 'sqlite');
26 26
 
27 27
     /**
28 28
      * @var type database
Please login to merge, or discard this patch.
database/handller.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
        */
18 18
       public function __construct(array $settings)
19 19
       {
20
-        if(in_array($settings['type'],self::TYPES)){
21
-              if($settings['type'] === 'Mysqli'){
22
-                  if(self::CheckParam($settings)){
20
+        if (in_array($settings['type'], self::TYPES)) {
21
+              if ($settings['type'] === 'Mysqli') {
22
+                  if (self::CheckParam($settings)) {
23 23
                  $db = new Mysqlidb([
24 24
                 'host' => $this->host,
25 25
                 'username' => $this->username,
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                 'db' => $this->dbname,
28 28
                 'charset' => $this->charset
29 29
                 ]);
30
-                if($db){
30
+                if ($db) {
31 31
                   $this->connect = $db;
32 32
                } else {
33 33
                   throw new \exception('a problem to connecting');
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                   throw new \exception('required parameters not found');
37 37
                }
38 38
              }
39
-              if($settings['type'] === 'Json' and isset($settings['dbname'])){
39
+              if ($settings['type'] === 'Json' and isset($settings['dbname'])) {
40 40
                 $this->type = $settings['type'];
41 41
                 $this->dbname = $settings['dbname'];
42 42
                 parent::Json_init();
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
           }
49 49
       }
50 50
       
51
-      private static function CheckParam(array $array){
52
-         if(isset($array['username']) && isset($array['dbname']) && isset($array['password'])){
51
+      private static function CheckParam(array $array) {
52
+         if (isset($array['username']) && isset($array['dbname']) && isset($array['password'])) {
53 53
             $this->host = $array['host'] ?? 'localhost';
54 54
             $this->username = $array['username'];
55 55
             $this->dbname = $array['dbname'];
Please login to merge, or discard this patch.