Use classmap autoloader for stapibas classes
[stapibas.git] / src / stapibas / PDO.php
index 5dd934ee1e08f237896569e8e146850c5ced709d..65a6b7336848f18dffbbae3cfa8d75490ba72521 100644 (file)
@@ -6,8 +6,9 @@ namespace stapibas;
  */
 class PDO extends \PDO
 {
-    public function query()
-    {
+    public function query(
+        string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs
+    ): \PDOStatement|false {
         $args = func_get_args();
         $res = call_user_func_array(array('parent', 'query'), $args);
         if ($res !== false) {
@@ -17,7 +18,7 @@ class PDO extends \PDO
         $this->handleError();
     }
 
-    public function exec($statement)
+    public function exec(string $statement): int|false
     {
         $res = parent::exec($statement);
         if ($res !== false) {
@@ -32,7 +33,8 @@ class PDO extends \PDO
         echo "SQL error\n";
         echo " " . $this->errorCode() . "\n";
         echo " " . implode(' - ', $this->errorInfo()) . "\n";
+        exit(2);
     }
 }
 
-?>
\ No newline at end of file
+?>