mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
Fix whitespaces
This commit is contained in:
parent
536d480a36
commit
8a91224f66
|
|
@ -570,7 +570,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
|
||||
/**
|
||||
* Create relation
|
||||
*
|
||||
*
|
||||
* This is only possible for hasMany objects which are stored in a relation table
|
||||
*
|
||||
* @param string $member Member name of the relation
|
||||
|
|
@ -651,9 +651,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
}
|
||||
|
||||
// Setting relation value (id) for relation (since the relation is not stored in an extra relation table)
|
||||
/**
|
||||
* @todo: this if comparison is correct, trust me. however,
|
||||
* manybe it makes more sense to simply check if 'src' isset(static::$hasMany[$propertyName]['src'])
|
||||
/**
|
||||
* @todo: this if comparison is correct, trust me. however,
|
||||
* manybe it makes more sense to simply check if 'src' isset(static::$hasMany[$propertyName]['src'])
|
||||
* source shouldn't be set if the relation is stored in the object itself
|
||||
*/
|
||||
/** @var string $table */
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ final class EventManager
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function detachGroup(string $group) : bool
|
||||
private function detachGroup(string $group) : bool
|
||||
{
|
||||
if (isset($this->groups[$group])) {
|
||||
unset($this->groups[$group]);
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ final class Localization
|
|||
|
||||
if ($fileContent === false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->importLocale(\json_decode($fileContent, true));
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ final class Localization
|
|||
|
||||
if ($fileContent === false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->importLocale(\json_decode($fileContent, true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException;
|
|||
|
||||
/**
|
||||
* Cholesky decomposition
|
||||
*
|
||||
*
|
||||
* A is syymetric, positive definite then A = L*L'
|
||||
*
|
||||
* @package phpOMS\Math\Matrix
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Math\Geometry\Shape\D2\Triangle;
|
|||
|
||||
/**
|
||||
* Eigenvalue decomposition
|
||||
*
|
||||
*
|
||||
* A symmetric then A = V*D*V'
|
||||
* A not symmetric then (potentially) A = V*D*inverse(V)
|
||||
*
|
||||
|
|
@ -645,7 +645,7 @@ final class EigenvalueDecomposition
|
|||
) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
--$m;
|
||||
}
|
||||
|
||||
|
|
@ -657,7 +657,7 @@ final class EigenvalueDecomposition
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -667,7 +667,7 @@ final class EigenvalueDecomposition
|
|||
return $this->isSymmetric;
|
||||
}
|
||||
|
||||
public function getV() : Matrix
|
||||
public function getV() : Matrix
|
||||
{
|
||||
$matrix = new Matrix();
|
||||
$matrix->setMatrix($this->V);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException;
|
|||
|
||||
/**
|
||||
* LU decomposition
|
||||
*
|
||||
*
|
||||
* A(piv,:) = L*U
|
||||
*
|
||||
* @package phpOMS\Math\Matrix
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
|
||||
/**
|
||||
* Get sub matrix array.
|
||||
*
|
||||
*
|
||||
* @param int $iRow Start row
|
||||
* @param int $lRow End row
|
||||
* @param int $iCol Start col
|
||||
|
|
@ -175,7 +175,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
|
||||
/**
|
||||
* Get sub matrix array.
|
||||
*
|
||||
*
|
||||
* @param array<int> $rows Row indices
|
||||
* @param array<int> $cols Row indices
|
||||
*
|
||||
|
|
@ -203,7 +203,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
|
||||
/**
|
||||
* Get sub matrix array.
|
||||
*
|
||||
*
|
||||
* @param int $iRow Start row
|
||||
* @param int $lRow End row
|
||||
* @param array<int> $cols Row indices
|
||||
|
|
@ -231,7 +231,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
|
||||
/**
|
||||
* Get sub matrix array.
|
||||
*
|
||||
*
|
||||
* @param array<int> $rows Row indices
|
||||
* @param int $iCol Start col
|
||||
* @param int $lCol End col
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Math\Geometry\Shape\D2\Triangle;
|
|||
|
||||
/**
|
||||
* QR decomposition
|
||||
*
|
||||
*
|
||||
* For every matrix A = Q*R
|
||||
*
|
||||
* @package phpOMS\Math\Matrix
|
||||
|
|
@ -246,7 +246,7 @@ final class QRDecomposition
|
|||
|
||||
$nx = $B->getN();
|
||||
$X = $B->toArray();
|
||||
|
||||
|
||||
// Compute Y = transpose(Q)*B
|
||||
for ($k = 0; $k < $this->n; ++$k) {
|
||||
for ($j = 0; $j < $nx; ++$j) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class Evaluator
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function parseValue($value)
|
||||
private static function parseValue($value)
|
||||
{
|
||||
return !\is_string($value) ? $value : (\stripos($value, '.') === false ? (int) $value : (float) $value);
|
||||
}
|
||||
|
|
@ -112,8 +112,8 @@ class Evaluator
|
|||
return [];
|
||||
}
|
||||
|
||||
$equation = \array_filter($equation, function($n) {
|
||||
return $n !== '';
|
||||
$equation = \array_filter($equation, function($n) {
|
||||
return $n !== '';
|
||||
});
|
||||
|
||||
foreach ($equation as $i => $token) {
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class Iban implements \Serializable
|
|||
public function getCountry() : string
|
||||
{
|
||||
$country = \substr($this->iban, 0, 2);
|
||||
|
||||
|
||||
return $country === false ? '?' : $country;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Edge
|
|||
{
|
||||
/**
|
||||
* Node1.
|
||||
*
|
||||
*
|
||||
* In case of directed edges this is the from node/starting node.
|
||||
*
|
||||
* @var Node
|
||||
|
|
@ -36,7 +36,7 @@ class Edge
|
|||
|
||||
/**
|
||||
* Node2.
|
||||
*
|
||||
*
|
||||
* In case of directed edges this is the to node/end node.
|
||||
*
|
||||
* @var Node
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class Graph
|
|||
public function addNodeRelative(Node $relative, Node $node) : Graph
|
||||
{
|
||||
$this->edges[] = new Edge($relative, $node);
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Node
|
|||
{
|
||||
/**
|
||||
* Node data.
|
||||
*
|
||||
*
|
||||
* @var mixed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ class PriorityQueue implements \Countable, \Serializable
|
|||
{
|
||||
if ($this->type === PriorityMode::FIFO || $this->type === PriorityMode::LIFO) {
|
||||
$this->queue[$id]['priority'] = $priority;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ final class UriFactory
|
|||
if (\stripos($key, $identifier) === 0) {
|
||||
unset(self::$uri[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ class Ip
|
|||
{
|
||||
$split = \explode('.', $ip);
|
||||
|
||||
return ((int) $split[0] ?? 0) * (256 ** 3)
|
||||
+ ((int) $split[1] ?? 0) * (256 ** 2)
|
||||
+ ((int) $split[2] ?? 0) * (256 ** 1)
|
||||
return ((int) $split[0] ?? 0) * (256 ** 3)
|
||||
+ ((int) $split[1] ?? 0) * (256 ** 2)
|
||||
+ ((int) $split[2] ?? 0) * (256 ** 1)
|
||||
+ ((int) $split[3] ?? 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ class Phone
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public static function generatePhone(
|
||||
$isInt = true,
|
||||
$isInt = true,
|
||||
$layout = [
|
||||
'struct' => '+$1 ($2) $3-$4',
|
||||
'size' => [null, [3, 4], [3, 5], [3, 8],],],
|
||||
'size' => [null, [3, 4], [3, 5], [3, 8],],],
|
||||
$countries = null
|
||||
) {
|
||||
$numberString = $layout['struct'];
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class CronJob extends TaskAbstract
|
|||
{
|
||||
return $this->interval . ' ' . $this->command . ' # name="' . $this->id . '" ' . $this->comment;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ final class Validator extends ValidatorAbstract
|
|||
* @param array $constraints Constraints for validation
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` JOIN `b` ON `a`.`id` = `b`.`id` AND `a`.`id2` = `b`.`id2` WHERE `a`.`test` = 1;';
|
||||
self::assertEquals($sql, $query->select('a.test')->from('a')->join('b')->on('a.id', '=', 'b.id')->andOn('a.id2', '=', 'b.id2')->where('a.test', '=', 1)->toSql());
|
||||
|
||||
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` LEFT JOIN `b` ON `a`.`id` = `b`.`id` WHERE `a`.`test` = 1;';
|
||||
self::assertEquals($sql, $query->select('a.test')->from('a')->leftJoin('b')->on('a.id', '=', 'b.id')->where('a.test', '=', 1)->toSql());
|
||||
|
|
@ -242,7 +242,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` FULL JOIN `b` ON `a`.`id` = `b`.`id` WHERE `a`.`test` = 1;';
|
||||
self::assertEquals($sql, $query->select('a.test')->from('a')->fullJoin('b')->on('a.id', '=', 'b.id')->where('a.test', '=', 1)->toSql());
|
||||
|
||||
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` FULL OUTER JOIN `b` ON `a`.`id` = `b`.`id` WHERE `a`.`test` = 1;';
|
||||
self::assertEquals($sql, $query->select('a.test')->from('a')->fullOuterJoin('b')->on('a.id', '=', 'b.id')->where('a.test', '=', 1)->toSql());
|
||||
|
|
|
|||
|
|
@ -70,14 +70,14 @@ class EventManagerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue($event->detach('group'));
|
||||
self::assertEquals(0, $event->count());
|
||||
self::assertFalse($event->trigger('group'));
|
||||
|
||||
|
||||
self::assertFalse($event->detach('group'));
|
||||
}
|
||||
|
||||
public function testRemove()
|
||||
{
|
||||
$event = new EventManager();
|
||||
|
||||
|
||||
self::assertTrue($event->attach('group1', function() { return true; }, true, false));
|
||||
self::assertTrue($event->attach('group2', function() { return true; }, true, false));
|
||||
self::assertEquals(2, $event->count());
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
|||
|
||||
class CityMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
static function setUpBeforeClass()
|
||||
static function setUpBeforeClass()
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
|
|
@ -45,7 +45,7 @@ class CityMapperTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertLessThan(9, $obj->getLong());
|
||||
}
|
||||
|
||||
static function tearDownAfterClass()
|
||||
static function tearDownAfterClass()
|
||||
{
|
||||
DataMapperAbstract::setConnection($GLOBALS['dbpool']->get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
|||
|
||||
class CountryMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
static function setUpBeforeClass()
|
||||
static function setUpBeforeClass()
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
|
|
@ -43,7 +43,7 @@ class CountryMapperTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals('ISO 3166-2:DE', $obj->getSubdevision());
|
||||
}
|
||||
|
||||
static function tearDownAfterClass()
|
||||
static function tearDownAfterClass()
|
||||
{
|
||||
DataMapperAbstract::setConnection($GLOBALS['dbpool']->get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
|||
|
||||
class CurrencyMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
static function setUpBeforeClass()
|
||||
static function setUpBeforeClass()
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
|
|
@ -43,7 +43,7 @@ class CurrencyMapperTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertContains('Germany', $obj->getCountries());
|
||||
}
|
||||
|
||||
static function tearDownAfterClass()
|
||||
static function tearDownAfterClass()
|
||||
{
|
||||
DataMapperAbstract::setConnection($GLOBALS['dbpool']->get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
|||
|
||||
class IbanMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
static function setUpBeforeClass()
|
||||
static function setUpBeforeClass()
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
|
|
@ -42,7 +42,7 @@ class IbanMapperTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals('DEkk bbbb bbbb cccc cccc cc', $obj->getFields());
|
||||
}
|
||||
|
||||
static function tearDownAfterClass()
|
||||
static function tearDownAfterClass()
|
||||
{
|
||||
DataMapperAbstract::setConnection($GLOBALS['dbpool']->get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
|||
|
||||
class LanguageMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
static function setUpBeforeClass()
|
||||
static function setUpBeforeClass()
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
|
|
@ -43,7 +43,7 @@ class LanguageMapperTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals('ger', $obj->getCode3());
|
||||
}
|
||||
|
||||
static function tearDownAfterClass()
|
||||
static function tearDownAfterClass()
|
||||
{
|
||||
DataMapperAbstract::setConnection($GLOBALS['dbpool']->get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,12 +73,12 @@ class ErrorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testMASE()
|
||||
{
|
||||
$observed = [
|
||||
-2.9, -2.83, -0.95, -0.88, 1.21, -1.67, 0.83, -0.27, 1.36,
|
||||
-2.9, -2.83, -0.95, -0.88, 1.21, -1.67, 0.83, -0.27, 1.36,
|
||||
-0.34, 0.48, -2.83, -0.95, -0.88, 1.21, -1.67, -2.99, 1.24, 0.64
|
||||
];
|
||||
|
||||
|
||||
$forecast = [
|
||||
-2.95, -2.7, -1.00, -0.68, 1.50, -1.00, 0.90, -0.37, 1.26,
|
||||
-2.95, -2.7, -1.00, -0.68, 1.50, -1.00, 0.90, -0.37, 1.26,
|
||||
-0.54, 0.58, -2.13, -0.75, -0.89, 1.25, -1.65, -3.20, 1.29, 0.60
|
||||
];
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ class ErrorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testScaledError()
|
||||
{
|
||||
self::assertEquals(
|
||||
[Error::getScaledError(Error::getForecastError(1000, 700), [1000, 800])],
|
||||
[Error::getScaledError(Error::getForecastError(1000, 700), [1000, 800])],
|
||||
Error::getScaledErrorArray([Error::getForecastError(1000, 700)], [1000, 800])
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ class ModuleFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
$instance = NullModule::class;
|
||||
if (\file_exists(__DIR__ . '/../../../Modules')) {
|
||||
$instance = \Modules\Admin\Controller\ApiController::class;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
self::assertInstanceOf($instance, ModuleFactory::getInstance('Admin', new class extends ApplicationAbstract { protected $appName = 'Api'; }));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class NodeTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$node = new Node(1);
|
||||
self::assertEquals(1, $node->getData());
|
||||
|
||||
|
||||
$node->setData(false);
|
||||
self::assertEquals(false, $node->getData());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class PriorityQueueTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(['data' => 'a', 'priority' => -2], $queue->get($id1));
|
||||
self::assertEquals(['data' => 'a', 'priority' => -2], $queue->pop());
|
||||
self::assertEquals(2, $queue->count());
|
||||
|
||||
|
||||
self::assertTrue($queue->delete($id3));
|
||||
self::assertFalse($queue->delete($id3));
|
||||
self::assertEquals(1, $queue->count());
|
||||
|
|
@ -124,7 +124,7 @@ class PriorityQueueTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(['data' => 'c', 'priority' => -1], $queue->get($id3));
|
||||
self::assertEquals(['data' => 'c', 'priority' => -1], $queue->pop());
|
||||
self::assertEquals(2, $queue->count());
|
||||
|
||||
|
||||
self::assertTrue($queue->delete($id1));
|
||||
self::assertFalse($queue->delete($id1));
|
||||
self::assertEquals(1, $queue->count());
|
||||
|
|
@ -162,7 +162,7 @@ class PriorityQueueTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(['data' => 'a', 'priority' => 3], $queue->get($id1));
|
||||
self::assertEquals(['data' => 'a', 'priority' => 3], $queue->pop());
|
||||
self::assertEquals(2, $queue->count());
|
||||
|
||||
|
||||
self::assertTrue($queue->delete($id2));
|
||||
self::assertFalse($queue->delete($id2));
|
||||
self::assertEquals(1, $queue->count());
|
||||
|
|
@ -200,7 +200,7 @@ class PriorityQueueTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(['data' => 'a', 'priority' => 1], $queue->get($id1));
|
||||
self::assertEquals(['data' => 'a', 'priority' => 1], $queue->pop());
|
||||
self::assertEquals(2, $queue->count());
|
||||
|
||||
|
||||
self::assertTrue($queue->delete($id2));
|
||||
self::assertFalse($queue->delete($id2));
|
||||
self::assertEquals(1, $queue->count());
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ class ArrayParserTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
public function testParser()
|
||||
{
|
||||
$serializable = new class implements \Serializable {
|
||||
public function serialize() { return 2; }
|
||||
$serializable = new class implements \Serializable {
|
||||
public function serialize() { return 2; }
|
||||
public function unserialize($raw) {}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ class TaskSchedulerTest extends \PHPUnit\Framework\TestCase
|
|||
$cron = new TaskScheduler();
|
||||
|
||||
self::assertEquals([], $cron->getAllByName('testCronJob', false));
|
||||
|
||||
|
||||
$job = new Schedule('testCronJob', 'testFile', '0 0 1 1 *');
|
||||
$cron->create($job);
|
||||
|
||||
|
||||
self::assertTrue(!empty($cron->getAllByName('testCronJob', false)));
|
||||
if (!empty($cron->getAllByName('testCronJob', false))) {
|
||||
self::assertEquals('testFile', $cron->getAllByName('testCronJob', false)[0]->getCommand());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user