mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-13 15:18:41 +00:00
Merge branch 'develop' of https://github.com/Karaka-Management/phpOMS into develop
This commit is contained in:
commit
173c501b54
|
|
@ -184,7 +184,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function getBrowserName(): string
|
public function getBrowserName() : string
|
||||||
{
|
{
|
||||||
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ final class Currency
|
||||||
try {
|
try {
|
||||||
$xml = new \SimpleXMLElement(Rest::request($request)->getBody());
|
$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
|
throw new \Exception('Invalid xml path'); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -443,12 +443,12 @@ class Markdown
|
||||||
return $Component['element'];
|
return $Component['element'];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isBlockContinuable($Type): bool
|
protected function isBlockContinuable($Type) : bool
|
||||||
{
|
{
|
||||||
return \method_exists($this, 'block' . $Type . 'Continue');
|
return \method_exists($this, 'block' . $Type . 'Continue');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isBlockCompletable($Type): bool
|
protected function isBlockCompletable($Type) : bool
|
||||||
{
|
{
|
||||||
return \method_exists($this, 'block' . $Type . 'Complete');
|
return \method_exists($this, 'block' . $Type . 'Complete');
|
||||||
}
|
}
|
||||||
|
|
@ -2257,7 +2257,7 @@ class Markdown
|
||||||
return $markup;
|
return $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function elements(array $Elements): string
|
protected function elements(array $Elements) : string
|
||||||
{
|
{
|
||||||
$markup = '';
|
$markup = '';
|
||||||
|
|
||||||
|
|
@ -2401,7 +2401,7 @@ class Markdown
|
||||||
# Static Methods
|
# 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');
|
return \htmlspecialchars($text, $allowQuotes ? \ENT_NOQUOTES : \ENT_QUOTES, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertTrue(
|
self::assertTrue(
|
||||||
!empty(
|
!empty(
|
||||||
$this->app->dispatcher->dispatch(
|
$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 HttpRequest(new HttpUri(''), $localization),
|
||||||
new HttpResponse($localization)
|
new HttpResponse($localization)
|
||||||
)
|
)
|
||||||
|
|
@ -95,7 +95,7 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertTrue(
|
self::assertTrue(
|
||||||
!empty(
|
!empty(
|
||||||
$this->app->dispatcher->dispatch(
|
$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(
|
!empty(
|
||||||
$this->app->dispatcher->dispatch(
|
$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:testFunction',
|
||||||
'phpOMS\tests\Dispatcher\TestController::testFunctionStatic',
|
'phpOMS\tests\Dispatcher\TestController::testFunctionStatic',
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -16,17 +16,17 @@ namespace phpOMS\tests\Dispatcher;
|
||||||
|
|
||||||
class TestController
|
class TestController
|
||||||
{
|
{
|
||||||
public function testFunction($req, $resp, $data = null): bool
|
public function testFunction($req, $resp, $data = null) : bool
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFunctionNoPara(): bool
|
public function testFunctionNoPara() : bool
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function testFunctionStatic($req, $resp, $data = null): bool
|
public static function testFunctionStatic($req, $resp, $data = null) : bool
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testAdd() : void
|
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());
|
self::assertEquals(1, $this->event->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,7 +63,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testClear() : void
|
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());
|
self::assertEquals(1, $this->event->count());
|
||||||
$this->event->clear();
|
$this->event->clear();
|
||||||
|
|
||||||
|
|
@ -77,8 +77,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testAddMultiple() : void
|
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());
|
self::assertEquals(1, $this->event->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -185,7 +185,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testReset() : void
|
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', 'id1');
|
||||||
$this->event->addGroup('group', 'id2');
|
$this->event->addGroup('group', 'id2');
|
||||||
|
|
||||||
|
|
@ -201,7 +201,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testNoReset() : void
|
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', 'id1');
|
||||||
$this->event->addGroup('group', 'id2');
|
$this->event->addGroup('group', 'id2');
|
||||||
|
|
||||||
|
|
@ -217,7 +217,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testDetach() : void
|
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', 'id1');
|
||||||
$this->event->addGroup('group', 'id2');
|
$this->event->addGroup('group', 'id2');
|
||||||
|
|
||||||
|
|
@ -234,7 +234,7 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testInvalidDetach() : void
|
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', 'id1');
|
||||||
$this->event->addGroup('group', 'id2');
|
$this->event->addGroup('group', 'id2');
|
||||||
|
|
||||||
|
|
@ -249,8 +249,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testRemove() : void
|
public function testRemove() : void
|
||||||
{
|
{
|
||||||
self::assertTrue($this->event->attach('group1', 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::assertTrue($this->event->attach('group2', function() : bool { return true; }, true, false));
|
||||||
|
|
||||||
self::assertEquals(2, $this->event->count());
|
self::assertEquals(2, $this->event->count());
|
||||||
$this->event->trigger('group1');
|
$this->event->trigger('group1');
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ namespace phpOMS\tests\Localization;
|
||||||
|
|
||||||
require_once __DIR__ . '/../Autoloader.php';
|
require_once __DIR__ . '/../Autoloader.php';
|
||||||
|
|
||||||
use phpOMS\Localization\ISO4217SymbolEnum;
|
|
||||||
use phpOMS\Localization\Money;
|
use phpOMS\Localization\Money;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
function has𠀊Unicode(): bool
|
function has𠀊Unicode() : bool
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
function noDeprecated(): string
|
function noDeprecated() : string
|
||||||
{
|
{
|
||||||
return \is_string('');
|
return \is_string('');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
function noUnicode(): bool
|
function noUnicode() : bool
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ final class LocationTest extends \PHPUnit\Framework\TestCase
|
||||||
'address' => 'Some address here',
|
'address' => 'Some address here',
|
||||||
'state' => 'This is a state 123',
|
'state' => 'This is a state 123',
|
||||||
'lat' => 12.1,
|
'lat' => 12.1,
|
||||||
'lon' => 11.2,
|
'lon' => 11.2,
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->location->postal = '0123456789';
|
$this->location->postal = '0123456789';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user