From 06471f5f712932110fdee287812bd91751a41a1c Mon Sep 17 00:00:00 2001 From: Formatter Bot Date: Thu, 21 Sep 2023 16:42:46 +0000 Subject: [PATCH] Automated formatting changes --- Message/Http/HttpHeader.php | 2 +- Utils/Converter/Currency.php | 2 +- Utils/Parser/Markdown/Markdown.php | 8 ++++---- tests/Dispatcher/DispatcherTest.php | 6 +++--- tests/Dispatcher/TestController.php | 6 +++--- tests/Event/EventManagerTest.php | 20 ++++++++++---------- tests/Localization/MoneyTest.php | 1 - tests/Security/Sample/hasUnicode.php | 2 +- tests/Security/Sample/noDeprecated.php | 2 +- tests/Security/Sample/noUnicode.php | 2 +- tests/Stdlib/Base/LocationTest.php | 2 +- 11 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Message/Http/HttpHeader.php b/Message/Http/HttpHeader.php index 9d765e278..e65e6b1c4 100755 --- a/Message/Http/HttpHeader.php +++ b/Message/Http/HttpHeader.php @@ -184,7 +184,7 @@ final class HttpHeader extends HeaderAbstract * * @since 1.0.0 */ - public function getBrowserName(): string + public function getBrowserName() : string { $userAgent = $_SERVER['HTTP_USER_AGENT']; diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index eea5269c0..17c85eaf1 100755 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -105,7 +105,7 @@ final class Currency try { $xml = new \SimpleXMLElement(Rest::request($request)->getBody()); - if (!(property_exists($xml, 'Cube') && $xml->Cube !== null)) { + if (!(\property_exists($xml, 'Cube') && $xml->Cube !== null)) { throw new \Exception('Invalid xml path'); // @codeCoverageIgnore } diff --git a/Utils/Parser/Markdown/Markdown.php b/Utils/Parser/Markdown/Markdown.php index e8c9afe2a..9dd25181f 100755 --- a/Utils/Parser/Markdown/Markdown.php +++ b/Utils/Parser/Markdown/Markdown.php @@ -443,12 +443,12 @@ class Markdown return $Component['element']; } - protected function isBlockContinuable($Type): bool + protected function isBlockContinuable($Type) : bool { return \method_exists($this, 'block' . $Type . 'Continue'); } - protected function isBlockCompletable($Type): bool + protected function isBlockCompletable($Type) : bool { return \method_exists($this, 'block' . $Type . 'Complete'); } @@ -2257,7 +2257,7 @@ class Markdown return $markup; } - protected function elements(array $Elements): string + protected function elements(array $Elements) : string { $markup = ''; @@ -2401,7 +2401,7 @@ class Markdown # Static Methods # - protected static function escape($text, $allowQuotes = false): string + protected static function escape($text, $allowQuotes = false) : string { return \htmlspecialchars($text, $allowQuotes ? \ENT_NOQUOTES : \ENT_QUOTES, 'UTF-8'); } diff --git a/tests/Dispatcher/DispatcherTest.php b/tests/Dispatcher/DispatcherTest.php index 952a01d92..9d9937d12 100755 --- a/tests/Dispatcher/DispatcherTest.php +++ b/tests/Dispatcher/DispatcherTest.php @@ -85,7 +85,7 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase self::assertTrue( !empty( $this->app->dispatcher->dispatch( - function($req, $resp, $data = null): bool { return true; }, + function($req, $resp, $data = null) : bool { return true; }, new HttpRequest(new HttpUri(''), $localization), new HttpResponse($localization) ) @@ -95,7 +95,7 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase self::assertTrue( !empty( $this->app->dispatcher->dispatch( - function($req): bool { return true; } + function($req) : bool { return true; } ) ) ); @@ -182,7 +182,7 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase !empty( $this->app->dispatcher->dispatch( [ - function($app, $req, $resp, $data = null): bool { return true; }, + function($app, $req, $resp, $data = null) : bool { return true; }, 'phpOMS\tests\Dispatcher\TestController:testFunction', 'phpOMS\tests\Dispatcher\TestController::testFunctionStatic', ], diff --git a/tests/Dispatcher/TestController.php b/tests/Dispatcher/TestController.php index 55e58a999..96badf149 100755 --- a/tests/Dispatcher/TestController.php +++ b/tests/Dispatcher/TestController.php @@ -16,17 +16,17 @@ namespace phpOMS\tests\Dispatcher; class TestController { - public function testFunction($req, $resp, $data = null): bool + public function testFunction($req, $resp, $data = null) : bool { return true; } - public function testFunctionNoPara(): bool + public function testFunctionNoPara() : bool { return true; } - public static function testFunctionStatic($req, $resp, $data = null): bool + public static function testFunctionStatic($req, $resp, $data = null) : bool { return true; } diff --git a/tests/Event/EventManagerTest.php b/tests/Event/EventManagerTest.php index 9ae71af41..2b71fca2b 100755 --- a/tests/Event/EventManagerTest.php +++ b/tests/Event/EventManagerTest.php @@ -52,7 +52,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testAdd() : void { - self::assertTrue($this->event->attach('group', function(): bool { return true; }, false, false)); + self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); self::assertEquals(1, $this->event->count()); } @@ -63,7 +63,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testClear() : void { - self::assertTrue($this->event->attach('group', function(): bool { return true; }, false, false)); + self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); self::assertEquals(1, $this->event->count()); $this->event->clear(); @@ -77,8 +77,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testAddMultiple() : void { - self::assertTrue($this->event->attach('group', function(): bool { return true; }, false, false)); - self::assertTrue($this->event->attach('group', function(): bool { return true; }, false, false)); + self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); + self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); self::assertEquals(1, $this->event->count()); } @@ -185,7 +185,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testReset() : void { - self::assertTrue($this->event->attach('group', function(): bool { return true; }, false, true)); + self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, true)); $this->event->addGroup('group', 'id1'); $this->event->addGroup('group', 'id2'); @@ -201,7 +201,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testNoReset() : void { - self::assertTrue($this->event->attach('group', function(): bool { return true; }, false, false)); + self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); $this->event->addGroup('group', 'id1'); $this->event->addGroup('group', 'id2'); @@ -217,7 +217,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testDetach() : void { - $this->event->attach('group', function(): bool { return true; }, false, true); + $this->event->attach('group', function() : bool { return true; }, false, true); $this->event->addGroup('group', 'id1'); $this->event->addGroup('group', 'id2'); @@ -234,7 +234,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDetach() : void { - $this->event->attach('group', function(): bool { return true; }, false, true); + $this->event->attach('group', function() : bool { return true; }, false, true); $this->event->addGroup('group', 'id1'); $this->event->addGroup('group', 'id2'); @@ -249,8 +249,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase */ public function testRemove() : void { - self::assertTrue($this->event->attach('group1', function(): bool { return true; }, true, false)); - self::assertTrue($this->event->attach('group2', function(): bool { return true; }, true, false)); + self::assertTrue($this->event->attach('group1', function() : bool { return true; }, true, false)); + self::assertTrue($this->event->attach('group2', function() : bool { return true; }, true, false)); self::assertEquals(2, $this->event->count()); $this->event->trigger('group1'); diff --git a/tests/Localization/MoneyTest.php b/tests/Localization/MoneyTest.php index 3e213613e..30056712e 100755 --- a/tests/Localization/MoneyTest.php +++ b/tests/Localization/MoneyTest.php @@ -16,7 +16,6 @@ namespace phpOMS\tests\Localization; require_once __DIR__ . '/../Autoloader.php'; -use phpOMS\Localization\ISO4217SymbolEnum; use phpOMS\Localization\Money; /** diff --git a/tests/Security/Sample/hasUnicode.php b/tests/Security/Sample/hasUnicode.php index 2cffa31cc..25788c200 100755 --- a/tests/Security/Sample/hasUnicode.php +++ b/tests/Security/Sample/hasUnicode.php @@ -1,7 +1,7 @@ 'Some address here', 'state' => 'This is a state 123', 'lat' => 12.1, - 'lon' => 11.2, + 'lon' => 11.2, ]; $this->location->postal = '0123456789';