diff --git a/Algorithm/Rating/Glicko1.php b/Algorithm/Rating/Glicko1.php index 48331c47d..81652f4b2 100644 --- a/Algorithm/Rating/Glicko1.php +++ b/Algorithm/Rating/Glicko1.php @@ -143,7 +143,7 @@ final class Glicko1 // Step 2: foreach ($oElo as $id => $e) { - $gRD_t = 1 / (\sqrt(1 + 3 * self::Q * self::Q * $oRd[$id] * $oRd[$id] / (\M_PI * \M_PI))); + $gRD_t = 1 / (\sqrt(1 + 3 * self::Q * self::Q * $oRd[$id] * $oRd[$id] / (\M_PI * \M_PI))); $gRD[$id] = $gRD_t; $E[$id] = 1 / (1 + \pow(10, $gRD_t * ($elo - $e) / -400)); } diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index 881294d0c..dd3b731a5 100755 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -540,7 +540,7 @@ class Builder extends BuilderAbstract * * @since 1.0.0 */ - public function where(string | array | Builder $columns, string | array $operator = null, mixed $values = null, string | array $boolean = 'and') : self + public function where(string | array | self $columns, string | array $operator = null, mixed $values = null, string | array $boolean = 'and') : self { if (!\is_array($columns)) { $columns = [$columns]; @@ -595,7 +595,7 @@ class Builder extends BuilderAbstract * * @since 1.0.0 */ - public function orWhere(string | array | Builder $where, string | array $operator = null, mixed $values = null) : self + public function orWhere(string | array | self $where, string | array $operator = null, mixed $values = null) : self { return $this->where($where, $operator, $values, 'or'); } diff --git a/DataStorage/Session/JWT.php b/DataStorage/Session/JWT.php index f629efde9..14e0e8ee6 100644 --- a/DataStorage/Session/JWT.php +++ b/DataStorage/Session/JWT.php @@ -35,8 +35,8 @@ final class JWT /** * Create JWT signature part * - * @param string $secret Secret (at least 256 bit) - * @param array{alg:string, typ:string} $header Header + * @param string $secret Secret (at least 256 bit) + * @param array{alg:string, typ:string} $header Header * @param array{sub:string, ?uid:string, ?name:string, iat:string} $payload Payload * * @return string hmac(Header64 . Payload64, secret) @@ -60,8 +60,8 @@ final class JWT /** * Create JWT token * - * @param string $secret Secret (at least 256 bit) - * @param array{alg:string, typ:string} $header Header + * @param string $secret Secret (at least 256 bit) + * @param array{alg:string, typ:string} $header Header * @param array{sub:string, ?uid:string, ?name:string, iat:string} $payload Payload * * @return string Header64 . Payload64 . hmac(Header64 . Payload64, secret) diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index acc27866c..933b70ab0 100755 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -67,7 +67,7 @@ abstract class HeaderAbstract */ public function __construct() { - $this->l11n = new Localization(); + $this->l11n = new Localization(); $this->timestamp = \time(); } diff --git a/Message/Http/ImpressionStat.php b/Message/Http/ImpressionStat.php index 43f235bdf..0040ed732 100644 --- a/Message/Http/ImpressionStat.php +++ b/Message/Http/ImpressionStat.php @@ -16,7 +16,6 @@ namespace phpOMS\Message\Http; use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Localization\ISO639x1Enum; -use phpOMS\Message\Http\HttpRequest; /** * Request statistic class. diff --git a/tests/Algorithm/Rating/Glicko1Test.php b/tests/Algorithm/Rating/Glicko1Test.php index 1d2d9bfd7..ec3c3199d 100644 --- a/tests/Algorithm/Rating/Glicko1Test.php +++ b/tests/Algorithm/Rating/Glicko1Test.php @@ -38,7 +38,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1648, - 'rd' => 186, + 'rd' => 186, ], $rating->rating(1500, 200, 0, 0, [1800], [1.0], [150]) ); @@ -46,7 +46,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1717, - 'rd' => 144, + 'rd' => 144, ], $rating->rating(1800, 150, 0, 0, [1500], [0.0], [200]) ); @@ -55,7 +55,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1637, - 'rd' => 186, + 'rd' => 186, ], $rating->rating(1500, 200, 0, 0, [1800], [1.0], [200]) ); @@ -63,7 +63,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1662, - 'rd' => 186, + 'rd' => 186, ], $rating->rating(1800, 200, 0, 0, [1500], [0.0], [200]) ); @@ -72,7 +72,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1621, - 'rd' => 177, + 'rd' => 177, ], $rating->rating(1550, 200, 0, 0, [1500], [1.0], [150]) ); @@ -80,7 +80,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1428, - 'rd' => 177, + 'rd' => 177, ], $rating->rating(1500, 200, 0, 0, [1550], [0.0], [150]) ); @@ -89,7 +89,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1539, - 'rd' => 177, + 'rd' => 177, ], $rating->rating(1550, 200, 0, 0, [1500], [0.5], [150]) ); @@ -97,7 +97,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1510, - 'rd' => 177, + 'rd' => 177, ], $rating->rating(1500, 200, 0, 0, [1550], [0.5], [150]) ); @@ -106,7 +106,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 2401, - 'rd' => 199, + 'rd' => 199, ], $rating->rating(2400, 200, 0, 0, [1500], [1.0], [150]) ); @@ -114,7 +114,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1498, - 'rd' => 199, + 'rd' => 199, ], $rating->rating(1500, 200, 0, 0, [2400], [0.0], [150]) ); @@ -132,7 +132,7 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'elo' => 1464, - 'rd' => 151, + 'rd' => 151, ], $rating->rating(1500, 200, 0, 0, [1400, 1550, 1700], [1.0, 0.0, 0.0], [30, 100, 300]) ); diff --git a/tests/Algorithm/Rating/Glicko2Test.php b/tests/Algorithm/Rating/Glicko2Test.php index 25c2ff12b..28b0cf8e0 100644 --- a/tests/Algorithm/Rating/Glicko2Test.php +++ b/tests/Algorithm/Rating/Glicko2Test.php @@ -38,8 +38,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1649, - 'rd' => 186, - 'vol' => 0.06 + 'rd' => 186, + 'vol' => 0.06, ], $rating->rating(1500, 200, 0.06, [1800], [1.0], [150]), 0.0001 @@ -48,8 +48,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1717, - 'rd' => 144, - 'vol' => 0.06 + 'rd' => 144, + 'vol' => 0.06, ], $rating->rating(1800, 150, 0.06, [1500], [0.0], [200]), 0.0001 @@ -59,8 +59,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1638, - 'rd' => 187, - 'vol' => 0.06 + 'rd' => 187, + 'vol' => 0.06, ], $rating->rating(1500, 200, 0.06, [1800], [1.0], [200]), 0.0001 @@ -69,8 +69,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1661, - 'rd' => 187, - 'vol' => 0.06 + 'rd' => 187, + 'vol' => 0.06, ], $rating->rating(1800, 200, 0.06, [1500], [0.0], [200]), 0.0001 @@ -80,8 +80,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1621, - 'rd' => 177, - 'vol' => 0.06 + 'rd' => 177, + 'vol' => 0.06, ], $rating->rating(1550, 200, 0.06, [1500], [1.0], [150]), 0.0001 @@ -90,8 +90,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1428, - 'rd' => 177, - 'vol' => 0.06 + 'rd' => 177, + 'vol' => 0.06, ], $rating->rating(1500, 200, 0.06, [1550], [0.0], [150]), 0.0001 @@ -101,8 +101,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1539, - 'rd' => 177, - 'vol' => 0.06 + 'rd' => 177, + 'vol' => 0.06, ], $rating->rating(1550, 200, 0.06, [1500], [0.5], [150]), 0.0001 @@ -111,8 +111,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1510, - 'rd' => 177, - 'vol' => 0.06 + 'rd' => 177, + 'vol' => 0.06, ], $rating->rating(1500, 200, 0.06, [1550], [0.5], [150]), 0.0001 @@ -122,8 +122,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 2401, - 'rd' => 199, - 'vol' => 0.06 + 'rd' => 199, + 'vol' => 0.06, ], $rating->rating(2400, 200, 0.06, [1500], [1.0], [150]), 0.0001 @@ -132,8 +132,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1498, - 'rd' => 199, - 'vol' => 0.06 + 'rd' => 199, + 'vol' => 0.06, ], $rating->rating(1500, 200, 0.06, [2400], [0.0], [150]), 0.0001 @@ -152,8 +152,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta( [ 'elo' => 1464, - 'rd' => 151, - 'vol' => 0.059999 + 'rd' => 151, + 'vol' => 0.059999, ], $rating->rating(1500, 200, 0.06, [1400, 1550, 1700], [1.0, 0.0, 0.0], [30, 100, 300]), 0.0001