mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
CS fixes
This commit is contained in:
parent
a5318d1b12
commit
39cad91b78
9 changed files with 8 additions and 9 deletions
|
@ -13,7 +13,7 @@ abstract class AbstractDriver implements Driver {
|
||||||
protected $transDepth = 0;
|
protected $transDepth = 0;
|
||||||
protected $transStatus = [];
|
protected $transStatus = [];
|
||||||
|
|
||||||
protected abstract function getError(): string;
|
abstract protected function getError(): string;
|
||||||
|
|
||||||
/** @codeCoverageIgnore */
|
/** @codeCoverageIgnore */
|
||||||
public function schemaVersion(): int {
|
public function schemaVersion(): int {
|
||||||
|
|
|
@ -44,4 +44,4 @@ trait PDODriver {
|
||||||
}
|
}
|
||||||
return new PDOStatement($this->db, $s, $paramTypes);
|
return new PDOStatement($this->db, $s, $paramTypes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,11 @@ trait PDOError {
|
||||||
default:
|
default:
|
||||||
return [Exception::class, "engineErrorGeneral", $err[1]." - ".$err[2]];
|
return [Exception::class, "engineErrorGeneral", $err[1]." - ".$err[2]];
|
||||||
}
|
}
|
||||||
|
// no break
|
||||||
default:
|
default:
|
||||||
return [Exception::class, "engineErrorGeneral", $err[2]]; // @codeCoverageIgnore
|
return [Exception::class, "engineErrorGeneral", $err[2]]; // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
// no break
|
||||||
default:
|
default:
|
||||||
return [Exception::class, "engineErrorGeneral", $err[0].": ".$err[2]]; // @codeCoverageIgnore
|
return [Exception::class, "engineErrorGeneral", $err[0].": ".$err[2]]; // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
@ -39,4 +41,4 @@ trait PDOError {
|
||||||
public function getError(): string {
|
public function getError(): string {
|
||||||
return (string) $this->db->errorInfo()[2];
|
return (string) $this->db->errorInfo()[2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
} elseif (PDODriver::requirementsMet()) {
|
} elseif (PDODriver::requirementsMet()) {
|
||||||
return new PDODriver;
|
return new PDODriver;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("extMissing", self::driverName());
|
throw new Exception("extMissing", self::driverName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class PDODriver extends Driver {
|
||||||
} elseif (Driver::requirementsMet()) {
|
} elseif (Driver::requirementsMet()) {
|
||||||
return new Driver;
|
return new Driver;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("extMissing", self::driverName());
|
throw new Exception("extMissing", self::driverName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ use JKingWeb\Arsse\Db\SQLite3\PDODriver;
|
||||||
* @covers \JKingWeb\Arsse\Db\PDOStatement<extended>
|
* @covers \JKingWeb\Arsse\Db\PDOStatement<extended>
|
||||||
* @covers \JKingWeb\Arsse\Db\PDOError */
|
* @covers \JKingWeb\Arsse\Db\PDOError */
|
||||||
class TestStatement extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestStatement extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
|
|
||||||
protected $c;
|
protected $c;
|
||||||
protected static $imp = \JKingWeb\Arsse\Db\PDOStatement::class;
|
protected static $imp = \JKingWeb\Arsse\Db\PDOStatement::class;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ namespace JKingWeb\Arsse\TestCase\Lang;
|
||||||
use JKingWeb\Arsse\Lang as TestClass;
|
use JKingWeb\Arsse\Lang as TestClass;
|
||||||
use org\bovigo\vfs\vfsStream;
|
use org\bovigo\vfs\vfsStream;
|
||||||
|
|
||||||
|
|
||||||
/** @covers \JKingWeb\Arsse\Lang */
|
/** @covers \JKingWeb\Arsse\Lang */
|
||||||
class TestBasic extends \JKingWeb\Arsse\Test\AbstractTest {
|
class TestBasic extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
use \JKingWeb\Arsse\Test\Lang\Setup;
|
use \JKingWeb\Arsse\Test\Lang\Setup;
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace JKingWeb\Arsse\TestCase\User;
|
namespace JKingWeb\Arsse\TestCase\User;
|
||||||
|
|
||||||
|
|
||||||
use JKingWeb\Arsse\Arsse;
|
use JKingWeb\Arsse\Arsse;
|
||||||
use JKingWeb\Arsse\Conf;
|
use JKingWeb\Arsse\Conf;
|
||||||
use JKingWeb\Arsse\User;
|
use JKingWeb\Arsse\User;
|
||||||
|
|
|
@ -103,7 +103,7 @@ trait Setup {
|
||||||
break;
|
break;
|
||||||
case "bool":
|
case "bool":
|
||||||
$test[$col] = (int) ValueInfo::normalize($value, ValueInfo::T_BOOL | ValueInfo::M_DROP | valueInfo::M_NULL);
|
$test[$col] = (int) ValueInfo::normalize($value, ValueInfo::T_BOOL | ValueInfo::M_DROP | valueInfo::M_NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($row===$test) {
|
if ($row===$test) {
|
||||||
|
|
Loading…
Reference in a new issue