From 500851f161a14238472a1ad2525230de838b210a Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 23 Jan 2019 16:34:54 -0500 Subject: [PATCH] Style fixes --- CHANGELOG | 1 + lib/CLI.php | 2 +- lib/Db/MySQL/Statement.php | 4 ++-- lib/Db/PostgreSQL/Statement.php | 2 +- lib/Misc/ValueInfo.php | 2 +- tests/cases/Misc/TestValueInfo.php | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0254409..10832aa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ Version 0.6.1 (2019-01-23) +========================== Bug Fixes: - Unify SQL timeout settings diff --git a/lib/CLI.php b/lib/CLI.php index 36129e0..8ff1e1d 100644 --- a/lib/CLI.php +++ b/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 */ diff --git a/lib/Db/MySQL/Statement.php b/lib/Db/MySQL/Statement.php index 8af64f4..9612615 100644 --- a/lib/Db/MySQL/Statement.php +++ b/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; diff --git a/lib/Db/PostgreSQL/Statement.php b/lib/Db/PostgreSQL/Statement.php index 8d6668f..df74e3d 100644 --- a/lib/Db/PostgreSQL/Statement.php +++ b/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); } diff --git a/lib/Misc/ValueInfo.php b/lib/Misc/ValueInfo.php index 3ce76e7..752704d 100644 --- a/lib/Misc/ValueInfo.php +++ b/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); diff --git a/tests/cases/Misc/TestValueInfo.php b/tests/cases/Misc/TestValueInfo.php index 75a48bc..b6a34a6 100644 --- a/tests/cases/Misc/TestValueInfo.php +++ b/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, ],