ソースを参照

Style fixes

microsub 0.6.1
J. King 5年前
コミット
500851f161
  1. 1
      CHANGELOG
  2. 2
      lib/CLI.php
  3. 4
      lib/Db/MySQL/Statement.php
  4. 2
      lib/Db/PostgreSQL/Statement.php
  5. 2
      lib/Misc/ValueInfo.php
  6. 4
      tests/cases/Misc/TestValueInfo.php

1
CHANGELOG

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

2
lib/CLI.php

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

4
lib/Db/MySQL/Statement.php

@ -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;

2
lib/Db/PostgreSQL/Statement.php

@ -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);
}

2
lib/Misc/ValueInfo.php

@ -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);

4
tests/cases/Misc/TestValueInfo.php

@ -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, ],

読み込み中…
キャンセル
保存