@@ -64,13 +64,13 @@ private function MySQLTemplate()
6464 $ checkPrimary = array_column ($ this ->columns , 'primary ' );
6565 if (count ($ checkPrimary ) > 1 ){
6666 return [
67- 'response ' => self ::ERROR_404 ,
67+ 'status ' => self ::ERROR_404 ,
6868 'message ' => sprintf ("Primary Key can not be more than one in `%s` @table " , $ this ->tableName ),
6969 ];
7070 }
7171
7272 return [
73- 'response ' => self ::ERROR_200 ,
73+ 'status ' => self ::ERROR_200 ,
7474 'message ' => $ this ->toMySQLQuery ()
7575 ];
7676 }
@@ -86,14 +86,14 @@ public function handle()
8686 $ traceTable = $ this ->traceable ($ this ->tableName );
8787
8888 // handle error
89- $ handle = self ::checkDBConnect ($ traceTable );
89+ $ handle = self ::checkDBConnect ();
9090 if (is_array ($ handle )){
9191 return $ handle ;
9292 }
9393
9494 // primary key error
9595 $ mysqlHandle = $ this ->MySQLTemplate ();
96- if ($ mysqlHandle ['response ' ] != self ::ERROR_200 ){
96+ if ($ mysqlHandle ['status ' ] != self ::ERROR_200 ){
9797 return $ mysqlHandle ;
9898 }
9999
@@ -120,11 +120,11 @@ public function handle()
120120 }
121121
122122 return [
123- 'response ' => self ::ERROR_200 ,
123+ 'status ' => self ::ERROR_200 ,
124124 'message ' => $ message ,
125125 ];
126126 } catch (PDOException $ e ){
127- return ['response ' => self ::ERROR_404 , 'message ' => $ e ->getMessage ()];
127+ return ['status ' => self ::ERROR_404 , 'message ' => $ e ->getMessage ()];
128128 }
129129 }
130130
@@ -140,11 +140,10 @@ public function __destruct()
140140
141141 /**
142142 * Check database connection error
143- * @param string $tableName
144143 *
145144 * @return mixed
146145 */
147- private function checkDBConnect (? string $ tableName = null )
146+ private function checkDBConnect ()
148147 {
149148 // if database connection is okay
150149 $ dbConnection = $ this ->db ->getConnection ();
@@ -154,7 +153,7 @@ private function checkDBConnect(?string $tableName = null)
154153 'message ' => "Connection Error
155154 <span style='background: #ee0707; {$ this ->style }'>
156155 Database Connection Error
157- </span> on ` { $ tableName } `
156+ </span>
158157 ` {$ dbConnection ['message ' ]}` <br> \n" ,
159158 ];
160159 }
0 commit comments