mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
fix languages 3
This commit is contained in:
parent
6cdf51c207
commit
ca4ad775d2
|
|
@ -43,7 +43,7 @@ abstract class SessionAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public abstract function get(string $key) : mixed;
|
abstract public function get(string $key) : mixed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store session value by key.
|
* Store session value by key.
|
||||||
|
|
@ -56,7 +56,7 @@ abstract class SessionAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public abstract function set(string $key, mixed $value, bool $overwrite = false) : bool;
|
abstract public function set(string $key, mixed $value, bool $overwrite = false) : bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove value from session by key.
|
* Remove value from session by key.
|
||||||
|
|
@ -67,7 +67,7 @@ abstract class SessionAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public abstract function remove(string $key) : bool;
|
abstract public function remove(string $key) : bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save session.
|
* Save session.
|
||||||
|
|
@ -76,14 +76,14 @@ abstract class SessionAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public abstract function save() : bool;
|
abstract public function save() : bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public abstract function getSID() : string;
|
abstract public function getSID() : string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sid Session id
|
* @param string $sid Session id
|
||||||
|
|
@ -92,7 +92,7 @@ abstract class SessionAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public abstract function setSID(string $sid) : void;
|
abstract public function setSID(string $sid) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lock session from further adjustments.
|
* Lock session from further adjustments.
|
||||||
|
|
@ -101,5 +101,5 @@ abstract class SessionAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public abstract function lock() : void;
|
abstract public function lock() : void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ final class GrahamScan
|
||||||
}
|
}
|
||||||
|
|
||||||
$min = 1;
|
$min = 1;
|
||||||
|
$points = \array_merge([['x' => 0.0, 'y' => 0.0]], $points);
|
||||||
|
|
||||||
for ($i = 2; $i < $n; ++$i) {
|
for ($i = 2; $i < $n; ++$i) {
|
||||||
if ($points[$i]['y'] < $points[$min]['y']
|
if ($points[$i]['y'] < $points[$min]['y']
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ final class SpreadsheetDatabaseMapper implements IODatabaseMapper
|
||||||
$sheet->setActiveSheetIndex($i);
|
$sheet->setActiveSheetIndex($i);
|
||||||
|
|
||||||
$workSheet = $sheet->getSheet($i);
|
$workSheet = $sheet->getSheet($i);
|
||||||
$table = \strtr(empty($table) ? $workSheet->getTitle() : $table, ' ', '_');
|
$tableName = \strtr(empty($table) ? $workSheet->getTitle() : $table, ' ', '_');
|
||||||
$titles = [];
|
$titles = [];
|
||||||
|
|
||||||
// get column titles
|
// get column titles
|
||||||
|
|
@ -172,7 +172,7 @@ final class SpreadsheetDatabaseMapper implements IODatabaseMapper
|
||||||
|
|
||||||
// insert data
|
// insert data
|
||||||
$query = new Builder($this->con);
|
$query = new Builder($this->con);
|
||||||
$query->insert(...$titles)->into($table);
|
$query->insert(...$titles)->into($tableName);
|
||||||
|
|
||||||
while ($hasData = !empty($workSheet->getCell('A' . $line)->getCalculatedValue())) {
|
while ($hasData = !empty($workSheet->getCell('A' . $line)->getCalculatedValue())) {
|
||||||
$cells = [];
|
$cells = [];
|
||||||
|
|
@ -285,7 +285,7 @@ final class SpreadsheetDatabaseMapper implements IODatabaseMapper
|
||||||
$sheet->setActiveSheetIndex($i);
|
$sheet->setActiveSheetIndex($i);
|
||||||
|
|
||||||
$workSheet = $sheet->getSheet($i);
|
$workSheet = $sheet->getSheet($i);
|
||||||
$table = \strtr(empty($table) ? $workSheet->getTitle() : $table, ' ', '_');
|
$tableName = \strtr(empty($table) ? $workSheet->getTitle() : $table, ' ', '_');
|
||||||
$titles = [];
|
$titles = [];
|
||||||
|
|
||||||
// get column titles
|
// get column titles
|
||||||
|
|
@ -313,7 +313,7 @@ final class SpreadsheetDatabaseMapper implements IODatabaseMapper
|
||||||
$line = 2;
|
$line = 2;
|
||||||
while (!empty($workSheet->getCell('A' . $line)->getCalculatedValue())) {
|
while (!empty($workSheet->getCell('A' . $line)->getCalculatedValue())) {
|
||||||
$query = new Builder($this->con);
|
$query = new Builder($this->con);
|
||||||
$query->update($table);
|
$query->update($tableName);
|
||||||
|
|
||||||
for ($j = 2; $j <= $columns; ++$j) {
|
for ($j = 2; $j <= $columns; ++$j) {
|
||||||
$query->sets((string) $titles[$j - 2], $workSheet->getCell(StringUtils::intToAlphabet($j) . $line)->getCalculatedValue());
|
$query->sets((string) $titles[$j - 2], $workSheet->getCell(StringUtils::intToAlphabet($j) . $line)->getCalculatedValue());
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ abstract class TaskAbstract
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param string $name Id/name of the task (on linux the same as the executable script)
|
* @param string $name Id/name of the task (on Linux the same as the executable script)
|
||||||
* @param string $cmd Command to create the task
|
* @param string $cmd Command to create the task
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -251,7 +251,7 @@ abstract class TaskAbstract
|
||||||
/**
|
/**
|
||||||
* Create task based on job data
|
* Create task based on job data
|
||||||
*
|
*
|
||||||
* @param string[] $jobData Raw job data
|
* @param array<string|null> $jobData Raw job data
|
||||||
*
|
*
|
||||||
* @return TaskAbstract
|
* @return TaskAbstract
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\tests\Math\Geometry\ConvexHull;
|
namespace phpOMS\tests\Math\Geometry\ConvexHull;
|
||||||
|
|
||||||
|
include_once __DIR__ . '/../../../Autoloader.php';
|
||||||
|
|
||||||
use phpOMS\Math\Geometry\ConvexHull\GrahamScan;
|
use phpOMS\Math\Geometry\ConvexHull\GrahamScan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\tests\Utils\IO\Spreadsheet;
|
namespace phpOMS\tests\Utils\IO\Spreadsheet;
|
||||||
|
|
||||||
|
include_once __DIR__ . '/../../../Autoloader.php';
|
||||||
|
|
||||||
use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
||||||
use phpOMS\DataStorage\Database\Query\Builder;
|
use phpOMS\DataStorage\Database\Query\Builder;
|
||||||
use phpOMS\tests\Autoloader;
|
use phpOMS\tests\Autoloader;
|
||||||
|
|
@ -73,10 +75,11 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testInsertOds() : void
|
public function testInsertOds() : void
|
||||||
{
|
{
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.ods', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.ods');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
||||||
self::assertEquals(
|
self::assertEquals(
|
||||||
[
|
[
|
||||||
['id' => 1, 'int' => 2, 'decimal' => 2.0, 'bool' => 1, 'varchar' => 'Line 1', 'datetime' => '43631'],
|
['id' => 1, 'int' => 2, 'decimal' => 2.0, 'bool' => 1, 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||||
|
|
@ -105,7 +108,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testInsertXls() : void
|
public function testInsertXls() : void
|
||||||
{
|
{
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.xls', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.xls');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -137,7 +140,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testInsertXlsx() : void
|
public function testInsertXlsx() : void
|
||||||
{
|
{
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.xlsx', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.xlsx');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -169,7 +172,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testUpdateOds() : void
|
public function testUpdateOds() : void
|
||||||
{
|
{
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.ods', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.ods');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -196,7 +199,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->update(__DIR__ . '/update.ods', 'insert_1');
|
$mapper->update(__DIR__ . '/update.ods');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -228,7 +231,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testUpdateXls() : void
|
public function testUpdateXls() : void
|
||||||
{
|
{
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.xls', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.xls');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -255,7 +258,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->update(__DIR__ . '/update.xls', 'insert_1');
|
$mapper->update(__DIR__ . '/update.xls');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -287,7 +290,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testUpdateXlsx() : void
|
public function testUpdateXlsx() : void
|
||||||
{
|
{
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.xlsx', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.xlsx');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -314,7 +317,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->update(__DIR__ . '/update.xlsx', 'insert_1');
|
$mapper->update(__DIR__ . '/update.xlsx');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -350,7 +353,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.ods', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.ods');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -399,7 +402,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.xls', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.xls');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
@ -448,7 +451,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
$mapper = new SpreadsheetDatabaseMapper($this->sqlite);
|
||||||
$mapper->import(__DIR__ . '/insert.xlsx', 'insert_1');
|
$mapper->import(__DIR__ . '/insert.xlsx');
|
||||||
|
|
||||||
$builder = new Builder($this->sqlite, true);
|
$builder = new Builder($this->sqlite, true);
|
||||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
$data = $builder->select('insert_1.*')->from('insert_1')->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user