for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* MDB2 Wrapper Made To Handle Like Our Other Classes Related Functionality
* @author Joe Huss <[email protected]>
* @copyright 2025
* @package MyAdmin
* @category SQL
*/
namespace MyDb\Mdb2;
use MyDb\Generic;
use MyDb\Mysqli\Db as MysqliDb;
use MyDb\Db_Interface;
* Db
*
* @access public
class Db extends MysqliDb implements Db_Interface
{
public $host = 'localhost';
public $user = 'pdns';
public $password = '';
public $database = 'pdns';
public $type = 'mdb2';
public $error = false;
public $message = '';
* Db::quote()
* @param string $text
* @param string $type
* @return string
public function quote($text = '', $type = 'text')
switch ($type) {
case 'text':
return "'".$this->escape($text)."'";
break;
break
The break statement is not necessary if it is preceded for example by a return statement:
return
switch ($x) { case 1: return 'foo'; break; // This break is not necessary and can be left off. }
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.
case
case 'integer':
return (int) $text;
default:
return $text;
}
* Db::queryOne()
* @param mixed $query
* @param string $line
* @param string $file
* @return bool
public function queryOne($query, $line = '', $file = '')
$this->query($query, $line, $file);
$line
string
integer
MyDb\Mysqli\Db::query()
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
$this->query($query, /** @scrutinizer ignore-type */ $line, $file);
if ($this->num_rows() > 0) {
$this->next_record();
return $this->f(0);
} else {
return 0;
* Db::queryRow()
* @return array|bool
public function queryRow($query, $line = '', $file = '')
return $this->Record;
* Db::lastInsertId()
* @param mixed $table
* @param mixed $field
* @return int
public function lastInsertId($table, $field)
return $this->getLastInsertId($table, $field);
The
break
statement is not necessary if it is preceded for example by areturn
statement:If you would like to keep this construct to be consistent with other
case
statements, you can safely mark this issue as a false-positive.