@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | - * @param $topLevelObject string |
|
| 129 | + * @param string $topLevelObject string |
|
| 130 | 130 | * @param $crudAction string |
| 131 | 131 | * |
| 132 | 132 | * Based on the values provided in the $topLevelObject and $crudAction |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | /** |
| 283 | 283 | * @param $jsonStructures array |
| 284 | - * @param $objectDefiner string |
|
| 284 | + * @param string $objectDefiner string |
|
| 285 | 285 | * |
| 286 | 286 | * While the {@link generateSqlFromStructure()} method above generates sql string |
| 287 | 287 | * from only valid top level objects, this method generates sql statements from valid |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | /** |
| 353 | 353 | * @param $encloserPre string |
| 354 | 354 | * @param $encloserPost string |
| 355 | - * @param $enclosee string |
|
| 355 | + * @param string $enclosee string |
|
| 356 | 356 | * |
| 357 | 357 | * Checks to see if a string ($enclosee) is enclosed by special characters |
| 358 | 358 | * such as '{' and '}' and '[' and ']'. |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | * @param $jsonStructureFile PathUtil | string | Array |
| 110 | 110 | * @param $sqlVendor string |
| 111 | 111 | */ |
| 112 | - public function __construct($jsonStructureFile, $sqlVendor='default') |
|
| 112 | + public function __construct($jsonStructureFile, $sqlVendor = 'default') |
|
| 113 | 113 | { |
| 114 | 114 | if (is_array($jsonStructureFile)) { |
| 115 | 115 | $this->jsonStructure = $jsonStructureFile; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | private $sqlSyntax; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * @param $jsynFile string | PathUtil |
|
| 38 | + * @param string $jsynFile string | PathUtil |
|
| 39 | 39 | * @param $sqlSyntax string |
| 40 | 40 | */ |
| 41 | 41 | public function __construct($jsynFile, $sqlSyntax) |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | - * @return array |
|
| 81 | + * @return string |
|
| 82 | 82 | */ |
| 83 | 83 | public function getJsyn() |
| 84 | 84 | { |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | if (isset($this->sqlSyntax)) { |
| 57 | 57 | $sqlSyntax = $this->sqlSyntax; |
| 58 | - if (!isset($this->jsyn->$sqlSyntax)){ |
|
| 58 | + if (!isset($this->jsyn->$sqlSyntax)) { |
|
| 59 | 59 | $sqlSyntax = "default"; |
| 60 | 60 | } |
| 61 | 61 | $this->jsyn = $this->jsyn->$sqlSyntax; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $this->jsyn = $this->jsyn->$sqlSyntax; |
| 78 | 78 | } |
| 79 | 79 | else { |
| 80 | - $sqlSyntax ="default"; |
|
| 80 | + $sqlSyntax = "default"; |
|
| 81 | 81 | $this->jsyn = $this->jsyn->$sqlSyntax; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -113,8 +113,7 @@ |
||
| 113 | 113 | { |
| 114 | 114 | if (is_array($jsonStructureFile)){ |
| 115 | 115 | $this->jsonStructure = $jsonStructureFile; |
| 116 | - } |
|
| 117 | - else { |
|
| 116 | + } else { |
|
| 118 | 117 | $this->jsonStructure = self::getObjectFromJsonFile($jsonStructureFile); |
| 119 | 118 | } |
| 120 | 119 | $this->sqlVendor = $sqlVendor; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | private $sqlSyntax; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * @param $jsynFile string | PathUtil |
|
| 38 | + * @param string $jsynFile string | PathUtil |
|
| 39 | 39 | * @param $sqlSyntax string |
| 40 | 40 | */ |
| 41 | 41 | public function __construct($jsynFile, $sqlSyntax) |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | - * @return array |
|
| 81 | + * @return string |
|
| 82 | 82 | */ |
| 83 | 83 | public function getJsyn() |
| 84 | 84 | { |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | if (isset($this->sqlSyntax)) { |
| 57 | 57 | $sqlSyntax = $this->sqlSyntax; |
| 58 | - if (!isset($this->jsyn->$sqlSyntax)){ |
|
| 58 | + if (!isset($this->jsyn->$sqlSyntax)) { |
|
| 59 | 59 | $sqlSyntax = "default"; |
| 60 | 60 | } |
| 61 | 61 | $this->jsyn = $this->jsyn->$sqlSyntax; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $this->jsyn = $this->jsyn->$sqlSyntax; |
| 78 | 78 | } |
| 79 | 79 | else { |
| 80 | - $sqlSyntax ="default"; |
|
| 80 | + $sqlSyntax = "default"; |
|
| 81 | 81 | $this->jsyn = $this->jsyn->$sqlSyntax; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -113,8 +113,7 @@ |
||
| 113 | 113 | { |
| 114 | 114 | if (is_array($jsonStructureFile)){ |
| 115 | 115 | $this->jsonStructure = $jsonStructureFile; |
| 116 | - } |
|
| 117 | - else { |
|
| 116 | + } else { |
|
| 118 | 117 | $this->jsonStructure = self::getObjectFromJsonFile($jsonStructureFile); |
| 119 | 118 | } |
| 120 | 119 | $this->sqlVendor = $sqlVendor; |
@@ -66,10 +66,10 @@ |
||
| 66 | 66 | return array( |
| 67 | 67 | 'Create Database with Multiple Tables' => [ |
| 68 | 68 | 'CREATE DATABASE another_unify_schools;'. |
| 69 | - 'USE another_unify_schools;'. |
|
| 70 | - "CREATE TABLE students (id int PRIMARY KEY, first_name varchar(20) DEFAULT 'samuel', last_name varchar(20), class varchar(10));". |
|
| 71 | - 'CREATE TABLE faculty (fac_id int AUTO_INCREMENT PRIMARY KEY, first_name varchar(20), last_name varchar(20));'. |
|
| 72 | - 'CREATE TABLE subjects (subject_id int AUTO_INCREMENT PRIMARY KEY, subject_name varchar(30), subject_faculty int , FOREIGN KEY (subject_faculty) REFERENCES faculty(fac_id) ON UPDATE cascade ON DELETE set null)', __DIR__.'/json/1.json', |
|
| 69 | + 'USE another_unify_schools;'. |
|
| 70 | + "CREATE TABLE students (id int PRIMARY KEY, first_name varchar(20) DEFAULT 'samuel', last_name varchar(20), class varchar(10));". |
|
| 71 | + 'CREATE TABLE faculty (fac_id int AUTO_INCREMENT PRIMARY KEY, first_name varchar(20), last_name varchar(20));'. |
|
| 72 | + 'CREATE TABLE subjects (subject_id int AUTO_INCREMENT PRIMARY KEY, subject_name varchar(30), subject_faculty int , FOREIGN KEY (subject_faculty) REFERENCES faculty(fac_id) ON UPDATE cascade ON DELETE set null)', __DIR__.'/json/1.json', |
|
| 73 | 73 | ], |
| 74 | 74 | 'Alter Table' => [ |
| 75 | 75 | "ALTER TABLE facultys ADD COLUMN (full_name varchar(30) NOT NULL DEFAULT 'john doe')", __DIR__.'/json/2.json', |