Browse Source

Style fixes

tags/0.6.1
J. King 6 months ago
parent
commit
500851f161

+ 1
- 0
CHANGELOG View File

@@ -1,4 +1,5 @@
Version 0.6.1 (2019-01-23)
==========================

Bug Fixes:
- Unify SQL timeout settings

+ 1
- 1
lib/CLI.php 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 */

+ 2
- 2
lib/Db/MySQL/Statement.php 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;

+ 1
- 1
lib/Db/PostgreSQL/Statement.php 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);
}

+ 1
- 1
lib/Misc/ValueInfo.php 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);

+ 2
- 2
tests/cases/Misc/TestValueInfo.php 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, ],

Loading…
Cancel
Save