| Total Complexity | 4 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Schema extends SchemaHelper implements SchemaContract |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var array $params |
||
| 15 | */ |
||
| 16 | public $params = array(); |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var $config |
||
|
|
|||
| 20 | */ |
||
| 21 | protected $config; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var $connection |
||
| 25 | */ |
||
| 26 | protected $connection; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var $driver |
||
| 30 | */ |
||
| 31 | protected $driver; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var $grammarPath |
||
| 35 | */ |
||
| 36 | protected $grammarPath = 'Migratio\GrammarStructure'; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Schema constructor. |
||
| 40 | * @param null $config |
||
| 41 | */ |
||
| 42 | public function __construct($config=null) |
||
| 43 | { |
||
| 44 | $this->config = $config; |
||
| 45 | $this->driver = $this->config['database']['driver']; |
||
| 46 | $this->grammarPath = $this->grammarPath.'\\'.ucfirst($this->driver); |
||
| 47 | $this->connection = (new SqlDefinitor($this->config))->getConnection(); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return Pulling|mixed |
||
| 52 | */ |
||
| 53 | public function pull() |
||
| 54 | { |
||
| 55 | $pulling = new Pulling($this); |
||
| 56 | |||
| 57 | return $pulling->get(); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return Pushing|mixed |
||
| 62 | */ |
||
| 63 | public function push() |
||
| 64 | { |
||
| 65 | $pushing = new Pushing($this); |
||
| 66 | |||
| 67 | return $pushing->handle(); |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @return mixed|void |
||
| 72 | */ |
||
| 73 | public function stub(...$params) |
||
| 78 | } |
||
| 79 | } |