1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Style fixes

This commit is contained in:
J. King 2019-01-23 16:34:54 -05:00
parent 91b6fdc696
commit 500851f161
6 changed files with 8 additions and 7 deletions

View file

@ -1,4 +1,5 @@
Version 0.6.1 (2019-01-23)
==========================
Bug Fixes:
- Unify SQL timeout settings

View file

@ -88,7 +88,7 @@ USAGE_TEXT;
/** @codeCoverageIgnore */
protected function logError(string $msg) {
fwrite(STDERR,$msg.\PHP_EOL);
fwrite(STDERR, $msg.\PHP_EOL);
}
/** @codeCoverageIgnore */

View file

@ -94,8 +94,8 @@ class Statement extends \JKingWeb\Arsse\Db\AbstractStatement {
}
protected function bindValue($value, string $type, int $position): bool {
// this is a bit of a hack: we collect values (and MySQL bind types) here so that we can take
// advantage of the work done by bindValues() even though MySQL requires everything to be bound
// this is a bit of a hack: we collect values (and MySQL bind types) here so that we can take
// advantage of the work done by bindValues() even though MySQL requires everything to be bound
// all at once; we also segregate large values for later packetization
if (($type === "binary" && !is_null($value)) || (is_string($value) && strlen($value) > $this->packetSize)) {
$this->values[] = null;

View file

@ -29,7 +29,7 @@ class Statement extends \JKingWeb\Arsse\Db\AbstractStatement {
protected $bindings;
public function __construct($db, string $query, array $bindings = []) {
$this->db = $db;
$this->db = $db;
$this->query = $query;
$this->retypeArray($bindings);
}

View file

@ -352,7 +352,7 @@ class ValueInfo {
// input is a number, assume this is a number of seconds
// for legibility we convert large numbers to minutes, hours, and days as necessary
// the DateInterval constructor only allows 12 digits for any given part of an interval,
// so we also convert days to 365-day years where we must, and cap the number of years
// so we also convert days to 365-day years where we must, and cap the number of years
// at (1e11 - 1); this being a very large number, the loss of precision is probably not
// significant in practical usage
$sec = abs($value);

View file

@ -457,7 +457,7 @@ class TestValueInfo extends \JKingWeb\Arsse\Test\AbstractTest {
*/
/* Input value null bool int float string array interval */
[null, [null,true], [false,false], [0, false], [0.0, false], ["", false], [[], false], [null, false]],
["", [null,true], [false,true], [0, false], [0.0, false], ["", true], [[""], false], [null, false]],
["", [null,true], [false,true], [0, false], [0.0, false], ["", true], [[""], false], [null, false]],
[1, [null,true], [true, true], [1, true], [1.0, true], ["1", true], [[1], false], [$this->i("PT1S"), false]],
[PHP_INT_MAX, [null,true], [true, false], [PHP_INT_MAX, true], [(float) PHP_INT_MAX,true], [(string) PHP_INT_MAX, true], [[PHP_INT_MAX], false], [$this->i("P292471208677Y195DT15H30M7S"), false]],
[1.0, [null,true], [true, true], [1, true], [1.0, true], ["1", true], [[1.0], false], [$this->i("PT1S"), false]],
@ -571,7 +571,7 @@ class TestValueInfo extends \JKingWeb\Arsse\Test\AbstractTest {
"!M j, Y (D)",
null,
];
foreach([
foreach ([
/* Input value microtime iso8601 iso8601m http sql date time unix float '!M j, Y (D)' *strtotime* (null) */
[null, null, null, null, null, null, null, null, null, null, null, null, ],
[INF, null, null, null, null, null, null, null, null, null, null, null, ],