@@ -22,18 +22,18 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function handle() |
| 24 | 24 | { |
| 25 | - foreach ($this->tableFilters() as $table=>$files){ |
|
| 25 | + foreach ($this->tableFilters() as $table=>$files) { |
|
| 26 | 26 | |
| 27 | 27 | $table = strtolower($table); |
| 28 | 28 | |
| 29 | 29 | foreach ($files as $file) { |
| 30 | 30 | |
| 31 | - $getClassName = preg_replace('@(\d+)_@is','',$file); |
|
| 31 | + $getClassName = preg_replace('@(\d+)_@is', '', $file); |
|
| 32 | 32 | $className = $this->getClassName($getClassName); |
| 33 | 33 | |
| 34 | 34 | require_once ($file); |
| 35 | 35 | |
| 36 | - $capsule = new SchemaCapsule($this->config,$file,$table); |
|
| 36 | + $capsule = new SchemaCapsule($this->config, $file, $table); |
|
| 37 | 37 | |
| 38 | 38 | $this->list[$table][] = (new $className)->up($capsule); |
| 39 | 39 | } |
@@ -29,14 +29,14 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $this->config = $config; |
| 31 | 31 | |
| 32 | - if(is_null(self::$instance)){ |
|
| 32 | + if (is_null(self::$instance)) { |
|
| 33 | 33 | |
| 34 | 34 | //get pdo dsn |
| 35 | - $dsn=''.$config['driver'].':host='.$config['host'].';dbname='.$config['database'].''; |
|
| 35 | + $dsn = ''.$config['driver'].':host='.$config['host'].';dbname='.$config['database'].''; |
|
| 36 | 36 | $this->connection = new \PDO($dsn, $config['user'], $config['password']); |
| 37 | 37 | $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); |
| 38 | 38 | |
| 39 | - self::$instance=true; |
|
| 39 | + self::$instance = true; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
@@ -11,19 +11,19 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function processHandler() |
| 13 | 13 | { |
| 14 | - return $this->errorHandler(function(){ |
|
| 14 | + return $this->errorHandler(function() { |
|
| 15 | 15 | |
| 16 | - foreach ($this->list as $table =>$datas){ |
|
| 16 | + foreach ($this->list as $table =>$datas) { |
|
| 17 | 17 | |
| 18 | - foreach ($datas as $data){ |
|
| 18 | + foreach ($datas as $data) { |
|
| 19 | 19 | |
| 20 | - $query = $this->queryBuilder($table,$data); |
|
| 20 | + $query = $this->queryBuilder($table, $data); |
|
| 21 | 21 | |
| 22 | 22 | $query = $query->handle(); |
| 23 | 23 | |
| 24 | - $status =($query['result']!==false) ? true : false; |
|
| 24 | + $status = ($query['result']!==false) ? true : false; |
|
| 25 | 25 | |
| 26 | - $results[]= [ |
|
| 26 | + $results[] = [ |
|
| 27 | 27 | 'success'=>$status, |
| 28 | 28 | 'file'=>$data->getFile(), |
| 29 | 29 | 'table'=>$table, |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | foreach ($objects as $object) |
| 52 | 52 | { |
| 53 | - if(count($object->getError())){ |
|
| 53 | + if (count($object->getError())) { |
|
| 54 | 54 | return 'error : '.$object->getFile().' -> '.$object->getError()[0].''; |
| 55 | 55 | } |
| 56 | 56 | } |