diff --git a/DataStorage/Database/Mapper/DataMapperAbstract.php b/DataStorage/Database/Mapper/DataMapperAbstract.php index b7a9fdb82..f02323f70 100755 --- a/DataStorage/Database/Mapper/DataMapperAbstract.php +++ b/DataStorage/Database/Mapper/DataMapperAbstract.php @@ -353,6 +353,18 @@ abstract class DataMapperAbstract return $this; } + /** + * Define the joining data + * + * @param string $member Property name to filter by + * @param mixed $value Filter value + * @param string $logic Comparison logic (e.g. =, in, ...) + * @param string $connector Filter connector (e.g. AND, OR, ...) + * + * @return self + * + * @since 1.0.0 + */ public function on(string $member, mixed $value, string $logic = '=', string $connector = 'AND', string $relation = '') : self { $this->on[$relation][] = [ diff --git a/Message/Http/HttpRequest.php b/Message/Http/HttpRequest.php index 030ada013..97fd78c83 100755 --- a/Message/Http/HttpRequest.php +++ b/Message/Http/HttpRequest.php @@ -404,7 +404,7 @@ final class HttpRequest extends RequestAbstract public function getLocale() : string { if (!empty($this->locale)) { - return $this->locale = $this->header->l11n->language . '_' . $this->header->l11n->getCountry(); + return $this->locale = $this->header->l11n->language . '_' . $this->header->l11n->country; } if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { diff --git a/Security/EncryptionHelper.php b/Security/EncryptionHelper.php index 841ec8a93..8c02b432f 100755 --- a/Security/EncryptionHelper.php +++ b/Security/EncryptionHelper.php @@ -156,6 +156,17 @@ final class EncryptionHelper return $plaintext === false ? '' : $plaintext; } + /** + * Decrypt an encrypted file + * + * @param string $in Encrypted file + * @param string $out Decrypted file + * @param string $keyHex Shared key in hex + * + * @return bool + * + * @since 1.0.0 + */ public static function decryptFile(string $in, string $out, string $keyHex) : bool { $fpSource = \fopen($in, 'rb'); diff --git a/Utils/Barcode/QR.php b/Utils/Barcode/QR.php index 0ca45f061..67a7992a4 100755 --- a/Utils/Barcode/QR.php +++ b/Utils/Barcode/QR.php @@ -2725,14 +2725,15 @@ class QR extends TwoDAbstract $rs['gfpoly'] = $gfpoly; // Find prim-th root of 1, used in decoding - for ($iprim=1; ($iprim % $prim) !== 0; $iprim += $rs['nn']) { - // intentional empty-body loop! + $iprim = 1; + while ($iprim % $prim !== 0) { + $iprim += $rs['nn']; } $rs['iprim'] = (int) ($iprim / $prim); $rs['genpoly'][0] = 1; - for ($i = 0,$root = $fcr * $prim; $i < $nroots; $i++, $root += $prim) { + for ($i = 0, $root = $fcr * $prim; $i < $nroots; ++$i, $root += $prim) { $rs['genpoly'][$i + 1] = 1; // Multiply rs->genpoly[] by @**(root + x) diff --git a/tests/Views/ViewTest.php b/tests/Views/ViewTest.php index 0b9cb1786..4688c0ecc 100755 --- a/tests/Views/ViewTest.php +++ b/tests/Views/ViewTest.php @@ -82,7 +82,7 @@ final class ViewTest extends \PHPUnit\Framework\TestCase */ public function testHasData() : void { - $view = new View($this->app->l11nManager); + $view = new View($this->app->l11nManager); $view->data['a'] = 1; self::assertTrue($view->hasData('a'));