diff --git a/DataStorage/Database/GrammarAbstract.php b/DataStorage/Database/GrammarAbstract.php index 3e2d050c3..6bb103cb8 100755 --- a/DataStorage/Database/GrammarAbstract.php +++ b/DataStorage/Database/GrammarAbstract.php @@ -15,10 +15,8 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database; use phpOMS\Contract\SerializableInterface; -use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Column; use phpOMS\DataStorage\Database\Query\Parameter; -use phpOMS\DataStorage\Database\Query\QueryType; /** * Grammar. @@ -139,6 +137,17 @@ abstract class GrammarAbstract return \substr($queryString, 0, -1) . ';'; } + /** + * Compile post querys. + * + * These are queries, which should be run after the main query (e.g. table alters, trigger definitions etc.) + * + * @param BuilderAbstract $query Builder + * + * @return string[] + * + * @since 1.0.0 + */ public function compilePostQuerys(BuilderAbstract $query) : array { return []; @@ -249,7 +258,7 @@ abstract class GrammarAbstract * Compile value. * * @param BuilderAbstract $query Query builder - * @param mixed $value Value + * @param mixed $value Value * * @return string returns a string representation of the value * diff --git a/DataStorage/Database/Schema/Grammar/Grammar.php b/DataStorage/Database/Schema/Grammar/Grammar.php index e8af34ab1..e0b28ec66 100755 --- a/DataStorage/Database/Schema/Grammar/Grammar.php +++ b/DataStorage/Database/Schema/Grammar/Grammar.php @@ -104,21 +104,60 @@ class Grammar extends GrammarAbstract return $sql; } + /** + * Compile the select tables. + * + * @param SchemaBuilder $query Query + * @param array $tables Tables + * + * @return string + * + * @since 1.0.0 + */ protected function compileSelectTables(SchemaBuilder $query, array $tables) : string { return ''; } + /** + * Compile the select fields from table. + * + * @param SchemaBuilder $query Query + * @param array $table Table + * + * @return string + * + * @since 1.0.0 + */ protected function compileSelectFields(SchemaBuilder $query, string $table) : string { return ''; } + /** + * Compile the create fields. + * + * @param SchemaBuilder $query Query + * @param array $fields Fields + * + * @return string + * + * @since 1.0.0 + */ protected function compileCreateFields(SchemaBuilder $query, array $fields) : string { return ''; } + /** + * Compile the select tables. + * + * @param SchemaBuilder $query Query + * + * @return string + * + * @since 1.0.0 + */ public function compilePostQueries(BuilderAbstract $query): array { return []; diff --git a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php index 523ed84d1..ed654ae99 100755 --- a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php @@ -104,7 +104,7 @@ class MysqlGrammar extends Grammar * Compile from. * * @param SchemaBuilder $query Builder - * @param array $table Tables + * @param array $table Tables * * @return string * @@ -124,7 +124,7 @@ class MysqlGrammar extends Grammar * Compile from. * * @param SchemaBuilder $query Builder - * @param string $table Tables + * @param string $table Tables * * @return string * @@ -145,7 +145,7 @@ class MysqlGrammar extends Grammar * Compile create table fields query. * * @param SchemaBuilder $query Query - * @param array $fields Fields to create + * @param array $fields Fields to create * * @return string * diff --git a/Localization/BaseStringL11n.php b/Localization/BaseStringL11n.php index 7a7652b14..80b8d3a33 100755 --- a/Localization/BaseStringL11n.php +++ b/Localization/BaseStringL11n.php @@ -43,6 +43,12 @@ class BaseStringL11n implements \JsonSerializable */ public string $name = ''; + // @todo: this feels like $name and $type accomplish the same thing + // maybe we can always use $type and remove $name. + // This would require some smart mapper adjustment where the name is part of the l11n model, + // maybe use the path definition in the mapper which is used by arrays (e.g. type/name) + public ?BaseStringL11nType $type = null; + /** * Ref. * diff --git a/Localization/BaseStringL11nType.php b/Localization/BaseStringL11nType.php new file mode 100644 index 000000000..47b177dd5 --- /dev/null +++ b/Localization/BaseStringL11nType.php @@ -0,0 +1,93 @@ +title = $title; + } + + /** + * Get id + * + * @return int + * + * @since 1.0.0 + */ + public function getId() : int + { + return $this->id; + } + + /** + * {@inheritdoc} + */ + public function toArray() : array + { + return [ + 'id' => $this->id, + 'title' => $this->title, + ]; + } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return $this->toArray(); + } +} diff --git a/Localization/LanguageDetection/LanguageResult.php b/Localization/LanguageDetection/LanguageResult.php index 4b3856bc2..83e1868bf 100755 --- a/Localization/LanguageDetection/LanguageResult.php +++ b/Localization/LanguageDetection/LanguageResult.php @@ -35,7 +35,7 @@ class LanguageResult implements \JsonSerializable, \IteratorAggregate, \ArrayAcc /** * Match values per language * - * @var float[] + * @var array * @sicne 1.0.0 */ private array $result = []; diff --git a/Math/Number/Complex.php b/Math/Number/Complex.php index 18c9aaf6c..6f9dacaaa 100755 --- a/Math/Number/Complex.php +++ b/Math/Number/Complex.php @@ -355,6 +355,20 @@ final class Complex return new self($this->re * $val, $this->im * $val); } + /** + * Calculate the magnitude of the complex number + * + * @param int $power Power + * + * @return int|float + * + * @since 1.0.0 + */ + public function magnitued(int $power = 2) : int | float + { + return \pow($this->re, $power) + \pow($this->im, $power); + } + /** * Div opperator * diff --git a/Math/Optimization/Simplex.php b/Math/Optimization/Simplex.php new file mode 100644 index 000000000..4678d66b6 --- /dev/null +++ b/Math/Optimization/Simplex.php @@ -0,0 +1,205 @@ +constraints); + $n = \count($this->function); + + for ($i = 0; $i < $m; ++$i) { + if ($k === -1 || $this->constraintsLimit[$i] < $minLimit) { + $k = $i; + $minLimit = $this->constraintsLimit[$i]; + } + } + + if ($this->constraintsLimit[$k] >= 0) { + for ($j = 0; $j < $n; ++$j) { + $this->nonbasicSolution[$j] = $j; + } + + for ($i = 0; $i < $m; ++$i) { + $this->basicSolution[$i] = $n + $i; + } + + return true; + } + + // Auxiliary LP + ++$n; + for ($j = 0; $j < $n; ++$j) { + $this->nonbasicSolution[$j] = $j; + } + + for ($i = 0; $i < $m; ++$i) { + $this->basicSolution[$i] = $n + $i; + } + + $oldFunction = $this->function; + $oldLimit = $this->functionLimit; + + // Auxiliary function + $this->function[$n - 1] = -1; + $this->functionLimit = 0; + + for ($j = 0; $j < $n - 1; ++$j) { + $this->function[$j] = 0; + } + + // Auxiliary constraints + for ($i = 0; $i < $m; ++$i) { + $this->constraints[$i][$n - 1] = 1; + } + + $this->pivot($k, $n - 1); + + // Solve Auxiliary LP + while ($this->iterateSimplex()); + + if ($this->functionLimit !== 0) { + return false; + } + + $zBasic = -1; + for ($i = 0; $i < $m; ++$i) { + if ($this->basicSolution[$i] === $n - 1) { + $zBasic = $i; + break; + } + } + + if ($zBasic === -1) { + $this->pivot($zBasic, $n - 1); + } + + $zNonBasic = -1; + for ($j = 0; $j < $n; ++$j) { + if ($this->nonbasicSolution[$j] === $n - 1) { + $zNonBasic = $j; + break; + } + } + + for ($i = 0; $i < $m; ++$i) { + $this->constraints[$i][$zNonBasic] = $this->constraints[$i][$n - 1]; + } + + $tmp = $this->nonbasicSolution[$n - 1]; + $this->nonbasicSolution[$n - 1] = $this->nonbasicSolution[$zNonBasic]; + $this->nonbasicSolution[$zNonBasic] = $tmp; + + --$n; + + for ($j = 0; $j < $n; ++$j) { + if ($this->nonbasicSolution[$j] > $n) { + --$this->nonbasicSolution[$j]; + } + } + + for ($i = 0; $i < $m; ++$i) { + if ($this->basicSolution[$i] > $n) { + --$this->basicSolution[$i]; + } + } + + $this->functionLimit = $oldLimit; + for ($j = 0; $j < $n; ++$j) { + $this->function[$j] = 0; + } + + for ($j = 0; $j < $n; ++$j) { + $ok = false; + + for ($jj = 0; $jj < $n; ++$jj) { + if ($j === $this->nonbasicSolution[$jj]) { + $this->function[$jj] += $oldFunction[$j]; + + $ok = true; + break; + } + } + + if ($ok) { + continue; + } + + for ($i = 0; $i < $m; ++$i) { + if ($j = $this->basicSolution[$i]) { + for ($jj = 0; $jj < $n; ++$jj) { + $this->function[$jj] += $oldFunction[$j] * $this->constraints[$i][$jj]; + } + + $this->functionLimit += $oldFunction[$j] * $this->constraintsLimit[$i]; + break; + } + } + } + + return true; + } + + public function solve() : array + { + if (!$this->initialize()) { + return []; + } + } +} \ No newline at end of file diff --git a/Message/Http/HttpHeader.php b/Message/Http/HttpHeader.php index bfdad090f..2f457d249 100755 --- a/Message/Http/HttpHeader.php +++ b/Message/Http/HttpHeader.php @@ -415,8 +415,7 @@ final class HttpHeader extends HeaderAbstract private function generate100() : void { $this->set('', 'HTTP/1.0 100 Continue'); - $this->set('Status', 'Status: HTTP/1.0 100 Continue'); - \http_response_code(100); + $this->set('Status', '100 Continue'); } /** @@ -429,8 +428,7 @@ final class HttpHeader extends HeaderAbstract private function generate102() : void { $this->set('', 'HTTP/1.0 102 Processing'); - $this->set('Status', 'Status: HTTP/1.0 102 Processing'); - \http_response_code(102); + $this->set('Status', '102 Processing'); } /** @@ -443,8 +441,7 @@ final class HttpHeader extends HeaderAbstract private function generate200() : void { $this->set('', 'HTTP/1.0 200 OK'); - $this->set('Status', 'Status: HTTP/1.0 200 OK'); - \http_response_code(200); + $this->set('Status', '200 OK'); } /** @@ -457,8 +454,7 @@ final class HttpHeader extends HeaderAbstract private function generate201() : void { $this->set('', 'HTTP/1.0 201 Created'); - $this->set('Status', 'Status: HTTP/1.0 201 Created'); - \http_response_code(201); + $this->set('Status', '201 Created'); } /** @@ -471,8 +467,7 @@ final class HttpHeader extends HeaderAbstract private function generate202() : void { $this->set('', 'HTTP/1.0 202 Accepted'); - $this->set('Status', 'Status: HTTP/1.0 202 Accepted'); - \http_response_code(202); + $this->set('Status', '202 Accepted'); } /** @@ -485,8 +480,7 @@ final class HttpHeader extends HeaderAbstract private function generate204() : void { $this->set('', 'HTTP/1.0 204 No Content'); - $this->set('Status', 'Status: HTTP/1.0 204 No Content'); - \http_response_code(204); + $this->set('Status', '204 No Content'); } /** @@ -499,8 +493,7 @@ final class HttpHeader extends HeaderAbstract private function generate205() : void { $this->set('', 'HTTP/1.0 205 Reset Content'); - $this->set('Status', 'Status: HTTP/1.0 205 Reset Content'); - \http_response_code(205); + $this->set('Status', '205 Reset Content'); } /** @@ -513,8 +506,7 @@ final class HttpHeader extends HeaderAbstract private function generate206() : void { $this->set('', 'HTTP/1.0 206 Partial Content'); - $this->set('Status', 'Status: HTTP/1.0 206 Partial Content'); - \http_response_code(206); + $this->set('Status', '206 Partial Content'); } /** @@ -527,8 +519,7 @@ final class HttpHeader extends HeaderAbstract private function generate301() : void { $this->set('', 'HTTP/1.0 301 Moved Permanently'); - $this->set('Status', 'Status: HTTP/1.0 301 Moved Permanently'); - \http_response_code(301); + $this->set('Status', '301 Moved Permanently'); } /** @@ -541,8 +532,7 @@ final class HttpHeader extends HeaderAbstract private function generate302() : void { $this->set('', 'HTTP/1.0 302 Found'); - $this->set('Status', 'Status: HTTP/1.0 302 Found'); - \http_response_code(302); + $this->set('Status', '302 Found'); } /** @@ -555,8 +545,7 @@ final class HttpHeader extends HeaderAbstract private function generate303() : void { $this->set('', 'HTTP/1.0 303 See Other'); - $this->set('Status', 'Status: HTTP/1.0 303 See Other'); - \http_response_code(303); + $this->set('Status', '303 See Other'); } /** @@ -569,8 +558,7 @@ final class HttpHeader extends HeaderAbstract private function generate304() : void { $this->set('', 'HTTP/1.0 304 Not Modified'); - $this->set('Status', 'Status: HTTP/1.0 304 Not Modified'); - \http_response_code(304); + $this->set('Status', '304 Not Modified'); } /** @@ -583,8 +571,7 @@ final class HttpHeader extends HeaderAbstract private function generate307() : void { $this->set('', 'HTTP/1.0 307 Temporary Redirect'); - $this->set('Status', 'Status: HTTP/1.0 307 Temporary Redirect'); - \http_response_code(307); + $this->set('Status', '307 Temporary Redirect'); } /** @@ -597,8 +584,7 @@ final class HttpHeader extends HeaderAbstract private function generate308() : void { $this->set('', 'HTTP/1.0 308 Permanent Redirect'); - $this->set('Status', 'Status: HTTP/1.0 308 Permanent Redirect'); - \http_response_code(308); + $this->set('Status', '308 Permanent Redirect'); } /** @@ -611,8 +597,7 @@ final class HttpHeader extends HeaderAbstract private function generate400() : void { $this->set('', 'HTTP/1.0 400 Bad Request'); - $this->set('Status', 'Status: HTTP/1.0 400 Bad Request'); - \http_response_code(400); + $this->set('Status', '400 Bad Request'); } /** @@ -625,8 +610,7 @@ final class HttpHeader extends HeaderAbstract private function generate401() : void { $this->set('', 'HTTP/1.0 401 Unauthorized'); - $this->set('Status', 'Status: HTTP/1.0 401 Unauthorized'); - \http_response_code(401); + $this->set('Status', '401 Unauthorized'); } /** @@ -639,8 +623,7 @@ final class HttpHeader extends HeaderAbstract private function generate402() : void { $this->set('', 'HTTP/1.0 402 Payment Required'); - $this->set('Status', 'Status: HTTP/1.0 402 Payment Required'); - \http_response_code(402); + $this->set('Status', '402 Payment Required'); } /** @@ -653,8 +636,7 @@ final class HttpHeader extends HeaderAbstract private function generate403() : void { $this->set('', 'HTTP/1.0 403 Forbidden'); - $this->set('Status', 'Status: HTTP/1.0 403 Forbidden'); - \http_response_code(403); + $this->set('Status', '403 Forbidden'); } /** @@ -667,8 +649,7 @@ final class HttpHeader extends HeaderAbstract private function generate404() : void { $this->set('', 'HTTP/1.0 404 Not Found'); - $this->set('Status', 'Status: HTTP/1.0 404 Not Found'); - \http_response_code(404); + $this->set('Status', '404 Not Found'); } /** @@ -681,8 +662,7 @@ final class HttpHeader extends HeaderAbstract private function generate405() : void { $this->set('', 'HTTP/1.0 405 Method Not Allowed'); - $this->set('Status', 'Status: HTTP/1.0 405 Method Not Allowed'); - \http_response_code(405); + $this->set('Status', '405 Method Not Allowed'); } /** @@ -695,8 +675,7 @@ final class HttpHeader extends HeaderAbstract private function generate406() : void { $this->set('', 'HTTP/1.0 406 Not acceptable'); - $this->set('Status', 'Status: 406 Not acceptable'); - \http_response_code(406); + $this->set('Status', '406 Not acceptable'); } /** @@ -709,8 +688,7 @@ final class HttpHeader extends HeaderAbstract private function generate407() : void { $this->set('', 'HTTP/1.0 407 Proxy Authentication Required'); - $this->set('Status', 'Status: HTTP/1.0 407 Proxy Authentication Required'); - \http_response_code(407); + $this->set('Status', '407 Proxy Authentication Required'); } /** @@ -723,8 +701,7 @@ final class HttpHeader extends HeaderAbstract private function generate408() : void { $this->set('', 'HTTP/1.0 408 Request Timeout'); - $this->set('Status', 'Status: HTTP/1.0 408 Request Timeout'); - \http_response_code(408); + $this->set('Status', '408 Request Timeout'); } /** @@ -737,8 +714,7 @@ final class HttpHeader extends HeaderAbstract private function generate409() : void { $this->set('', 'HTTP/1.0 409 Conflict'); - $this->set('Status', 'Status: HTTP/1.0 409 Conflict'); - \http_response_code(409); + $this->set('Status', '409 Conflict'); } /** @@ -751,8 +727,7 @@ final class HttpHeader extends HeaderAbstract private function generate410() : void { $this->set('', 'HTTP/1.0 410 Gone'); - $this->set('Status', 'Status: HTTP/1.0 410 Gone'); - \http_response_code(410); + $this->set('Status', '410 Gone'); } /** @@ -765,8 +740,7 @@ final class HttpHeader extends HeaderAbstract private function generate411() : void { $this->set('', 'HTTP/1.0 411 Length Required'); - $this->set('Status', 'Status: HTTP/1.0 411 Length Required'); - \http_response_code(411); + $this->set('Status', '411 Length Required'); } /** @@ -779,8 +753,7 @@ final class HttpHeader extends HeaderAbstract private function generate412() : void { $this->set('', 'HTTP/1.0 412 Precondition Failed'); - $this->set('Status', 'Status: HTTP/1.0 412 Precondition Failed'); - \http_response_code(412); + $this->set('Status', '412 Precondition Failed'); } /** @@ -793,8 +766,7 @@ final class HttpHeader extends HeaderAbstract private function generate413() : void { $this->set('', 'HTTP/1.0 413 Request Entity Too Large'); - $this->set('Status', 'Status: HTTP/1.0 413 Request Entity Too Large'); - \http_response_code(413); + $this->set('Status', '413 Request Entity Too Large'); } /** @@ -807,8 +779,7 @@ final class HttpHeader extends HeaderAbstract private function generate414() : void { $this->set('', 'HTTP/1.0 414 Request-URI Too Long'); - $this->set('Status', 'Status: HTTP/1.0 414 Request-URI Too Long'); - \http_response_code(414); + $this->set('Status', '414 Request-URI Too Long'); } /** @@ -821,8 +792,7 @@ final class HttpHeader extends HeaderAbstract private function generate415() : void { $this->set('', 'HTTP/1.0 415 Unsupported Media Type'); - $this->set('Status', 'Status: HTTP/1.0 415 Unsupported Media Type'); - \http_response_code(415); + $this->set('Status', '415 Unsupported Media Type'); } /** @@ -835,8 +805,7 @@ final class HttpHeader extends HeaderAbstract private function generate416() : void { $this->set('', 'HTTP/1.0 416 Requested Range Not Satisfiable'); - $this->set('Status', 'Status: HTTP/1.0 416 Requested Range Not Satisfiable'); - \http_response_code(416); + $this->set('Status', '416 Requested Range Not Satisfiable'); } /** @@ -849,8 +818,7 @@ final class HttpHeader extends HeaderAbstract private function generate417() : void { $this->set('', 'HTTP/1.0 417 Expectation Failed'); - $this->set('Status', 'Status: HTTP/1.0 417 Expectation Failed'); - \http_response_code(417); + $this->set('Status', '417 Expectation Failed'); } /** @@ -863,8 +831,7 @@ final class HttpHeader extends HeaderAbstract private function generate421() : void { $this->set('', 'HTTP/1.0 421 Misdirected Request'); - $this->set('Status', 'Status: HTTP/1.0 421 Misdirected Request'); - \http_response_code(421); + $this->set('Status', '421 Misdirected Request'); } /** @@ -877,8 +844,7 @@ final class HttpHeader extends HeaderAbstract private function generate422() : void { $this->set('', 'HTTP/1.0 422 Unprocessable Entity'); - $this->set('Status', 'Status: HTTP/1.0 422 Unprocessable Entity'); - \http_response_code(422); + $this->set('Status', '422 Unprocessable Entity'); } /** @@ -891,8 +857,7 @@ final class HttpHeader extends HeaderAbstract private function generate423() : void { $this->set('', 'HTTP/1.0 423 Locked'); - $this->set('Status', 'Status: HTTP/1.0 423 Locked'); - \http_response_code(423); + $this->set('Status', '423 Locked'); } /** @@ -905,8 +870,7 @@ final class HttpHeader extends HeaderAbstract private function generate424() : void { $this->set('', 'HTTP/1.0 424 Failed Dependency'); - $this->set('Status', 'Status: HTTP/1.0 424 Failed Dependency'); - \http_response_code(424); + $this->set('Status', '424 Failed Dependency'); } /** @@ -919,8 +883,7 @@ final class HttpHeader extends HeaderAbstract private function generate425() : void { $this->set('', 'HTTP/1.0 425 Too Early'); - $this->set('Status', 'Status: HTTP/1.0 425 Too Early'); - \http_response_code(425); + $this->set('Status', '425 Too Early'); } /** @@ -933,8 +896,7 @@ final class HttpHeader extends HeaderAbstract private function generate426() : void { $this->set('', 'HTTP/1.0 426 Upgrade Required'); - $this->set('Status', 'Status: HTTP/1.0 426 Upgrade Required'); - \http_response_code(426); + $this->set('Status', '426 Upgrade Required'); } /** @@ -947,8 +909,7 @@ final class HttpHeader extends HeaderAbstract private function generate428() : void { $this->set('', 'HTTP/1.0 428 Precondition Required'); - $this->set('Status', 'Status: HTTP/1.0 428 Precondition Required'); - \http_response_code(428); + $this->set('Status', '428 Precondition Required'); } /** @@ -961,8 +922,7 @@ final class HttpHeader extends HeaderAbstract private function generate429() : void { $this->set('', 'HTTP/1.0 429 Too Many Requests'); - $this->set('Status', 'Status: HTTP/1.0 429 Too Many Requests'); - \http_response_code(429); + $this->set('Status', '429 Too Many Requests'); } /** @@ -975,8 +935,7 @@ final class HttpHeader extends HeaderAbstract private function generate431() : void { $this->set('', 'HTTP/1.0 431 Request Header Fields Too Large'); - $this->set('Status', 'Status: HTTP/1.0 431 Request Header Fields Too Large'); - \http_response_code(431); + $this->set('Status', '431 Request Header Fields Too Large'); } /** @@ -989,8 +948,7 @@ final class HttpHeader extends HeaderAbstract private function generate451() : void { $this->set('', 'HTTP/1.0 451 Unavailable For Legal Reasons'); - $this->set('Status', 'Status: HTTP/1.0 451 Unavailable For Legal Reasons'); - \http_response_code(451); + $this->set('Status', '451 Unavailable For Legal Reasons'); } /** @@ -1003,8 +961,7 @@ final class HttpHeader extends HeaderAbstract private function generate500() : void { $this->set('', 'HTTP/1.0 500 Internal Server Error'); - $this->set('Status', 'Status: HTTP/1.0 500 Internal Server Error'); - \http_response_code(500); + $this->set('Status', '500 Internal Server Error'); } /** @@ -1017,8 +974,7 @@ final class HttpHeader extends HeaderAbstract private function generate501() : void { $this->set('', 'HTTP/1.0 501 Not Implemented'); - $this->set('Status', 'Status: HTTP/1.0 501 Not Implemented'); - \http_response_code(501); + $this->set('Status', '501 Not Implemented'); } /** @@ -1031,8 +987,7 @@ final class HttpHeader extends HeaderAbstract private function generate502() : void { $this->set('', 'HTTP/1.0 502 Bad Gateway'); - $this->set('Status', 'Status: HTTP/1.0 502 Bad Gateway'); - \http_response_code(502); + $this->set('Status', '502 Bad Gateway'); } /** @@ -1045,9 +1000,8 @@ final class HttpHeader extends HeaderAbstract private function generate503() : void { $this->set('', 'HTTP/1.0 503 Service Temporarily Unavailable'); - $this->set('Status', 'Status: 503 Service Temporarily Unavailable'); + $this->set('Status', '503 Service Temporarily Unavailable'); $this->set('Retry-After', 'Retry-After: 300'); - \http_response_code(503); } /** @@ -1060,8 +1014,7 @@ final class HttpHeader extends HeaderAbstract private function generate504() : void { $this->set('', 'HTTP/1.0 504 Gateway Timeout'); - $this->set('Status', 'Status: HTTP/1.0 504 Gateway Timeout'); - \http_response_code(504); + $this->set('Status', '504 Gateway Timeout'); } /** @@ -1074,8 +1027,7 @@ final class HttpHeader extends HeaderAbstract private function generate507() : void { $this->set('', 'HTTP/1.0 507 Insufficient Storage'); - $this->set('Status', 'Status: HTTP/1.0 507 Insufficient Storage'); - \http_response_code(507); + $this->set('Status', '507 Insufficient Storage'); } /** @@ -1088,8 +1040,7 @@ final class HttpHeader extends HeaderAbstract private function generate508() : void { $this->set('', 'HTTP/1.0 508 Loop Detected'); - $this->set('Status', 'Status: HTTP/1.0 508 Loop Detected'); - \http_response_code(508); + $this->set('Status', '508 Loop Detected'); } /** @@ -1102,8 +1053,7 @@ final class HttpHeader extends HeaderAbstract private function generate511() : void { $this->set('', 'HTTP/1.0 511 Network Authentication Required'); - $this->set('Status', 'Status: HTTP/1.0 511 Network Authentication Required'); - \http_response_code(511); + $this->set('Status', '511 Network Authentication Required'); } /** @@ -1116,8 +1066,7 @@ final class HttpHeader extends HeaderAbstract private function generate598() : void { $this->set('', 'HTTP/1.0 598 Network read timeout error'); - $this->set('Status', 'Status: HTTP/1.0 598 Network read timeout error'); - \http_response_code(598); + $this->set('Status', '598 Network read timeout error'); } /** @@ -1130,7 +1079,6 @@ final class HttpHeader extends HeaderAbstract private function generate599() : void { $this->set('', 'HTTP/1.0 599 Network connect timeout error'); - $this->set('Status', 'Status: HTTP/1.0 599 Network connect timeout error'); - \http_response_code(599); + $this->set('Status', '599 Network connect timeout error'); } } diff --git a/Module/PackageManager.php b/Module/PackageManager.php index 378538dfe..cbc57af66 100755 --- a/Module/PackageManager.php +++ b/Module/PackageManager.php @@ -339,6 +339,10 @@ final class PackageManager */ private function authenticate(string $signedHash, string $rawHash) : bool { + if ($signedHash === '' || $rawHash === '') { + return false; + } + try { return \sodium_crypto_sign_verify_detached($signedHash, $rawHash, $this->publicKey); } catch(\Throwable $t) { diff --git a/Security/Guard.php b/Security/Guard.php index 97ca09b32..48ba8a577 100755 --- a/Security/Guard.php +++ b/Security/Guard.php @@ -69,7 +69,11 @@ final class Guard if (\is_array($data)) { $result = []; foreach ($data as $key => $value) { - $result[$key] = self::unslash($value); + if (\is_string($value) || \is_array($value)) { + $result[$key] = self::unslash($value); + } else { + $result[$key] = $value; + } } return $result; diff --git a/Utils/Barcode/Datamatrix.php b/Utils/Barcode/Datamatrix.php index 367432eb8..65271914f 100755 --- a/Utils/Barcode/Datamatrix.php +++ b/Utils/Barcode/Datamatrix.php @@ -771,10 +771,10 @@ class Datamatrix extends TwoDAbstract } elseif (isset($chr, self::CHARSET['SH2'][$chr])) { $temp_cw[] = 1; // shift 2 $shiftset = self::CHARSET['SH2']; - } elseif (($enc === self::ENC_C40) && isset(self::CHARSET['S3C'][$chr])) { + } elseif ($enc === self::ENC_C40 && isset(self::CHARSET['S3C'][$chr])) { $temp_cw[] = 2; // shift 3 $shiftset = self::CHARSET['S3C']; - } elseif (($enc === self::ENC_TXT) && isset(self::CHARSET['S3T'][$chr])) { + } elseif ($enc === self::ENC_TXT && isset(self::CHARSET['S3T'][$chr])) { $temp_cw[] = 2; // shift 3 $shiftset = self::CHARSET['S3T']; } else { diff --git a/Utils/ImageUtils.php b/Utils/ImageUtils.php index 68c79738e..1e68af7d8 100755 --- a/Utils/ImageUtils.php +++ b/Utils/ImageUtils.php @@ -214,6 +214,9 @@ final class ImageUtils $diff = empty($out) ? -1 : $out; $dst = false; + $red = 0; + $green = 0; + if ($diff !== -1) { $dst = $diff === 0 ? \imagecreatetruecolor($newDim[0], $newDim[1]) @@ -246,12 +249,20 @@ final class ImageUtils for ($j = 0; $j < $newDim[1]; ++$j) { if ($i >= $imageDim1[0] || $j >= $imageDim1[1]) { if ($diff === 0) { + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $green); } elseif ($diff === 1) { if ($i >= $imageDim2[0] || $j >= $imageDim2[1]) { + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $green); } else { $color2 = \imagecolorat($src2, $i, $j); + + if ($color2 === false) { + continue; + } + + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $color2); } } @@ -262,12 +273,20 @@ final class ImageUtils if ($i >= $imageDim2[0] || $j >= $imageDim2[1]) { if ($diff === 0) { + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $red); } elseif ($diff === 1) { if ($i >= $imageDim1[0] || $j >= $imageDim1[1]) { + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $red); } else { $color1 = \imagecolorat($src1, $i, $j); + + if ($color1 === false) { + continue; + } + + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $color1); } } @@ -279,12 +298,14 @@ final class ImageUtils $color1 = \imagecolorat($src1, $i, $j); $color2 = \imagecolorat($src2, $i, $j); - if ($color1 !== $color2 && $color1 !== false && $color2 !== null) { + if ($color1 !== $color2 && $color1 !== false && $color2 !== false) { ++$difference; if ($diff === 0) { + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $color2); } elseif ($diff === 1) { + /** @var \GdImage $dst */ \imagesetpixel($dst, $i, $j, $green); } } diff --git a/Utils/TaskSchedule/TaskScheduler.php b/Utils/TaskSchedule/TaskScheduler.php index 64dc23210..29a79130e 100755 --- a/Utils/TaskSchedule/TaskScheduler.php +++ b/Utils/TaskSchedule/TaskScheduler.php @@ -102,4 +102,11 @@ class TaskScheduler extends SchedulerAbstract return $jobs; } + + /** + * {@inheritdoc} + */ + public function reload() : void + { + } } diff --git a/tests/Account/AccountManagerTest.php b/tests/Account/AccountManagerTest.php index 3d9711d75..f3a05651b 100755 --- a/tests/Account/AccountManagerTest.php +++ b/tests/Account/AccountManagerTest.php @@ -41,19 +41,6 @@ final class AccountManagerTest extends \PHPUnit\Framework\TestCase $this->account->generatePassword('abcd'); } - /** - * @testdox The manager has the expected member variables - * @covers phpOMS\Account\AccountManager - * @group framework - */ - public function testAttributes() : void - { - self::assertInstanceOf('\phpOMS\Account\AccountManager', $this->manager); - - /* Testing members */ - self::assertObjectHasAttribute('accounts', $this->manager); - } - /** * @testdox The manager has the expected default values after initialization * @covers phpOMS\Account\AccountManager diff --git a/tests/Account/AccountTest.php b/tests/Account/AccountTest.php index 1d950f626..e2da188b8 100755 --- a/tests/Account/AccountTest.php +++ b/tests/Account/AccountTest.php @@ -43,33 +43,6 @@ final class AccountTest extends \PHPUnit\Framework\TestCase $this->l11nManager = new L11nManager('Api'); } - /** - * @testdox The account has the expected member variables - * @covers phpOMS\Account\Account - * @group framework - */ - public function testAttributes() : void - { - $account = new Account(); - self::assertInstanceOf('\phpOMS\Account\Account', $account); - - /* Testing members */ - self::assertObjectHasAttribute('id', $account); - self::assertObjectHasAttribute('name1', $account); - self::assertObjectHasAttribute('name2', $account); - self::assertObjectHasAttribute('name3', $account); - self::assertObjectHasAttribute('email', $account); - self::assertObjectHasAttribute('origin', $account); - self::assertObjectHasAttribute('login', $account); - self::assertObjectHasAttribute('lastActive', $account); - self::assertObjectHasAttribute('createdAt', $account); - self::assertObjectHasAttribute('permissions', $account); - self::assertObjectHasAttribute('groups', $account); - self::assertObjectHasAttribute('type', $account); - self::assertObjectHasAttribute('status', $account); - self::assertObjectHasAttribute('l11n', $account); - } - /** * @testdox The account has the expected default values after initialization * @covers phpOMS\Account\Account diff --git a/tests/Account/GroupTest.php b/tests/Account/GroupTest.php index 8d7d7c577..7ec85f98b 100755 --- a/tests/Account/GroupTest.php +++ b/tests/Account/GroupTest.php @@ -28,26 +28,6 @@ require_once __DIR__ . '/../Autoloader.php'; */ final class GroupTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The group has the expected member variables - * @covers phpOMS\Account\Group - * @group framework - */ - public function testAttributes() : void - { - $group = new Group(); - self::assertInstanceOf('\phpOMS\Account\Group', $group); - - /* Testing members */ - self::assertObjectHasAttribute('id', $group); - self::assertObjectHasAttribute('name', $group); - self::assertObjectHasAttribute('description', $group); - self::assertObjectHasAttribute('members', $group); - self::assertObjectHasAttribute('parents', $group); - self::assertObjectHasAttribute('permissions', $group); - self::assertObjectHasAttribute('status', $group); - } - /** * @testdox The group has the expected default values after initialization * @covers phpOMS\Account\Group diff --git a/tests/Asset/AssetManagerTest.php b/tests/Asset/AssetManagerTest.php index 2d918ec8c..a95133540 100755 --- a/tests/Asset/AssetManagerTest.php +++ b/tests/Asset/AssetManagerTest.php @@ -35,18 +35,6 @@ final class AssetManagerTest extends \PHPUnit\Framework\TestCase $this->manager = new AssetManager(); } - /** - * @testdox The manager has the expected member variables - * @group framework - */ - public function testAttributes() : void - { - self::assertInstanceOf('\phpOMS\Asset\AssetManager', $this->manager); - - /* Testing members */ - self::assertObjectHasAttribute('assets', $this->manager); - } - /** * @testdox The manager has the expected default values after initialization * @group framework diff --git a/tests/Config/OptionsTraitTest.php b/tests/Config/OptionsTraitTest.php index aba968517..608705f00 100755 --- a/tests/Config/OptionsTraitTest.php +++ b/tests/Config/OptionsTraitTest.php @@ -25,20 +25,6 @@ require_once __DIR__ . '/../Autoloader.php'; */ final class OptionsTraitTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The option helper has the expected attributes - * @group framework - */ - public function testOptionTraitMembers() : void - { - $class = new class() { - use OptionsTrait; - }; - - /* Testing members */ - self::assertObjectHasAttribute('options', $class); - } - /** * @testdox The option helper has the expected default values after initialization * @group framework diff --git a/tests/DataStorage/Database/Schema/BuilderTest.php b/tests/DataStorage/Database/Schema/BuilderTest.php index 85403304e..e029776a1 100755 --- a/tests/DataStorage/Database/Schema/BuilderTest.php +++ b/tests/DataStorage/Database/Schema/BuilderTest.php @@ -85,7 +85,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase public function testMysqlCreateTable() : void { $query = new Builder($this->con); - $sql = 'CREATE TABLE IF NOT EXISTS `user_roles` (`user_id` INT NOT NULL AUTO_INCREMENT, `role_id` VARCHAR(10) DEFAULT \'1\' NULL, PRIMARY KEY (`user_id`), FOREIGN KEY (`user_id`) REFERENCES `users` (`ext1_id`), FOREIGN KEY (`role_id`) REFERENCES `roles` (`ext2_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1;'; + $sql = 'CREATE TABLE IF NOT EXISTS `user_roles` (`user_id` INT AUTO_INCREMENT, `role_id` VARCHAR(10) DEFAULT \'1\' NULL, PRIMARY KEY (`user_id`), FOREIGN KEY (`user_id`) REFERENCES `users` (`ext1_id`), FOREIGN KEY (`role_id`) REFERENCES `roles` (`ext2_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1;'; self::assertEquals( $sql, $query->createTable('user_roles') diff --git a/tests/Dispatcher/DispatcherTest.php b/tests/Dispatcher/DispatcherTest.php index 0f83ff29b..0ca6670eb 100755 --- a/tests/Dispatcher/DispatcherTest.php +++ b/tests/Dispatcher/DispatcherTest.php @@ -47,16 +47,6 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase $this->app->dispatcher = new Dispatcher($this->app); } - /** - * @testdox The dispatcher has the expected attributes - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ - public function testAttributes() : void - { - self::assertObjectHasAttribute('controllers', $this->app->dispatcher); - } - /** * @testdox A route can be added and dispatched * @covers phpOMS\Dispatcher\Dispatcher diff --git a/tests/Event/EventManagerTest.php b/tests/Event/EventManagerTest.php index cd9656059..badf78eeb 100755 --- a/tests/Event/EventManagerTest.php +++ b/tests/Event/EventManagerTest.php @@ -35,17 +35,6 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase $this->event = new EventManager(); } - /** - * @testdox The event manager has the expected member variables - * @covers phpOMS\Event\EventManager - * @group framework - */ - public function testAttributes() : void - { - self::assertObjectHasAttribute('groups', $this->event); - self::assertObjectHasAttribute('callbacks', $this->event); - } - /** * @testdox The event manager has the expected default values after initialization * @covers phpOMS\Event\EventManager diff --git a/tests/Localization/ISO3166NumEnumTest.php b/tests/Localization/ISO3166NumEnumTest.php index 4c5cd51cf..bd48ca253 100755 --- a/tests/Localization/ISO3166NumEnumTest.php +++ b/tests/Localization/ISO3166NumEnumTest.php @@ -44,14 +44,4 @@ final class ISO3166NumEnumTest extends \PHPUnit\Framework\TestCase self::assertTrue($ok); } - - /** - * @testdox The ISO 3166 enum has only unique values - * @group framework - * @coversNothing - */ - public function testUnique() : void - { - self::assertEquals(ISO3166NumEnum::getConstants(), \array_unique(ISO3166NumEnum::getConstants())); - } } diff --git a/tests/Localization/L11nManagerTest.php b/tests/Localization/L11nManagerTest.php index 5f862280d..feb7f0ee2 100755 --- a/tests/Localization/L11nManagerTest.php +++ b/tests/Localization/L11nManagerTest.php @@ -37,16 +37,6 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase $this->l11nManager = new L11nManager('Api'); } - /** - * @testdox The localization manager has the expected member variables - * @covers phpOMS\Localization\L11nManager - * @group framework - */ - public function testAttributes() : void - { - self::assertObjectHasAttribute('language', $this->l11nManager); - } - /** * @testdox The localization manager has the expected default values after initialization * @covers phpOMS\Localization\L11nManager diff --git a/tests/Localization/MoneyTest.php b/tests/Localization/MoneyTest.php index 1b2be65ce..a3a410bae 100755 --- a/tests/Localization/MoneyTest.php +++ b/tests/Localization/MoneyTest.php @@ -33,12 +33,7 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase public function testDefaultMemberVariables() : void { $money = new Money(0); - self::assertObjectHasAttribute('thousands', $money); - self::assertObjectHasAttribute('decimal', $money); - self::assertObjectHasAttribute('value', $money); - self::assertGreaterThan(0, Money::MAX_DECIMALS); - self::assertEquals(0, $money->getInt()); } diff --git a/tests/Log/FileLoggerTest.php b/tests/Log/FileLoggerTest.php index 5a027f19b..b97233175 100755 --- a/tests/Log/FileLoggerTest.php +++ b/tests/Log/FileLoggerTest.php @@ -56,17 +56,6 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox The logger has the expected member variables - * @covers phpOMS\Log\FileLogger - * @group framework - */ - public function testAttributes() : void - { - self::assertObjectHasAttribute('fp', $this->log); - self::assertObjectHasAttribute('path', $this->log); - } - /** * @testdox The logger has the expected default values after initialization * @covers phpOMS\Log\FileLogger diff --git a/tests/Message/Http/RequestStatusCodeTest.php b/tests/Message/Http/RequestStatusCodeTest.php index 6b375b85b..967396be7 100755 --- a/tests/Message/Http/RequestStatusCodeTest.php +++ b/tests/Message/Http/RequestStatusCodeTest.php @@ -27,7 +27,7 @@ final class RequestStatusCodeTest extends \PHPUnit\Framework\TestCase */ public function testEnumCount() : void { - self::assertCount(55, RequestStatusCode::getConstants()); + self::assertCount(63, RequestStatusCode::getConstants()); } /** diff --git a/tests/Message/Http/RequestStatusTest.php b/tests/Message/Http/RequestStatusTest.php index 3aa79490b..5f49eda4f 100755 --- a/tests/Message/Http/RequestStatusTest.php +++ b/tests/Message/Http/RequestStatusTest.php @@ -27,7 +27,7 @@ final class RequestStatusTest extends \PHPUnit\Framework\TestCase */ public function testEnumCount() : void { - self::assertCount(55, RequestStatus::getConstants()); + self::assertCount(58, RequestStatus::getConstants()); } /** diff --git a/tests/Model/Message/DomTest.php b/tests/Model/Message/DomTest.php index f8627f8f8..00d6e6d58 100755 --- a/tests/Model/Message/DomTest.php +++ b/tests/Model/Message/DomTest.php @@ -22,22 +22,6 @@ use phpOMS\Model\Message\DomAction; */ final class DomTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Dom - * @group framework - */ - public function testAttributes() : void - { - $obj = new Dom(); - self::assertInstanceOf('\phpOMS\Model\Message\Dom', $obj); - - /* Testing members */ - self::assertObjectHasAttribute('delay', $obj); - self::assertObjectHasAttribute('content', $obj); - self::assertObjectHasAttribute('selector', $obj); - self::assertObjectHasAttribute('action', $obj); - } - /** * @covers phpOMS\Model\Message\Dom * @group framework diff --git a/tests/Model/Message/FormValidationTest.php b/tests/Model/Message/FormValidationTest.php index b1ec524c9..c9d27982a 100755 --- a/tests/Model/Message/FormValidationTest.php +++ b/tests/Model/Message/FormValidationTest.php @@ -21,19 +21,6 @@ use phpOMS\Model\Message\FormValidation; */ final class FormValidationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\FormValidation - * @group framework - */ - public function testAttributes() : void - { - $obj = new FormValidation([]); - self::assertInstanceOf('\phpOMS\Model\Message\FormValidation', $obj); - - /* Testing members */ - self::assertObjectHasAttribute('validation', $obj); - } - /** * @covers phpOMS\Model\Message\FormValidation * @group framework diff --git a/tests/Model/Message/NotifyTest.php b/tests/Model/Message/NotifyTest.php index f80cdc9f4..8e7c5f0cc 100755 --- a/tests/Model/Message/NotifyTest.php +++ b/tests/Model/Message/NotifyTest.php @@ -22,23 +22,6 @@ use phpOMS\Model\Message\NotifyType; */ final class NotifyTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Notify - * @group framework - */ - public function testAttributes() : void - { - $obj = new Notify(); - self::assertInstanceOf('\phpOMS\Model\Message\Notify', $obj); - - /* Testing members */ - self::assertObjectHasAttribute('delay', $obj); - self::assertObjectHasAttribute('title', $obj); - self::assertObjectHasAttribute('stay', $obj); - self::assertObjectHasAttribute('message', $obj); - self::assertObjectHasAttribute('level', $obj); - } - /** * @covers phpOMS\Model\Message\Notify * @group framework diff --git a/tests/Model/Message/NotifyTypeTest.php b/tests/Model/Message/NotifyTypeTest.php index 88e636b2b..6129d60b4 100755 --- a/tests/Model/Message/NotifyTypeTest.php +++ b/tests/Model/Message/NotifyTypeTest.php @@ -27,7 +27,7 @@ final class NotifyTypeTest extends \PHPUnit\Framework\TestCase */ public function testEnumCount() : void { - self::assertCount(5, NotifyType::getConstants()); + self::assertCount(7, NotifyType::getConstants()); } /** @@ -45,10 +45,10 @@ final class NotifyTypeTest extends \PHPUnit\Framework\TestCase */ public function testEnums() : void { - self::assertEquals(0, NotifyType::BINARY); - self::assertEquals(1, NotifyType::INFO); - self::assertEquals(2, NotifyType::WARNING); - self::assertEquals(3, NotifyType::ERROR); - self::assertEquals(4, NotifyType::FATAL); + self::assertEquals('binary', NotifyType::BINARY); + self::assertEquals('info', NotifyType::INFO); + self::assertEquals('warning', NotifyType::WARNING); + self::assertEquals('error', NotifyType::ERROR); + self::assertEquals('fatal', NotifyType::FATAL); } } diff --git a/tests/Model/Message/RedirectTest.php b/tests/Model/Message/RedirectTest.php index 0424897f3..5d4f1acb1 100755 --- a/tests/Model/Message/RedirectTest.php +++ b/tests/Model/Message/RedirectTest.php @@ -21,21 +21,6 @@ use phpOMS\Model\Message\Redirect; */ final class RedirectTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Redirect - * @group framework - */ - public function testAttributes() : void - { - $obj = new Redirect(''); - self::assertInstanceOf('\phpOMS\Model\Message\Redirect', $obj); - - /* Testing members */ - self::assertObjectHasAttribute('uri', $obj); - self::assertObjectHasAttribute('delay', $obj); - self::assertObjectHasAttribute('new', $obj); - } - /** * @covers phpOMS\Model\Message\Redirect * @group framework diff --git a/tests/Model/Message/ReloadTest.php b/tests/Model/Message/ReloadTest.php index 2e5f1574b..fe690b114 100755 --- a/tests/Model/Message/ReloadTest.php +++ b/tests/Model/Message/ReloadTest.php @@ -21,19 +21,6 @@ use phpOMS\Model\Message\Reload; */ final class ReloadTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Reload - * @group framework - */ - public function testAttributes() : void - { - $obj = new Reload(); - self::assertInstanceOf('\phpOMS\Model\Message\Reload', $obj); - - /* Testing members */ - self::assertObjectHasAttribute('delay', $obj); - } - /** * @covers phpOMS\Model\Message\Reload * @group framework diff --git a/tests/Module/ModuleManagerTest.php b/tests/Module/ModuleManagerTest.php index 929140c96..c185352ee 100755 --- a/tests/Module/ModuleManagerTest.php +++ b/tests/Module/ModuleManagerTest.php @@ -57,22 +57,6 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase $this->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/'); } - /** - * @testdox The module manager has the expected attributes - * @covers phpOMS\Module\ModuleManager - * @group framework - */ - public function testAttributes() : void - { - self::assertInstanceOf('\phpOMS\Module\ModuleManager', $this->moduleManager); - - self::assertObjectHasAttribute('running', $this->moduleManager); - self::assertObjectHasAttribute('installed', $this->moduleManager); - self::assertObjectHasAttribute('active', $this->moduleManager); - self::assertObjectHasAttribute('all', $this->moduleManager); - self::assertObjectHasAttribute('uriLoad', $this->moduleManager); - } - /** * @testdox Unknown modules return a null module * @covers phpOMS\Module\ModuleManager diff --git a/tests/Stdlib/Base/AddressTest.php b/tests/Stdlib/Base/AddressTest.php index fa9617dec..aa605f721 100755 --- a/tests/Stdlib/Base/AddressTest.php +++ b/tests/Stdlib/Base/AddressTest.php @@ -34,18 +34,6 @@ final class AddressTest extends \PHPUnit\Framework\TestCase $this->address = new Address(); } - /** - * @testdox The address has the expected attributes - * @covers phpOMS\Stdlib\Base\Address - * @group framework - */ - public function testAttributes() : void - { - self::assertObjectHasAttribute('recipient', $this->address); - self::assertObjectHasAttribute('fao', $this->address); - self::assertObjectHasAttribute('location', $this->address); - } - /** * @testdox The address has the expected default values after initialization * @covers phpOMS\Stdlib\Base\Address diff --git a/tests/Stdlib/Base/LocationTest.php b/tests/Stdlib/Base/LocationTest.php index 09333c458..533eb8767 100755 --- a/tests/Stdlib/Base/LocationTest.php +++ b/tests/Stdlib/Base/LocationTest.php @@ -34,21 +34,6 @@ final class LocationTest extends \PHPUnit\Framework\TestCase $this->location = new Location(); } - /** - * @testdox The location has the expected attributes - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ - public function testAttributes() : void - { - self::assertObjectHasAttribute('postal', $this->location); - self::assertObjectHasAttribute('city', $this->location); - self::assertObjectHasAttribute('country', $this->location); - self::assertObjectHasAttribute('address', $this->location); - self::assertObjectHasAttribute('state', $this->location); - self::assertObjectHasAttribute('geo', $this->location); - } - /** * @testdox The location has the expected default values after initialization * @covers phpOMS\Stdlib\Base\Location