Automated formatting changes

This commit is contained in:
Formatter Bot 2023-09-21 16:42:46 +00:00
parent cf72e2f5ec
commit 06471f5f71
11 changed files with 26 additions and 27 deletions

View File

@ -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'];

View File

@ -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
}

View File

@ -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');
}

View File

@ -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',
],

View File

@ -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;
}

View File

@ -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');

View File

@ -16,7 +16,6 @@ namespace phpOMS\tests\Localization;
require_once __DIR__ . '/../Autoloader.php';
use phpOMS\Localization\ISO4217SymbolEnum;
use phpOMS\Localization\Money;
/**

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
function has𠀊Unicode(): bool
function has𠀊Unicode() : bool
{
return true;
}

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
function noDeprecated(): string
function noDeprecated() : string
{
return \is_string('');
}

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
function noUnicode(): bool
function noUnicode() : bool
{
return true;
}

View File

@ -171,7 +171,7 @@ final class LocationTest extends \PHPUnit\Framework\TestCase
'address' => 'Some address here',
'state' => 'This is a state 123',
'lat' => 12.1,
'lon' => 11.2,
'lon' => 11.2,
];
$this->location->postal = '0123456789';