From 8988899c8c24397a02b5a928657bc0ca364735ef Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 18 Jun 2023 12:54:22 +0200 Subject: [PATCH] apply StyleCI patch, fixes #1084 --- lib/Data/Filesystem.php | 9 ++++----- lib/Filter.php | 2 +- lib/I18n.php | 2 +- lib/Request.php | 2 +- lib/Vizhash16x16.php | 6 +++--- tst/Bootstrap.php | 8 ++++---- tst/JsonApiTest.php | 40 ++++++++++++++++++++-------------------- 7 files changed, 34 insertions(+), 35 deletions(-) diff --git a/lib/Data/Filesystem.php b/lib/Data/Filesystem.php index dd047202..d064dadc 100644 --- a/lib/Data/Filesystem.php +++ b/lib/Data/Filesystem.php @@ -229,11 +229,10 @@ class Filesystem extends AbstractData // Store in array $key = $this->getOpenSlot( - $comments, ( - (int) array_key_exists('created', $comment['meta']) ? - $comment['meta']['created'] : // v2 comments - $comment['meta']['postdate'] // v1 comments - ) + $comments, + (int) array_key_exists('created', $comment['meta']) ? + $comment['meta']['created'] : // v2 comments + $comment['meta']['postdate'] // v1 comments ); $comments[$key] = $comment; } diff --git a/lib/Filter.php b/lib/Filter.php index de6b0e60..05665c7d 100644 --- a/lib/Filter.php +++ b/lib/Filter.php @@ -66,6 +66,6 @@ class Filter $size = $size / 1024; ++$i; } - return number_format($size, ($i ? 2 : 0), '.', ' ') . ' ' . I18n::_($iec[$i]); + return number_format($size, $i ? 2 : 0, '.', ' ') . ' ' . I18n::_($iec[$i]); } } diff --git a/lib/I18n.php b/lib/I18n.php index e80e019c..cc70f417 100644 --- a/lib/I18n.php +++ b/lib/I18n.php @@ -339,8 +339,8 @@ class I18n return $n % 10 === 1 && $n % 100 != 11 ? 0 : ($n % 10 >= 2 && $n % 10 <= 4 && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2); case 'sl': return $n % 100 === 1 ? 1 : ($n % 100 === 2 ? 2 : ($n % 100 === 3 || $n % 100 === 4 ? 3 : 0)); - // bg, ca, de, el, en, es, et, fi, hu, it, nl, no, pt default: + // bg, ca, de, el, en, es, et, fi, hu, it, nl, no, pt return $n !== 1 ? 1 : 0; } } diff --git a/lib/Request.php b/lib/Request.php index c4dceb2b..94442b90 100644 --- a/lib/Request.php +++ b/lib/Request.php @@ -225,7 +225,7 @@ class Request return array_key_exists('REQUEST_URI', $_SERVER) ? htmlspecialchars( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) - ) : '/'; + ) : '/'; } /** diff --git a/lib/Vizhash16x16.php b/lib/Vizhash16x16.php index a2dc0dd4..6391e346 100644 --- a/lib/Vizhash16x16.php +++ b/lib/Vizhash16x16.php @@ -185,9 +185,9 @@ class Vizhash16x16 $sizeinv = imagesx($img); } $diffs = array( - (($color2[0] - $color1[0]) / $size), - (($color2[1] - $color1[1]) / $size), - (($color2[2] - $color1[2]) / $size), + ($color2[0] - $color1[0]) / $size, + ($color2[1] - $color1[1]) / $size, + ($color2[2] - $color1[2]) / $size, ); for ($i = 0; $i < $size; ++$i) { $r = $color1[0] + ($diffs[0] * $i); diff --git a/tst/Bootstrap.php b/tst/Bootstrap.php index bcf622f4..3af4db0a 100644 --- a/tst/Bootstrap.php +++ b/tst/Bootstrap.php @@ -196,10 +196,10 @@ class BucketStub extends Bucket $prefix = key_exists('prefix', $options) ? $options['prefix'] : ''; return new CallbackFilterIterator( - new ArrayIterator($this->_objects), - function ($current, $key, $iterator) use ($prefix) { - return substr($key, 0, strlen($prefix)) == $prefix; - } + new ArrayIterator($this->_objects), + function ($current, $key, $iterator) use ($prefix) { + return substr($key, 0, strlen($prefix)) == $prefix; + } ); } diff --git a/tst/JsonApiTest.php b/tst/JsonApiTest.php index 37c69978..4f660d33 100644 --- a/tst/JsonApiTest.php +++ b/tst/JsonApiTest.php @@ -195,10 +195,10 @@ class JsonApiTest extends PHPUnit_Framework_TestCase $content = ob_get_contents(); ob_end_clean(); $this->assertEquals(str_replace( - '?jsonld=', - '/?jsonld=', - file_get_contents(PUBLIC_PATH . '/js/paste.jsonld') - ), $content, 'outputs data correctly'); + '?jsonld=', + '/?jsonld=', + file_get_contents(PUBLIC_PATH . '/js/paste.jsonld') + ), $content, 'outputs data correctly'); } /** @@ -212,10 +212,10 @@ class JsonApiTest extends PHPUnit_Framework_TestCase $content = ob_get_contents(); ob_end_clean(); $this->assertEquals(str_replace( - '?jsonld=', - '/?jsonld=', - file_get_contents(PUBLIC_PATH . '/js/comment.jsonld') - ), $content, 'outputs data correctly'); + '?jsonld=', + '/?jsonld=', + file_get_contents(PUBLIC_PATH . '/js/comment.jsonld') + ), $content, 'outputs data correctly'); } /** @@ -229,10 +229,10 @@ class JsonApiTest extends PHPUnit_Framework_TestCase $content = ob_get_contents(); ob_end_clean(); $this->assertEquals(str_replace( - '?jsonld=', - '/?jsonld=', - file_get_contents(PUBLIC_PATH . '/js/pastemeta.jsonld') - ), $content, 'outputs data correctly'); + '?jsonld=', + '/?jsonld=', + file_get_contents(PUBLIC_PATH . '/js/pastemeta.jsonld') + ), $content, 'outputs data correctly'); } /** @@ -246,10 +246,10 @@ class JsonApiTest extends PHPUnit_Framework_TestCase $content = ob_get_contents(); ob_end_clean(); $this->assertEquals(str_replace( - '?jsonld=', - '/?jsonld=', - file_get_contents(PUBLIC_PATH . '/js/commentmeta.jsonld') - ), $content, 'outputs data correctly'); + '?jsonld=', + '/?jsonld=', + file_get_contents(PUBLIC_PATH . '/js/commentmeta.jsonld') + ), $content, 'outputs data correctly'); } /** @@ -263,10 +263,10 @@ class JsonApiTest extends PHPUnit_Framework_TestCase $content = ob_get_contents(); ob_end_clean(); $this->assertEquals(str_replace( - '?jsonld=', - '/?jsonld=', - file_get_contents(PUBLIC_PATH . '/js/types.jsonld') - ), $content, 'outputs data correctly'); + '?jsonld=', + '/?jsonld=', + file_get_contents(PUBLIC_PATH . '/js/types.jsonld') + ), $content, 'outputs data correctly'); } /**