diff --git a/DataStorage/Database/Mapper/DataMapperAbstract.php b/DataStorage/Database/Mapper/DataMapperAbstract.php index 31f7a5f77..9aede4b9a 100644 --- a/DataStorage/Database/Mapper/DataMapperAbstract.php +++ b/DataStorage/Database/Mapper/DataMapperAbstract.php @@ -402,6 +402,8 @@ abstract class DataMapperAbstract return $value === null ? null : $value->format($this->mapper::$datetimeFormat); } elseif ($type === 'Json') { return (string) \json_encode($value); + } elseif ($type === 'compress') { + return (string) \gzdeflate($value); } elseif ($type === 'Serializable') { return $value->serialize(); } elseif (\is_object($value) && \method_exists($value, 'getId')) { diff --git a/DataStorage/Database/Mapper/DataMapperFactory.php b/DataStorage/Database/Mapper/DataMapperFactory.php index b7725c186..6e31d3ce3 100644 --- a/DataStorage/Database/Mapper/DataMapperFactory.php +++ b/DataStorage/Database/Mapper/DataMapperFactory.php @@ -16,6 +16,8 @@ namespace phpOMS\DataStorage\Database\Mapper; use phpOMS\DataStorage\Database\Connection\ConnectionAbstract; use phpOMS\DataStorage\Database\Query\Builder; +use phpOMS\DataStorage\Database\Query\OrderType; +use phpOMS\DataStorage\Database\Query\Where; /** * Mapper factory. @@ -477,4 +479,223 @@ class DataMapperFactory return null; } + + /** + * Find data. + * + * @param string $search Search string + * @param DataMapperAbstract $mapper Mapper to populate + * @param int $id Pivot element id + * @param string $secondaryId Secondary id which becomes necessary for sorted results. + * @param string $type Page type (p = get previous elements, n = get next elements) + * @param int $pageLimit Limit result set + * @param string $sortBy Model member name to sort by + * @param string $sortOrder Sort order + * @param array $searchFields Fields to search in. ([] = all) @todo: maybe change to all which have autocomplete = true defined? + * @param array $filters Additional search filters applied ['type', 'value1', 'logic1', 'value2', 'logic2'] + * + * @return array{hasPrevious:bool, hasNext:bool, data:object[]} + * + * @since 1.0.0 + */ + public static function find( + string $search = null, + DataMapperAbstract $mapper = null, + int $id = 0, + string $secondaryId = '', + string $type = null, + int $pageLimit = 25, + string $sortBy = null, + string $sortOrder = OrderType::DESC, + array $searchFields = [], + array $filters = [] + ) : array { + $mapper ??= static::getAll(); + $sortOrder = \strtoupper($sortOrder); + + $data = []; + + $type = $id === 0 ? null : $type; + $hasPrevious = false; + $hasNext = false; + + $primarySortField = static::COLUMNS[static::PRIMARYFIELD]['internal']; + + $sortBy = empty($sortBy) || static::getColumnByMember($sortBy) === null ? $primarySortField : $sortBy; + + $sortById = $sortBy === $primarySortField; + $secondaryId = $sortById ? $id : $secondaryId; + + foreach ($filters as $key => $filter) { + $mapper->where($key, '%' . $filter['value1'] . '%', $filter['logic1'] ?? 'like'); + + if (!empty($filter['value2'])) { + $mapper->where($key, '%' . $filter['value2'] . '%', $filter['logic2'] ?? 'like'); + } + } + + if (!empty($search)) { + $where = new Where(static::$db); + $counter = 0; + + if (empty($searchFields)) { + foreach (static::COLUMNS as $column) { + $searchFields[] = $column['internal']; + } + } + + foreach ($searchFields as $searchField) { + if (($column = static::getColumnByMember($searchField)) === null) { + continue; + } + + $where->where($column, 'like', '%' . $search . '%', 'OR'); + ++$counter; + } + + if ($counter > 0) { + $mapper->where('', $where); + } + } + + // @todo: how to handle columns which are NOT members (columns which are manipulated) + // Maybe pass callback array which can handle these cases? + + if ($type === 'p') { + $cloned = clone $mapper; + $mapper->sort( + $sortBy, + $sortOrder === OrderType::DESC ? OrderType::ASC : OrderType::DESC + ) + ->where($sortBy, $secondaryId, $sortOrder === OrderType::DESC ? '>=' : '<=') + ->limit($pageLimit + 2); + + if (!$sortById) { + $where = new Where(static::$db); + $where->where(static::PRIMARYFIELD, '>=', $id) + ->orWhere( + static::getColumnByMember($sortBy), + $sortOrder === OrderType::DESC ? '>' : '<', + $secondaryId + ); + + $mapper->where('', $where) + ->sort($primarySortField, OrderType::ASC); + } + + $data = $mapper->execute(); + + if (($count = \count($data)) < 2) { + $cloned->sort($sortBy, $sortOrder) + ->limit($pageLimit + 1); + + if (!$sortById) { + $where = new Where(static::$db); + $where->where(static::PRIMARYFIELD, '<=', $id) + ->orWhere( + static::getColumnByMember($sortBy), + $sortOrder === OrderType::DESC ? '<' : '>', + $secondaryId + ); + + $cloned->where('', $where) + ->sort($primarySortField, OrderType::DESC); + } + + $data = $mapper->execute(); + + $hasNext = $count > $pageLimit; + if ($hasNext) { + \array_pop($data); + --$count; + } + } else { + if (\reset($data)->getId() === $id) { + \array_shift($data); + $hasNext = true; + --$count; + } + + if ($count > $pageLimit) { + if (!$hasNext) { // @todo: can be maybe removed? + \array_pop($data); + $hasNext = true; + --$count; + } + + if ($count > $pageLimit) { + $hasPrevious = true; + \array_pop($data); + } + } + + $data = \array_reverse($data); + } + } elseif ($type === 'n') { + $mapper->sort($sortBy, $sortOrder) + ->where($sortBy, $secondaryId, $sortOrder === OrderType::DESC ? '<=' : '>=') + ->limit($pageLimit + 2); + + if (!$sortById) { + $where = new Where(static::$db); + $where->where(static::PRIMARYFIELD, '<=', $id) + ->orWhere( + static::getColumnByMember($sortBy), + $sortOrder === OrderType::DESC ? '<' : '>', + $secondaryId + ); + + $mapper->where('', $where) + ->sort($primarySortField, OrderType::DESC); + } + + $data = $mapper->execute(); + $count = \count($data); + + if ($count < 1) { + return [ + 'hasPrevious' => false, + 'hasNext' => false, + 'data' => [], + ]; + } + + if (\reset($data)->getId() === $id) { + \array_shift($data); + $hasPrevious = true; + --$count; + } + + if ($count > $pageLimit) { + \array_pop($data); + $hasNext = true; + --$count; + } + + if ($count > $pageLimit) { + \array_pop($data); + --$count; + } + } else { + $mapper = $mapper->sort($sortBy, $sortOrder) + ->limit($pageLimit + 1); + + if (!$sortById) { + $mapper = $mapper->sort($primarySortField, OrderType::DESC); + } + + $data = $mapper->execute(); + + $hasNext = ($count = \count($data)) > $pageLimit; + if ($hasNext) { + \array_pop($data); + } + } + + return [ + 'hasPrevious' => $hasPrevious, + 'hasNext' => $hasNext, + 'data' => $data, + ]; + } } diff --git a/DataStorage/Database/Mapper/ReadMapper.php b/DataStorage/Database/Mapper/ReadMapper.php index c0ef5eddc..e411ea5c3 100644 --- a/DataStorage/Database/Mapper/ReadMapper.php +++ b/DataStorage/Database/Mapper/ReadMapper.php @@ -110,20 +110,6 @@ final class ReadMapper extends DataMapperAbstract return $this; } - /** - * Create find mapper - * - * @return self - * - * @since 1.0.0 - */ - public function find() : self - { - $this->type = MapperType::FIND; - - return $this; - } - /** * Define the columns to load * @@ -589,7 +575,13 @@ final class ReadMapper extends DataMapperAbstract } $refProp->setValue($obj, $value); - } elseif (\in_array($def['type'], ['string', 'int', 'float', 'bool'])) { + } elseif (\in_array($def['type'], ['string', 'compress', 'int', 'float', 'bool'])) { + if ($value !== null && $def['type'] === 'compress') { + $def['type'] = 'string'; + + $value = \gzinflate($value); + } + if ($value !== null || $refProp->getValue($obj) !== null) { \settype($value, $def['type']); } diff --git a/Math/Geometry/Shape/D2/Quadrilateral.php b/Math/Geometry/Shape/D2/Quadrilateral.php index b0b07240e..d3358e331 100644 --- a/Math/Geometry/Shape/D2/Quadrilateral.php +++ b/Math/Geometry/Shape/D2/Quadrilateral.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Geometry\Shape\D2; /** diff --git a/Math/Geometry/Shape/D3/Prism.php b/Math/Geometry/Shape/D3/Prism.php index 0be332cf0..bc3b69ea6 100755 --- a/Math/Geometry/Shape/D3/Prism.php +++ b/Math/Geometry/Shape/D3/Prism.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D2\Polygon; diff --git a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php index 55443e341..91153d16e 100755 --- a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php +++ b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Statistic\Forecast\Regression; use phpOMS\Math\Matrix\Matrix; diff --git a/Math/Stochastic/Distribution/BetaDistribution.php b/Math/Stochastic/Distribution/BetaDistribution.php index bd87e33fe..85bd946ba 100644 --- a/Math/Stochastic/Distribution/BetaDistribution.php +++ b/Math/Stochastic/Distribution/BetaDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; use phpOMS\Math\Functions\Beta; diff --git a/Math/Stochastic/Distribution/FDistribution.php b/Math/Stochastic/Distribution/FDistribution.php index def803323..ce1bd0248 100644 --- a/Math/Stochastic/Distribution/FDistribution.php +++ b/Math/Stochastic/Distribution/FDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; use phpOMS\Math\Functions\Beta; diff --git a/Math/Stochastic/Distribution/GammaDistribution.php b/Math/Stochastic/Distribution/GammaDistribution.php index 802ecb954..258a26fcb 100644 --- a/Math/Stochastic/Distribution/GammaDistribution.php +++ b/Math/Stochastic/Distribution/GammaDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; use phpOMS\Math\Functions\Gamma; diff --git a/Math/Stochastic/Distribution/HypergeometricDistribution.php b/Math/Stochastic/Distribution/HypergeometricDistribution.php index 9fa38dea0..7f8546f82 100644 --- a/Math/Stochastic/Distribution/HypergeometricDistribution.php +++ b/Math/Stochastic/Distribution/HypergeometricDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; use phpOMS\Math\Functions\Functions; diff --git a/Math/Stochastic/Distribution/LogDistribution.php b/Math/Stochastic/Distribution/LogDistribution.php index dc9d58927..e52ac32b1 100644 --- a/Math/Stochastic/Distribution/LogDistribution.php +++ b/Math/Stochastic/Distribution/LogDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; use phpOMS\Math\Functions\Beta; diff --git a/Math/Stochastic/Distribution/LogNormalDistribution.php b/Math/Stochastic/Distribution/LogNormalDistribution.php index 93bff38f9..cc9a5ff04 100644 --- a/Math/Stochastic/Distribution/LogNormalDistribution.php +++ b/Math/Stochastic/Distribution/LogNormalDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; use phpOMS\Math\Functions\Functions; diff --git a/Math/Stochastic/Distribution/LogisticDistribution.php b/Math/Stochastic/Distribution/LogisticDistribution.php index dde1f4424..c65841302 100644 --- a/Math/Stochastic/Distribution/LogisticDistribution.php +++ b/Math/Stochastic/Distribution/LogisticDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; /** diff --git a/Math/Stochastic/Distribution/ParetoDistribution.php b/Math/Stochastic/Distribution/ParetoDistribution.php index e70930905..2f54ed1c2 100644 --- a/Math/Stochastic/Distribution/ParetoDistribution.php +++ b/Math/Stochastic/Distribution/ParetoDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; /** diff --git a/Math/Stochastic/Distribution/WeibullDistribution.php b/Math/Stochastic/Distribution/WeibullDistribution.php index dc854cb21..5cfd21a0d 100644 --- a/Math/Stochastic/Distribution/WeibullDistribution.php +++ b/Math/Stochastic/Distribution/WeibullDistribution.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic\Distribution; use phpOMS\Math\Functions\Gamma; diff --git a/Math/Stochastic/NaiveBayesClassifier.php b/Math/Stochastic/NaiveBayesClassifier.php index ac7722c9d..de456e290 100644 --- a/Math/Stochastic/NaiveBayesClassifier.php +++ b/Math/Stochastic/NaiveBayesClassifier.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Math\Stochastic; use phpOMS\Math\Statistic\Average; diff --git a/Message/Http/HttpRequest.php b/Message/Http/HttpRequest.php index 192418c4d..3e0fb2f35 100644 --- a/Message/Http/HttpRequest.php +++ b/Message/Http/HttpRequest.php @@ -132,9 +132,29 @@ final class HttpRequest extends RequestAbstract if (\stripos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) { // @codeCoverageIgnoreStart // Tested but coverage doesn't show up - $input = \file_get_contents('php://input'); + $stream = \fopen('php://input', 'r'); + if ($stream === false) { + return; + } - if ($input === false || empty($input) || $input === 'null') { + $input = ''; + $size = 0; + + while (($lineRaw = \fgets($stream, 1024)) !== false) { + // Limit json data to 1MB + if ($size > 1000000) { + \fclose($stream); + + return; + } + + $input += $lineRaw; + $size += \strlen($lineRaw); + } + + \fclose($stream); + + if (empty($input)) { return; } @@ -148,9 +168,29 @@ final class HttpRequest extends RequestAbstract } elseif (\stripos($_SERVER['CONTENT_TYPE'], 'application/x-www-form-urlencoded') !== false) { // @codeCoverageIgnoreStart // Tested but coverage doesn't show up - $content = \file_get_contents('php://input'); + $stream = \fopen('php://input', 'r'); + if ($stream === false) { + return; + } - if ($content === false || empty($content)) { + $content = ''; + $size = 0; + + while (($lineRaw = \fgets($stream, 1024)) !== false) { + // Limit json data to 1MB + if ($size > 1000000) { + \fclose($stream); + + return; + } + + $content += $lineRaw; + $size += \strlen($lineRaw); + } + + \fclose($stream); + + if (empty($content)) { return; } diff --git a/Message/Http/RequestStatusCode.php b/Message/Http/RequestStatusCode.php index 71b5dc681..7f077a356 100755 --- a/Message/Http/RequestStatusCode.php +++ b/Message/Http/RequestStatusCode.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Message\Http; use phpOMS\Stdlib\Base\Enum; diff --git a/Message/Mail/Imap.php b/Message/Mail/Imap.php index 0918754b6..7de3555ca 100644 --- a/Message/Mail/Imap.php +++ b/Message/Mail/Imap.php @@ -226,6 +226,45 @@ class Imap implements MailBoxInterface return \imap_num_recent($this->mailbox); } + /** + * {@inheritdoc} + */ + public function countUnseen(string $box) : int + { + if ($this->box !== $box) { + \imap_reopen($this->mailbox, '{' . $this->host . ':' . $this->port . $this->flags . '}' . $box); + $this->box = $box; + } + + return \count(\imap_search($this->mailbox, 'UNSEEN')); + } + + /** + * {@inheritdoc} + */ + public function search( + string $box, + string $subject = '', + string $body = '', + string $to = '', + string $cc = '', + string $from = '', + string $bcc = '', + \DateTime $before = null, + \DateTime $since = null, + \DateTime $on = null, + bool $deleted = false, + bool $flagged = false + ) : array + { + if ($this->box !== $box) { + \imap_reopen($this->mailbox, '{' . $this->host . ':' . $this->port . $this->flags . '}' . $box); + $this->box = $box; + } + + return []; + } + /** * Copy message to another mailbox * diff --git a/Message/Mail/MailBoxInterface.php b/Message/Mail/MailBoxInterface.php index d431e30b8..fe8f70c39 100755 --- a/Message/Mail/MailBoxInterface.php +++ b/Message/Mail/MailBoxInterface.php @@ -64,6 +64,52 @@ interface MailBoxInterface */ public function countRecent(string $box) : int; + /** + * Count unseen mail in mailbox + * + * @param string $box Box to count the mail in + * + * @return int + * + * @since 1.0.0 + */ + public function countUnseen(string $box) : int; + + /** + * Get messages by search criterium + * + * @param string $box Box to count the mail in + * @param string $subject Subject + * @param string $body Body + * @param string $to To + * @param string $cc CC + * @param string $from From + * @param string $bcc BCC + * @param \DateTime $before Message before + * @param \DateTime $sicne Message since + * @param \DateTime $on Message on date + * @param bool $deleted Message is deleted + * @param bool $flagged Message is flagged (false = any message) + * + * @return array + * + * @since 1.0.0 + */ + public function search( + string $box, + string $subject = '', + string $body = '', + string $to = '', + string $cc = '', + string $from = '', + string $bcc = '', + \DateTime $before = null, + \DateTime $since = null, + \DateTime $on = null, + bool $deleted = false, + bool $flagged = false + ) : array; + /** * Get all message headers from a mailbox * diff --git a/Message/Mail/Pop3.php b/Message/Mail/Pop3.php index 2bbf3872b..73a596005 100644 --- a/Message/Mail/Pop3.php +++ b/Message/Mail/Pop3.php @@ -226,6 +226,45 @@ class Pop3 implements MailBoxInterface return \imap_num_recent($this->mailbox); } + /** + * {@inheritdoc} + */ + public function countUnseen(string $box) : int + { + if ($this->box !== $box) { + \imap_reopen($this->mailbox, '{' . $this->host . ':' . $this->port . $this->flags . '}' . $box); + $this->box = $box; + } + + return \count(\imap_search($this->mailbox, 'UNSEEN')); + } + + /** + * {@inheritdoc} + */ + public function search( + string $box, + string $subject = '', + string $body = '', + string $to = '', + string $cc = '', + string $from = '', + string $bcc = '', + \DateTime $before = null, + \DateTime $since = null, + \DateTime $on = null, + bool $deleted = false, + bool $flagged = false + ) : array + { + if ($this->box !== $box) { + \imap_reopen($this->mailbox, '{' . $this->host . ':' . $this->port . $this->flags . '}' . $box); + $this->box = $box; + } + + return []; + } + /** * Copy message to another mailbox * diff --git a/Module/ModuleStatus.php b/Module/ModuleStatus.php index 742d5e9e9..a51cc7314 100755 --- a/Module/ModuleStatus.php +++ b/Module/ModuleStatus.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\Module; use phpOMS\Stdlib\Base\Enum; diff --git a/README.md b/README.md index b7cc16177..3dfb2e3a9 100755 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ General updates can be found in our info section at https://karaka.app/info and ## Tech stack * Language: php, js, c++, html, css, markdown, shell script -* Database: Maria/MySQL, PostgreSQL, MSSQL, SQLite +* Database: Maria/MySQL, PostgreSQL, MSSQL/SQLSrv, SQLite * Webserver: apache2, nginx * Cache: Redis, Memcached diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index be6c1729c..62340d58c 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -286,7 +286,7 @@ final class UriFactory } $parsed = \preg_replace_callback( - '(\{[\/#\?%@\.\$][a-zA-Z0-9\-]*\})', + '(\{[\/#\?%@\.\$][a-zA-Z0-9_\-]*\})', function ($match) use ($toMatch) : string { $match = \substr($match[0], 1, \strlen($match[0]) - 2); diff --git a/tests/Business/Sales/MarketShareEstimationTest.php b/tests/Business/Sales/MarketShareEstimationTest.php index f1a3b1d22..6d3132064 100644 --- a/tests/Business/Sales/MarketShareEstimationTest.php +++ b/tests/Business/Sales/MarketShareEstimationTest.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\Business\Sales; use phpOMS\Business\Sales\MarketShareEstimation; diff --git a/tests/DataStorage/Database/Connection/PostgresConnectionTest.php b/tests/DataStorage/Database/Connection/PostgresConnectionTest.php index 19e79a28c..5078f9b85 100644 --- a/tests/DataStorage/Database/Connection/PostgresConnectionTest.php +++ b/tests/DataStorage/Database/Connection/PostgresConnectionTest.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\DataStorage\Database\Connection; use phpOMS\DataStorage\Database\Connection\PostgresConnection; diff --git a/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php b/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php index a0607f6e1..37620dbaa 100644 --- a/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php +++ b/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\DataStorage\Database\Connection; use phpOMS\DataStorage\Database\Connection\SQLiteConnection; diff --git a/tests/DataStorage/Database/DataMapperAbstractTest.php b/tests/DataStorage/Database/DataMapperAbstractTest.php index 2a842108c..c4c9b5024 100644 --- a/tests/DataStorage/Database/DataMapperAbstractTest.php +++ b/tests/DataStorage/Database/DataMapperAbstractTest.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\DataStorage\Database; use phpOMS\DataStorage\Database\Query\OrderType; diff --git a/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php b/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php index 90707ed09..3e1474fa2 100644 --- a/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\DataStorage\Database\Schema\Grammar; use phpOMS\DataStorage\Database\Schema\Grammar\SQLiteGrammar; diff --git a/tests/DataStorage/Database/SchemaMapperTest.php b/tests/DataStorage/Database/SchemaMapperTest.php index ac69495d9..63abf0a70 100644 --- a/tests/DataStorage/Database/SchemaMapperTest.php +++ b/tests/DataStorage/Database/SchemaMapperTest.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\DataStorage\Database; use phpOMS\DataStorage\Database\SchemaMapper; diff --git a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php index 6ad80c3d9..1520115b7 100755 --- a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\DataStorage\Database\TestModel; use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; diff --git a/tests/Dispatcher/TestController.php b/tests/Dispatcher/TestController.php index 0bfbb8ec5..a18976afd 100755 --- a/tests/Dispatcher/TestController.php +++ b/tests/Dispatcher/TestController.php @@ -11,6 +11,7 @@ * @link https://karaka.app */ declare(strict_types=1); + namespace phpOMS\tests\Dispatcher; class TestController