mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
c47d3bb6c1
commit
7c01ac51e9
|
|
@ -15,10 +15,8 @@ declare(strict_types=1);
|
||||||
namespace phpOMS\DataStorage\Database;
|
namespace phpOMS\DataStorage\Database;
|
||||||
|
|
||||||
use phpOMS\Contract\SerializableInterface;
|
use phpOMS\Contract\SerializableInterface;
|
||||||
use phpOMS\DataStorage\Database\Query\Builder;
|
|
||||||
use phpOMS\DataStorage\Database\Query\Column;
|
use phpOMS\DataStorage\Database\Query\Column;
|
||||||
use phpOMS\DataStorage\Database\Query\Parameter;
|
use phpOMS\DataStorage\Database\Query\Parameter;
|
||||||
use phpOMS\DataStorage\Database\Query\QueryType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grammar.
|
* Grammar.
|
||||||
|
|
@ -139,6 +137,17 @@ abstract class GrammarAbstract
|
||||||
return \substr($queryString, 0, -1) . ';';
|
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
|
public function compilePostQuerys(BuilderAbstract $query) : array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
|
|
@ -249,7 +258,7 @@ abstract class GrammarAbstract
|
||||||
* Compile value.
|
* Compile value.
|
||||||
*
|
*
|
||||||
* @param BuilderAbstract $query Query builder
|
* @param BuilderAbstract $query Query builder
|
||||||
* @param mixed $value Value
|
* @param mixed $value Value
|
||||||
*
|
*
|
||||||
* @return string returns a string representation of the value
|
* @return string returns a string representation of the value
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -104,21 +104,60 @@ class Grammar extends GrammarAbstract
|
||||||
return $sql;
|
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
|
protected function compileSelectTables(SchemaBuilder $query, array $tables) : string
|
||||||
{
|
{
|
||||||
return '';
|
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
|
protected function compileSelectFields(SchemaBuilder $query, string $table) : string
|
||||||
{
|
{
|
||||||
return '';
|
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
|
protected function compileCreateFields(SchemaBuilder $query, array $fields) : string
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compile the select tables.
|
||||||
|
*
|
||||||
|
* @param SchemaBuilder $query Query
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function compilePostQueries(BuilderAbstract $query): array
|
public function compilePostQueries(BuilderAbstract $query): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ class MysqlGrammar extends Grammar
|
||||||
* Compile from.
|
* Compile from.
|
||||||
*
|
*
|
||||||
* @param SchemaBuilder $query Builder
|
* @param SchemaBuilder $query Builder
|
||||||
* @param array $table Tables
|
* @param array $table Tables
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
|
|
@ -124,7 +124,7 @@ class MysqlGrammar extends Grammar
|
||||||
* Compile from.
|
* Compile from.
|
||||||
*
|
*
|
||||||
* @param SchemaBuilder $query Builder
|
* @param SchemaBuilder $query Builder
|
||||||
* @param string $table Tables
|
* @param string $table Tables
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
|
|
@ -145,7 +145,7 @@ class MysqlGrammar extends Grammar
|
||||||
* Compile create table fields query.
|
* Compile create table fields query.
|
||||||
*
|
*
|
||||||
* @param SchemaBuilder $query Query
|
* @param SchemaBuilder $query Query
|
||||||
* @param array $fields Fields to create
|
* @param array $fields Fields to create
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,12 @@ class BaseStringL11n implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public string $name = '';
|
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.
|
* Ref.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
93
Localization/BaseStringL11nType.php
Normal file
93
Localization/BaseStringL11nType.php
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Karaka
|
||||||
|
*
|
||||||
|
* PHP Version 8.1
|
||||||
|
*
|
||||||
|
* @package phpOMS\Localization
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace phpOMS\Localization;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String l11n class.
|
||||||
|
*
|
||||||
|
* @package phpOMS\Localization
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class BaseStringL11nType implements \JsonSerializable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* ID.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected int $id = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identifier for the l11n type.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public string $title = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the l11n type required for an item?
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public bool $isRequired = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param string $title Title
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __construct(string $title = '')
|
||||||
|
{
|
||||||
|
$this->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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -35,7 +35,7 @@ class LanguageResult implements \JsonSerializable, \IteratorAggregate, \ArrayAcc
|
||||||
/**
|
/**
|
||||||
* Match values per language
|
* Match values per language
|
||||||
*
|
*
|
||||||
* @var float[]
|
* @var array<int|float, int|float>
|
||||||
* @sicne 1.0.0
|
* @sicne 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $result = [];
|
private array $result = [];
|
||||||
|
|
|
||||||
|
|
@ -355,6 +355,20 @@ final class Complex
|
||||||
return new self($this->re * $val, $this->im * $val);
|
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
|
* Div opperator
|
||||||
*
|
*
|
||||||
|
|
|
||||||
205
Math/Optimization/Simplex.php
Normal file
205
Math/Optimization/Simplex.php
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Karaka
|
||||||
|
*
|
||||||
|
* PHP Version 8.1
|
||||||
|
*
|
||||||
|
* @package phpOMS\Math\Optimization
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
// https://github.com/PetarV-/Algorithms/blob/master/Mathematical%20Algorithms/Simplex%20Algorithm.cpp
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simplex class.
|
||||||
|
*
|
||||||
|
* @package phpOMS\Math\Optimization
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Simplex {
|
||||||
|
private array $function = [];
|
||||||
|
private string $functionType = '';
|
||||||
|
private int|float $functionLimit = 0.0;
|
||||||
|
|
||||||
|
private array $constraints = [];
|
||||||
|
private array $constraintsType = [];
|
||||||
|
private array $constraintsLimit = [];
|
||||||
|
|
||||||
|
private array $slackForm = [];
|
||||||
|
|
||||||
|
private array $nonbasicSolution = [];
|
||||||
|
private array $basicSolution = [];
|
||||||
|
|
||||||
|
public function setFunction(array $function)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addConstraint(array $function, string $type, float $limit)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function pivot(int $x, int $y)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function iterateSimplex()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function initialize() : bool
|
||||||
|
{
|
||||||
|
$k = -1;
|
||||||
|
$minLimit = -1;
|
||||||
|
|
||||||
|
$m = \count($this->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 [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -415,8 +415,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate100() : void
|
private function generate100() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 100 Continue');
|
$this->set('', 'HTTP/1.0 100 Continue');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 100 Continue');
|
$this->set('Status', '100 Continue');
|
||||||
\http_response_code(100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -429,8 +428,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate102() : void
|
private function generate102() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 102 Processing');
|
$this->set('', 'HTTP/1.0 102 Processing');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 102 Processing');
|
$this->set('Status', '102 Processing');
|
||||||
\http_response_code(102);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -443,8 +441,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate200() : void
|
private function generate200() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 200 OK');
|
$this->set('', 'HTTP/1.0 200 OK');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 200 OK');
|
$this->set('Status', '200 OK');
|
||||||
\http_response_code(200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -457,8 +454,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate201() : void
|
private function generate201() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 201 Created');
|
$this->set('', 'HTTP/1.0 201 Created');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 201 Created');
|
$this->set('Status', '201 Created');
|
||||||
\http_response_code(201);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -471,8 +467,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate202() : void
|
private function generate202() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 202 Accepted');
|
$this->set('', 'HTTP/1.0 202 Accepted');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 202 Accepted');
|
$this->set('Status', '202 Accepted');
|
||||||
\http_response_code(202);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -485,8 +480,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate204() : void
|
private function generate204() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 204 No Content');
|
$this->set('', 'HTTP/1.0 204 No Content');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 204 No Content');
|
$this->set('Status', '204 No Content');
|
||||||
\http_response_code(204);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -499,8 +493,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate205() : void
|
private function generate205() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 205 Reset Content');
|
$this->set('', 'HTTP/1.0 205 Reset Content');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 205 Reset Content');
|
$this->set('Status', '205 Reset Content');
|
||||||
\http_response_code(205);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -513,8 +506,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate206() : void
|
private function generate206() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 206 Partial Content');
|
$this->set('', 'HTTP/1.0 206 Partial Content');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 206 Partial Content');
|
$this->set('Status', '206 Partial Content');
|
||||||
\http_response_code(206);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -527,8 +519,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate301() : void
|
private function generate301() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 301 Moved Permanently');
|
$this->set('', 'HTTP/1.0 301 Moved Permanently');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 301 Moved Permanently');
|
$this->set('Status', '301 Moved Permanently');
|
||||||
\http_response_code(301);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -541,8 +532,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate302() : void
|
private function generate302() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 302 Found');
|
$this->set('', 'HTTP/1.0 302 Found');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 302 Found');
|
$this->set('Status', '302 Found');
|
||||||
\http_response_code(302);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -555,8 +545,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate303() : void
|
private function generate303() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 303 See Other');
|
$this->set('', 'HTTP/1.0 303 See Other');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 303 See Other');
|
$this->set('Status', '303 See Other');
|
||||||
\http_response_code(303);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -569,8 +558,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate304() : void
|
private function generate304() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 304 Not Modified');
|
$this->set('', 'HTTP/1.0 304 Not Modified');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 304 Not Modified');
|
$this->set('Status', '304 Not Modified');
|
||||||
\http_response_code(304);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -583,8 +571,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate307() : void
|
private function generate307() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 307 Temporary Redirect');
|
$this->set('', 'HTTP/1.0 307 Temporary Redirect');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 307 Temporary Redirect');
|
$this->set('Status', '307 Temporary Redirect');
|
||||||
\http_response_code(307);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -597,8 +584,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate308() : void
|
private function generate308() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 308 Permanent Redirect');
|
$this->set('', 'HTTP/1.0 308 Permanent Redirect');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 308 Permanent Redirect');
|
$this->set('Status', '308 Permanent Redirect');
|
||||||
\http_response_code(308);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -611,8 +597,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate400() : void
|
private function generate400() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 400 Bad Request');
|
$this->set('', 'HTTP/1.0 400 Bad Request');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 400 Bad Request');
|
$this->set('Status', '400 Bad Request');
|
||||||
\http_response_code(400);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -625,8 +610,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate401() : void
|
private function generate401() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 401 Unauthorized');
|
$this->set('', 'HTTP/1.0 401 Unauthorized');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 401 Unauthorized');
|
$this->set('Status', '401 Unauthorized');
|
||||||
\http_response_code(401);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -639,8 +623,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate402() : void
|
private function generate402() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 402 Payment Required');
|
$this->set('', 'HTTP/1.0 402 Payment Required');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 402 Payment Required');
|
$this->set('Status', '402 Payment Required');
|
||||||
\http_response_code(402);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -653,8 +636,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate403() : void
|
private function generate403() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 403 Forbidden');
|
$this->set('', 'HTTP/1.0 403 Forbidden');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 403 Forbidden');
|
$this->set('Status', '403 Forbidden');
|
||||||
\http_response_code(403);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -667,8 +649,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate404() : void
|
private function generate404() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 404 Not Found');
|
$this->set('', 'HTTP/1.0 404 Not Found');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 404 Not Found');
|
$this->set('Status', '404 Not Found');
|
||||||
\http_response_code(404);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -681,8 +662,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate405() : void
|
private function generate405() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 405 Method Not Allowed');
|
$this->set('', 'HTTP/1.0 405 Method Not Allowed');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 405 Method Not Allowed');
|
$this->set('Status', '405 Method Not Allowed');
|
||||||
\http_response_code(405);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -695,8 +675,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate406() : void
|
private function generate406() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 406 Not acceptable');
|
$this->set('', 'HTTP/1.0 406 Not acceptable');
|
||||||
$this->set('Status', 'Status: 406 Not acceptable');
|
$this->set('Status', '406 Not acceptable');
|
||||||
\http_response_code(406);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -709,8 +688,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate407() : void
|
private function generate407() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 407 Proxy Authentication Required');
|
$this->set('', 'HTTP/1.0 407 Proxy Authentication Required');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 407 Proxy Authentication Required');
|
$this->set('Status', '407 Proxy Authentication Required');
|
||||||
\http_response_code(407);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -723,8 +701,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate408() : void
|
private function generate408() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 408 Request Timeout');
|
$this->set('', 'HTTP/1.0 408 Request Timeout');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 408 Request Timeout');
|
$this->set('Status', '408 Request Timeout');
|
||||||
\http_response_code(408);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -737,8 +714,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate409() : void
|
private function generate409() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 409 Conflict');
|
$this->set('', 'HTTP/1.0 409 Conflict');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 409 Conflict');
|
$this->set('Status', '409 Conflict');
|
||||||
\http_response_code(409);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -751,8 +727,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate410() : void
|
private function generate410() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 410 Gone');
|
$this->set('', 'HTTP/1.0 410 Gone');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 410 Gone');
|
$this->set('Status', '410 Gone');
|
||||||
\http_response_code(410);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -765,8 +740,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate411() : void
|
private function generate411() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 411 Length Required');
|
$this->set('', 'HTTP/1.0 411 Length Required');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 411 Length Required');
|
$this->set('Status', '411 Length Required');
|
||||||
\http_response_code(411);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -779,8 +753,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate412() : void
|
private function generate412() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 412 Precondition Failed');
|
$this->set('', 'HTTP/1.0 412 Precondition Failed');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 412 Precondition Failed');
|
$this->set('Status', '412 Precondition Failed');
|
||||||
\http_response_code(412);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -793,8 +766,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate413() : void
|
private function generate413() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 413 Request Entity Too Large');
|
$this->set('', 'HTTP/1.0 413 Request Entity Too Large');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 413 Request Entity Too Large');
|
$this->set('Status', '413 Request Entity Too Large');
|
||||||
\http_response_code(413);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -807,8 +779,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate414() : void
|
private function generate414() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 414 Request-URI Too Long');
|
$this->set('', 'HTTP/1.0 414 Request-URI Too Long');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 414 Request-URI Too Long');
|
$this->set('Status', '414 Request-URI Too Long');
|
||||||
\http_response_code(414);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -821,8 +792,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate415() : void
|
private function generate415() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 415 Unsupported Media Type');
|
$this->set('', 'HTTP/1.0 415 Unsupported Media Type');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 415 Unsupported Media Type');
|
$this->set('Status', '415 Unsupported Media Type');
|
||||||
\http_response_code(415);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -835,8 +805,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate416() : void
|
private function generate416() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 416 Requested Range Not Satisfiable');
|
$this->set('', 'HTTP/1.0 416 Requested Range Not Satisfiable');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 416 Requested Range Not Satisfiable');
|
$this->set('Status', '416 Requested Range Not Satisfiable');
|
||||||
\http_response_code(416);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -849,8 +818,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate417() : void
|
private function generate417() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 417 Expectation Failed');
|
$this->set('', 'HTTP/1.0 417 Expectation Failed');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 417 Expectation Failed');
|
$this->set('Status', '417 Expectation Failed');
|
||||||
\http_response_code(417);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -863,8 +831,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate421() : void
|
private function generate421() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 421 Misdirected Request');
|
$this->set('', 'HTTP/1.0 421 Misdirected Request');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 421 Misdirected Request');
|
$this->set('Status', '421 Misdirected Request');
|
||||||
\http_response_code(421);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -877,8 +844,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate422() : void
|
private function generate422() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 422 Unprocessable Entity');
|
$this->set('', 'HTTP/1.0 422 Unprocessable Entity');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 422 Unprocessable Entity');
|
$this->set('Status', '422 Unprocessable Entity');
|
||||||
\http_response_code(422);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -891,8 +857,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate423() : void
|
private function generate423() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 423 Locked');
|
$this->set('', 'HTTP/1.0 423 Locked');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 423 Locked');
|
$this->set('Status', '423 Locked');
|
||||||
\http_response_code(423);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -905,8 +870,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate424() : void
|
private function generate424() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 424 Failed Dependency');
|
$this->set('', 'HTTP/1.0 424 Failed Dependency');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 424 Failed Dependency');
|
$this->set('Status', '424 Failed Dependency');
|
||||||
\http_response_code(424);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -919,8 +883,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate425() : void
|
private function generate425() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 425 Too Early');
|
$this->set('', 'HTTP/1.0 425 Too Early');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 425 Too Early');
|
$this->set('Status', '425 Too Early');
|
||||||
\http_response_code(425);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -933,8 +896,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate426() : void
|
private function generate426() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 426 Upgrade Required');
|
$this->set('', 'HTTP/1.0 426 Upgrade Required');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 426 Upgrade Required');
|
$this->set('Status', '426 Upgrade Required');
|
||||||
\http_response_code(426);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -947,8 +909,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate428() : void
|
private function generate428() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 428 Precondition Required');
|
$this->set('', 'HTTP/1.0 428 Precondition Required');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 428 Precondition Required');
|
$this->set('Status', '428 Precondition Required');
|
||||||
\http_response_code(428);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -961,8 +922,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate429() : void
|
private function generate429() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 429 Too Many Requests');
|
$this->set('', 'HTTP/1.0 429 Too Many Requests');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 429 Too Many Requests');
|
$this->set('Status', '429 Too Many Requests');
|
||||||
\http_response_code(429);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -975,8 +935,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate431() : void
|
private function generate431() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 431 Request Header Fields Too Large');
|
$this->set('', 'HTTP/1.0 431 Request Header Fields Too Large');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 431 Request Header Fields Too Large');
|
$this->set('Status', '431 Request Header Fields Too Large');
|
||||||
\http_response_code(431);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -989,8 +948,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate451() : void
|
private function generate451() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 451 Unavailable For Legal Reasons');
|
$this->set('', 'HTTP/1.0 451 Unavailable For Legal Reasons');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 451 Unavailable For Legal Reasons');
|
$this->set('Status', '451 Unavailable For Legal Reasons');
|
||||||
\http_response_code(451);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1003,8 +961,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate500() : void
|
private function generate500() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 500 Internal Server Error');
|
$this->set('', 'HTTP/1.0 500 Internal Server Error');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 500 Internal Server Error');
|
$this->set('Status', '500 Internal Server Error');
|
||||||
\http_response_code(500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1017,8 +974,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate501() : void
|
private function generate501() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 501 Not Implemented');
|
$this->set('', 'HTTP/1.0 501 Not Implemented');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 501 Not Implemented');
|
$this->set('Status', '501 Not Implemented');
|
||||||
\http_response_code(501);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1031,8 +987,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate502() : void
|
private function generate502() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 502 Bad Gateway');
|
$this->set('', 'HTTP/1.0 502 Bad Gateway');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 502 Bad Gateway');
|
$this->set('Status', '502 Bad Gateway');
|
||||||
\http_response_code(502);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1045,9 +1000,8 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate503() : void
|
private function generate503() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 503 Service Temporarily Unavailable');
|
$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');
|
$this->set('Retry-After', 'Retry-After: 300');
|
||||||
\http_response_code(503);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1060,8 +1014,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate504() : void
|
private function generate504() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 504 Gateway Timeout');
|
$this->set('', 'HTTP/1.0 504 Gateway Timeout');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 504 Gateway Timeout');
|
$this->set('Status', '504 Gateway Timeout');
|
||||||
\http_response_code(504);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1074,8 +1027,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate507() : void
|
private function generate507() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 507 Insufficient Storage');
|
$this->set('', 'HTTP/1.0 507 Insufficient Storage');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 507 Insufficient Storage');
|
$this->set('Status', '507 Insufficient Storage');
|
||||||
\http_response_code(507);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1088,8 +1040,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate508() : void
|
private function generate508() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 508 Loop Detected');
|
$this->set('', 'HTTP/1.0 508 Loop Detected');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 508 Loop Detected');
|
$this->set('Status', '508 Loop Detected');
|
||||||
\http_response_code(508);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1102,8 +1053,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate511() : void
|
private function generate511() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 511 Network Authentication Required');
|
$this->set('', 'HTTP/1.0 511 Network Authentication Required');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 511 Network Authentication Required');
|
$this->set('Status', '511 Network Authentication Required');
|
||||||
\http_response_code(511);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1116,8 +1066,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate598() : void
|
private function generate598() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 598 Network read timeout error');
|
$this->set('', 'HTTP/1.0 598 Network read timeout error');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 598 Network read timeout error');
|
$this->set('Status', '598 Network read timeout error');
|
||||||
\http_response_code(598);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1130,7 +1079,6 @@ final class HttpHeader extends HeaderAbstract
|
||||||
private function generate599() : void
|
private function generate599() : void
|
||||||
{
|
{
|
||||||
$this->set('', 'HTTP/1.0 599 Network connect timeout error');
|
$this->set('', 'HTTP/1.0 599 Network connect timeout error');
|
||||||
$this->set('Status', 'Status: HTTP/1.0 599 Network connect timeout error');
|
$this->set('Status', '599 Network connect timeout error');
|
||||||
\http_response_code(599);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -339,6 +339,10 @@ final class PackageManager
|
||||||
*/
|
*/
|
||||||
private function authenticate(string $signedHash, string $rawHash) : bool
|
private function authenticate(string $signedHash, string $rawHash) : bool
|
||||||
{
|
{
|
||||||
|
if ($signedHash === '' || $rawHash === '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return \sodium_crypto_sign_verify_detached($signedHash, $rawHash, $this->publicKey);
|
return \sodium_crypto_sign_verify_detached($signedHash, $rawHash, $this->publicKey);
|
||||||
} catch(\Throwable $t) {
|
} catch(\Throwable $t) {
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,11 @@ final class Guard
|
||||||
if (\is_array($data)) {
|
if (\is_array($data)) {
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($data as $key => $value) {
|
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;
|
return $result;
|
||||||
|
|
|
||||||
|
|
@ -771,10 +771,10 @@ class Datamatrix extends TwoDAbstract
|
||||||
} elseif (isset($chr, self::CHARSET['SH2'][$chr])) {
|
} elseif (isset($chr, self::CHARSET['SH2'][$chr])) {
|
||||||
$temp_cw[] = 1; // shift 2
|
$temp_cw[] = 1; // shift 2
|
||||||
$shiftset = self::CHARSET['SH2'];
|
$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
|
$temp_cw[] = 2; // shift 3
|
||||||
$shiftset = self::CHARSET['S3C'];
|
$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
|
$temp_cw[] = 2; // shift 3
|
||||||
$shiftset = self::CHARSET['S3T'];
|
$shiftset = self::CHARSET['S3T'];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,9 @@ final class ImageUtils
|
||||||
$diff = empty($out) ? -1 : $out;
|
$diff = empty($out) ? -1 : $out;
|
||||||
$dst = false;
|
$dst = false;
|
||||||
|
|
||||||
|
$red = 0;
|
||||||
|
$green = 0;
|
||||||
|
|
||||||
if ($diff !== -1) {
|
if ($diff !== -1) {
|
||||||
$dst = $diff === 0
|
$dst = $diff === 0
|
||||||
? \imagecreatetruecolor($newDim[0], $newDim[1])
|
? \imagecreatetruecolor($newDim[0], $newDim[1])
|
||||||
|
|
@ -246,12 +249,20 @@ final class ImageUtils
|
||||||
for ($j = 0; $j < $newDim[1]; ++$j) {
|
for ($j = 0; $j < $newDim[1]; ++$j) {
|
||||||
if ($i >= $imageDim1[0] || $j >= $imageDim1[1]) {
|
if ($i >= $imageDim1[0] || $j >= $imageDim1[1]) {
|
||||||
if ($diff === 0) {
|
if ($diff === 0) {
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $green);
|
\imagesetpixel($dst, $i, $j, $green);
|
||||||
} elseif ($diff === 1) {
|
} elseif ($diff === 1) {
|
||||||
if ($i >= $imageDim2[0] || $j >= $imageDim2[1]) {
|
if ($i >= $imageDim2[0] || $j >= $imageDim2[1]) {
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $green);
|
\imagesetpixel($dst, $i, $j, $green);
|
||||||
} else {
|
} else {
|
||||||
$color2 = \imagecolorat($src2, $i, $j);
|
$color2 = \imagecolorat($src2, $i, $j);
|
||||||
|
|
||||||
|
if ($color2 === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $color2);
|
\imagesetpixel($dst, $i, $j, $color2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -262,12 +273,20 @@ final class ImageUtils
|
||||||
|
|
||||||
if ($i >= $imageDim2[0] || $j >= $imageDim2[1]) {
|
if ($i >= $imageDim2[0] || $j >= $imageDim2[1]) {
|
||||||
if ($diff === 0) {
|
if ($diff === 0) {
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $red);
|
\imagesetpixel($dst, $i, $j, $red);
|
||||||
} elseif ($diff === 1) {
|
} elseif ($diff === 1) {
|
||||||
if ($i >= $imageDim1[0] || $j >= $imageDim1[1]) {
|
if ($i >= $imageDim1[0] || $j >= $imageDim1[1]) {
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $red);
|
\imagesetpixel($dst, $i, $j, $red);
|
||||||
} else {
|
} else {
|
||||||
$color1 = \imagecolorat($src1, $i, $j);
|
$color1 = \imagecolorat($src1, $i, $j);
|
||||||
|
|
||||||
|
if ($color1 === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $color1);
|
\imagesetpixel($dst, $i, $j, $color1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -279,12 +298,14 @@ final class ImageUtils
|
||||||
$color1 = \imagecolorat($src1, $i, $j);
|
$color1 = \imagecolorat($src1, $i, $j);
|
||||||
$color2 = \imagecolorat($src2, $i, $j);
|
$color2 = \imagecolorat($src2, $i, $j);
|
||||||
|
|
||||||
if ($color1 !== $color2 && $color1 !== false && $color2 !== null) {
|
if ($color1 !== $color2 && $color1 !== false && $color2 !== false) {
|
||||||
++$difference;
|
++$difference;
|
||||||
|
|
||||||
if ($diff === 0) {
|
if ($diff === 0) {
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $color2);
|
\imagesetpixel($dst, $i, $j, $color2);
|
||||||
} elseif ($diff === 1) {
|
} elseif ($diff === 1) {
|
||||||
|
/** @var \GdImage $dst */
|
||||||
\imagesetpixel($dst, $i, $j, $green);
|
\imagesetpixel($dst, $i, $j, $green);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,4 +102,11 @@ class TaskScheduler extends SchedulerAbstract
|
||||||
|
|
||||||
return $jobs;
|
return $jobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function reload() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,19 +41,6 @@ final class AccountManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->account->generatePassword('abcd');
|
$this->account->generatePassword('abcd');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @testdox The manager has the expected member variables
|
|
||||||
* @covers phpOMS\Account\AccountManager<extended>
|
|
||||||
* @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
|
* @testdox The manager has the expected default values after initialization
|
||||||
* @covers phpOMS\Account\AccountManager<extended>
|
* @covers phpOMS\Account\AccountManager<extended>
|
||||||
|
|
|
||||||
|
|
@ -43,33 +43,6 @@ final class AccountTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->l11nManager = new L11nManager('Api');
|
$this->l11nManager = new L11nManager('Api');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @testdox The account has the expected member variables
|
|
||||||
* @covers phpOMS\Account\Account<extended>
|
|
||||||
* @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
|
* @testdox The account has the expected default values after initialization
|
||||||
* @covers phpOMS\Account\Account<extended>
|
* @covers phpOMS\Account\Account<extended>
|
||||||
|
|
|
||||||
|
|
@ -28,26 +28,6 @@ require_once __DIR__ . '/../Autoloader.php';
|
||||||
*/
|
*/
|
||||||
final class GroupTest extends \PHPUnit\Framework\TestCase
|
final class GroupTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @testdox The group has the expected member variables
|
|
||||||
* @covers phpOMS\Account\Group<extended>
|
|
||||||
* @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
|
* @testdox The group has the expected default values after initialization
|
||||||
* @covers phpOMS\Account\Group<extended>
|
* @covers phpOMS\Account\Group<extended>
|
||||||
|
|
|
||||||
|
|
@ -35,18 +35,6 @@ final class AssetManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->manager = new AssetManager();
|
$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
|
* @testdox The manager has the expected default values after initialization
|
||||||
* @group framework
|
* @group framework
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,6 @@ require_once __DIR__ . '/../Autoloader.php';
|
||||||
*/
|
*/
|
||||||
final class OptionsTraitTest extends \PHPUnit\Framework\TestCase
|
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
|
* @testdox The option helper has the expected default values after initialization
|
||||||
* @group framework
|
* @group framework
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testMysqlCreateTable() : void
|
public function testMysqlCreateTable() : void
|
||||||
{
|
{
|
||||||
$query = new Builder($this->con);
|
$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(
|
self::assertEquals(
|
||||||
$sql,
|
$sql,
|
||||||
$query->createTable('user_roles')
|
$query->createTable('user_roles')
|
||||||
|
|
|
||||||
|
|
@ -47,16 +47,6 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->app->dispatcher = new Dispatcher($this->app);
|
$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
|
* @testdox A route can be added and dispatched
|
||||||
* @covers phpOMS\Dispatcher\Dispatcher
|
* @covers phpOMS\Dispatcher\Dispatcher
|
||||||
|
|
|
||||||
|
|
@ -35,17 +35,6 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->event = new EventManager();
|
$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
|
* @testdox The event manager has the expected default values after initialization
|
||||||
* @covers phpOMS\Event\EventManager
|
* @covers phpOMS\Event\EventManager
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,4 @@ final class ISO3166NumEnumTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
self::assertTrue($ok);
|
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()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,16 +37,6 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->l11nManager = new L11nManager('Api');
|
$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
|
* @testdox The localization manager has the expected default values after initialization
|
||||||
* @covers phpOMS\Localization\L11nManager
|
* @covers phpOMS\Localization\L11nManager
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,7 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testDefaultMemberVariables() : void
|
public function testDefaultMemberVariables() : void
|
||||||
{
|
{
|
||||||
$money = new Money(0);
|
$money = new Money(0);
|
||||||
self::assertObjectHasAttribute('thousands', $money);
|
|
||||||
self::assertObjectHasAttribute('decimal', $money);
|
|
||||||
self::assertObjectHasAttribute('value', $money);
|
|
||||||
|
|
||||||
self::assertGreaterThan(0, Money::MAX_DECIMALS);
|
self::assertGreaterThan(0, Money::MAX_DECIMALS);
|
||||||
|
|
||||||
self::assertEquals(0, $money->getInt());
|
self::assertEquals(0, $money->getInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
* @testdox The logger has the expected default values after initialization
|
||||||
* @covers phpOMS\Log\FileLogger
|
* @covers phpOMS\Log\FileLogger
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ final class RequestStatusCodeTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testEnumCount() : void
|
public function testEnumCount() : void
|
||||||
{
|
{
|
||||||
self::assertCount(55, RequestStatusCode::getConstants());
|
self::assertCount(63, RequestStatusCode::getConstants());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ final class RequestStatusTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testEnumCount() : void
|
public function testEnumCount() : void
|
||||||
{
|
{
|
||||||
self::assertCount(55, RequestStatus::getConstants());
|
self::assertCount(58, RequestStatus::getConstants());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -22,22 +22,6 @@ use phpOMS\Model\Message\DomAction;
|
||||||
*/
|
*/
|
||||||
final class DomTest extends \PHPUnit\Framework\TestCase
|
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
|
* @covers phpOMS\Model\Message\Dom
|
||||||
* @group framework
|
* @group framework
|
||||||
|
|
|
||||||
|
|
@ -21,19 +21,6 @@ use phpOMS\Model\Message\FormValidation;
|
||||||
*/
|
*/
|
||||||
final class FormValidationTest extends \PHPUnit\Framework\TestCase
|
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
|
* @covers phpOMS\Model\Message\FormValidation
|
||||||
* @group framework
|
* @group framework
|
||||||
|
|
|
||||||
|
|
@ -22,23 +22,6 @@ use phpOMS\Model\Message\NotifyType;
|
||||||
*/
|
*/
|
||||||
final class NotifyTest extends \PHPUnit\Framework\TestCase
|
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
|
* @covers phpOMS\Model\Message\Notify
|
||||||
* @group framework
|
* @group framework
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ final class NotifyTypeTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testEnumCount() : void
|
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
|
public function testEnums() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(0, NotifyType::BINARY);
|
self::assertEquals('binary', NotifyType::BINARY);
|
||||||
self::assertEquals(1, NotifyType::INFO);
|
self::assertEquals('info', NotifyType::INFO);
|
||||||
self::assertEquals(2, NotifyType::WARNING);
|
self::assertEquals('warning', NotifyType::WARNING);
|
||||||
self::assertEquals(3, NotifyType::ERROR);
|
self::assertEquals('error', NotifyType::ERROR);
|
||||||
self::assertEquals(4, NotifyType::FATAL);
|
self::assertEquals('fatal', NotifyType::FATAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,21 +21,6 @@ use phpOMS\Model\Message\Redirect;
|
||||||
*/
|
*/
|
||||||
final class RedirectTest extends \PHPUnit\Framework\TestCase
|
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
|
* @covers phpOMS\Model\Message\Redirect
|
||||||
* @group framework
|
* @group framework
|
||||||
|
|
|
||||||
|
|
@ -21,19 +21,6 @@ use phpOMS\Model\Message\Reload;
|
||||||
*/
|
*/
|
||||||
final class ReloadTest extends \PHPUnit\Framework\TestCase
|
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
|
* @covers phpOMS\Model\Message\Reload
|
||||||
* @group framework
|
* @group framework
|
||||||
|
|
|
||||||
|
|
@ -57,22 +57,6 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');
|
$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
|
* @testdox Unknown modules return a null module
|
||||||
* @covers phpOMS\Module\ModuleManager
|
* @covers phpOMS\Module\ModuleManager
|
||||||
|
|
|
||||||
|
|
@ -34,18 +34,6 @@ final class AddressTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->address = new Address();
|
$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
|
* @testdox The address has the expected default values after initialization
|
||||||
* @covers phpOMS\Stdlib\Base\Address
|
* @covers phpOMS\Stdlib\Base\Address
|
||||||
|
|
|
||||||
|
|
@ -34,21 +34,6 @@ final class LocationTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->location = new Location();
|
$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
|
* @testdox The location has the expected default values after initialization
|
||||||
* @covers phpOMS\Stdlib\Base\Location
|
* @covers phpOMS\Stdlib\Base\Location
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user