diff --git a/Algorithm/Knapsack/Backpack.php b/Algorithm/Knapsack/Backpack.php index 4275e3ef4..1ebf11b6a 100644 --- a/Algorithm/Knapsack/Backpack.php +++ b/Algorithm/Knapsack/Backpack.php @@ -52,7 +52,7 @@ class Backpack implements BackpackInterface /** * Items inside the backpack * - * @var ItemInterface[] + * @var array * @since 1.0.0 */ private array $items = []; diff --git a/Business/Finance/FinanceFormulas.php b/Business/Finance/FinanceFormulas.php index 88c21818f..47c4f28ce 100644 --- a/Business/Finance/FinanceFormulas.php +++ b/Business/Finance/FinanceFormulas.php @@ -952,7 +952,7 @@ final class FinanceFormulas * * Also known as compounded annual growth rate. * - * @param array $r Rate of return + * @param array $r Rate of return * * @return float * @@ -1080,7 +1080,7 @@ final class FinanceFormulas /** * Net Present Value * - * @param array $C Cash flow ($C[0] = initial investment) + * @param array $C Cash flow ($C[0] = initial investment) * @param float $r Discount rate * * @return float diff --git a/Business/Finance/Lorenzkurve.php b/Business/Finance/Lorenzkurve.php index 30d97c7e2..fa87d1037 100644 --- a/Business/Finance/Lorenzkurve.php +++ b/Business/Finance/Lorenzkurve.php @@ -37,7 +37,7 @@ final class Lorenzkurve /** * Calculate Gini coefficient * - * @param array $data Datapoints (can be unsorted) + * @param array $data Datapoints (can be unsorted) * * @return float Returns the gini coefficient * diff --git a/Business/Finance/StockBonds.php b/Business/Finance/StockBonds.php index 4fd35ba9c..33fcc2fb8 100644 --- a/Business/Finance/StockBonds.php +++ b/Business/Finance/StockBonds.php @@ -208,7 +208,7 @@ final class StockBonds /** * Holding Period Return * - * @param array $r Rate of return + * @param array $r Rate of return * * @return float * diff --git a/Localization/Money.php b/Localization/Money.php index f35d1fa1a..9e910b745 100644 --- a/Localization/Money.php +++ b/Localization/Money.php @@ -75,7 +75,7 @@ final class Money implements \Serializable /** * Constructor. * - * @param float|int|string $value Value + * @param int|float|string $value Value * @param string $thousands Thousands separator * @param string $decimal Decimal separator * @param string $symbol Currency symbol @@ -208,7 +208,7 @@ final class Money implements \Serializable /** * Add money. * - * @param float|int|Money|string $value Value to add + * @param int|float|Money|string $value Value to add * * @return Money * @@ -242,7 +242,7 @@ final class Money implements \Serializable /** * Sub money. * - * @param float|int|Money|string $value Value to subtract + * @param int|float|Money|string $value Value to subtract * * @return Money * @@ -264,7 +264,7 @@ final class Money implements \Serializable /** * Mult. * - * @param float|int $value Value to multiply with + * @param int|float $value Value to multiply with * * @return Money * @@ -282,7 +282,7 @@ final class Money implements \Serializable /** * Div. * - * @param float|int $value Value to divide by + * @param int|float $value Value to divide by * * @return Money * @@ -314,7 +314,7 @@ final class Money implements \Serializable /** * Power. * - * @param float|int $value Value to power + * @param int|float $value Value to power * * @return Money * diff --git a/Math/Geometry/ConvexHull/MonotoneChain.php b/Math/Geometry/ConvexHull/MonotoneChain.php index f19d90a7e..851c80843 100644 --- a/Math/Geometry/ConvexHull/MonotoneChain.php +++ b/Math/Geometry/ConvexHull/MonotoneChain.php @@ -37,9 +37,9 @@ final class MonotoneChain /** * Create convex hull * - * @param array $points Points (Point Cloud) + * @param array $points Points (Point Cloud) * - * @return array + * @return array * * @since 1.0.0 */ @@ -80,9 +80,9 @@ final class MonotoneChain /** * Counter clock wise turn? * - * @param array{x:float|int, y:float|int} $a Point a - * @param array{x:float|int, y:float|int} $b Point b - * @param array{x:float|int, y:float|int} $c Point c + * @param array{x:int|float, y:int|float} $a Point a + * @param array{x:int|float, y:int|float} $b Point b + * @param array{x:int|float, y:int|float} $c Point c * * @return float * @@ -96,8 +96,8 @@ final class MonotoneChain /** * Sort by x coordinate then by z coordinate * - * @param array{x:float|int, y:float|int} $a Point a - * @param array{x:float|int, y:float|int} $b Point b + * @param array{x:int|float, y:int|float} $a Point a + * @param array{x:int|float, y:int|float} $b Point b * * @return float * diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index 5ac663b12..d53db1642 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -79,9 +79,9 @@ class Matrix implements \ArrayAccess, \Iterator /** * Set value. * - * @param int $m Row - * @param int $n Column - * @param int $value Value + * @param int $m Row + * @param int $n Column + * @param int|float $value Value * * @return void * @@ -336,7 +336,7 @@ class Matrix implements \ArrayAccess, \Iterator /** * Set matrix array. * - * @param array> $matrix Matrix + * @param array> $matrix Matrix * * @return Matrix * @@ -591,7 +591,7 @@ class Matrix implements \ArrayAccess, \Iterator /** * Trianglize matrix. * - * @param array> $arr Matrix to trianglize + * @param array> $arr Matrix to trianglize * * @return int Det sign * diff --git a/Math/Number/Integer.php b/Math/Number/Integer.php index b129a0fd0..92b902717 100644 --- a/Math/Number/Integer.php +++ b/Math/Number/Integer.php @@ -53,7 +53,7 @@ final class Integer * * @param int $value Integer to factorize * - * @return array + * @return array * * @since 1.0.0 */ diff --git a/Math/Numerics/Interpolation/InterpolationInterface.php b/Math/Numerics/Interpolation/InterpolationInterface.php index 2e4ac316b..8d8ffc3b6 100644 --- a/Math/Numerics/Interpolation/InterpolationInterface.php +++ b/Math/Numerics/Interpolation/InterpolationInterface.php @@ -27,7 +27,7 @@ interface InterpolationInterface /** * Interpolation at a given point * - * @param float|int $x X-Coordinate to interpolate at + * @param int|float $x X-Coordinate to interpolate at * * @return float * diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index f4653500b..0e1cca9ab 100644 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -52,7 +52,7 @@ final class Average /** * Average change. * - * @param array $x Dataset + * @param array $x Dataset * @param int $h Future steps * * @return float @@ -69,9 +69,9 @@ final class Average /** * Moving average of dataset (SMA) * - * @param array $x Dataset + * @param array $x Dataset * @param int $order Periods to use for average - * @param array $weight Weight for moving average + * @param array $weight Weight for moving average * @param bool $symmetric Cyclic moving average * * @return float[] Moving average of data @@ -96,10 +96,10 @@ final class Average /** * Moving average of element in dataset (SMA) * - * @param array $x Dataset + * @param array $x Dataset * @param int $t Current period * @param int $order Periods to use for average - * @param array $weight Weight for moving average + * @param array $weight Weight for moving average * @param bool $symmetric Cyclic moving average * * @return float Moving average @@ -133,8 +133,8 @@ final class Average * * Example: ([1, 2, 3, 4], [0.25, 0.5, 0.125, 0.125]) * - * @param array $values Values - * @param array $weight Weight for values + * @param array $values Values + * @param array $weight Weight for values * * @return float * @@ -162,7 +162,7 @@ final class Average * * Example: ([1, 2, 2, 3, 4, 4, 2]) * - * @param array $values Values + * @param array $values Values * * @return float * @@ -186,7 +186,7 @@ final class Average * * Example: ([1, 2, 2, 3, 4, 4, 2]) * - * @param array $values Values + * @param array $values Values * * @return float * @@ -205,7 +205,7 @@ final class Average * * Example: ([1, 2, 2, 3, 4, 4, 2]) * - * @param array $values Values + * @param array $values Values * * @return float * @@ -233,7 +233,7 @@ final class Average * * Example: ([1, 2, 2, 3, 4, 4, 2]) * - * @param array $values Values + * @param array $values Values * @param int $offset Offset for outlier * * @return float @@ -258,7 +258,7 @@ final class Average * * Example: ([1, 2, 2, 3, 4, 4, 2]) * - * @param array $values Values + * @param array $values Values * @param int $offset Offset for outlier * * @return float @@ -302,7 +302,7 @@ final class Average * * Example: ([1, 2, 2, 3, 4, 4, 2]) * - * @param array $angles Angles + * @param array $angles Angles * @param int $offset Offset for outlier * * @return float @@ -331,7 +331,7 @@ final class Average * * Example: ([1, 2, 2, 3, 4, 4, 2]) * - * @param array $angles Angles + * @param array $angles Angles * @param int $offset Offset for outlier * * @return float diff --git a/Math/Statistic/Basic.php b/Math/Statistic/Basic.php index 0984fd993..4a0e3e2eb 100644 --- a/Math/Statistic/Basic.php +++ b/Math/Statistic/Basic.php @@ -39,9 +39,9 @@ final class Basic * * Example: ([4, 5, 9, 1, 3]) * - * @param array $values Values + * @param array $values Values * - * @return array + * @return array * * @since 1.0.0 */ diff --git a/Math/Statistic/Correlation.php b/Math/Statistic/Correlation.php index effd5e7fe..470e0dab8 100644 --- a/Math/Statistic/Correlation.php +++ b/Math/Statistic/Correlation.php @@ -39,8 +39,8 @@ final class Correlation * * Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3]) * - * @param array $x Values - * @param array $y Values + * @param array $x Values + * @param array $y Values * * @return float * @@ -54,7 +54,7 @@ final class Correlation /** * Get the autocorrelation coefficient (ACF). * - * @param array $x Dataset + * @param array $x Dataset * @param int $k k-th coefficient * * @return float diff --git a/Math/Statistic/Forecast/Forecasts.php b/Math/Statistic/Forecast/Forecasts.php index 3990ba561..6373fbab5 100644 --- a/Math/Statistic/Forecast/Forecasts.php +++ b/Math/Statistic/Forecast/Forecasts.php @@ -31,7 +31,7 @@ final class Forecasts * @param float $standardDeviation Standard Deviation of forecast * @param float $interval Forecast multiplier for prediction intervals * - * @return array + * @return array * * @since 1.0.0 */ diff --git a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php index 9d99ad351..be156bc9b 100644 --- a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php +++ b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php @@ -30,8 +30,8 @@ final class MultipleLinearRegression extends RegressionAbstract * * @latex y = b_{0} + b_{1} \cdot x * - * @param array> $x Obersved x values - * @param array> $y Observed y values + * @param array> $x Obersved x values + * @param array> $y Observed y values * * @return array [b0 => ?, b1 => ?] * diff --git a/Math/Statistic/Forecast/Regression/PolynomialRegression.php b/Math/Statistic/Forecast/Regression/PolynomialRegression.php index 8ad540780..731cdf582 100644 --- a/Math/Statistic/Forecast/Regression/PolynomialRegression.php +++ b/Math/Statistic/Forecast/Regression/PolynomialRegression.php @@ -30,8 +30,8 @@ final class PolynomialRegression /** * Get linear regression based on scatter plot. * - * @param array $x Obersved x values - * @param array $y Observed y values + * @param array $x Obersved x values + * @param array $y Observed y values * * @return array [a => ?, b => ?, c => ?] * diff --git a/Math/Statistic/Forecast/Regression/RegressionAbstract.php b/Math/Statistic/Forecast/Regression/RegressionAbstract.php index c5961169b..7bb3ff228 100644 --- a/Math/Statistic/Forecast/Regression/RegressionAbstract.php +++ b/Math/Statistic/Forecast/Regression/RegressionAbstract.php @@ -32,8 +32,8 @@ abstract class RegressionAbstract * * @latex y = b_{0} + b_{1} \cdot x * - * @param array $x Obersved x values - * @param array $y Observed y values + * @param array $x Obersved x values + * @param array $y Observed y values * * @return array [b0 => ?, b1 => ?] * @@ -59,7 +59,7 @@ abstract class RegressionAbstract * * @latex s_{e} = \sqrt{\frac{1}{N - 2}\sum_{i = 1}^{N} e_{i}^{2}} * - * @param array $errors Errors (e = y - y_forecasted) + * @param array $errors Errors (e = y - y_forecasted) * * @return float * @@ -84,7 +84,7 @@ abstract class RegressionAbstract * * @latex s_{e} = \sqrt{\frac{1}{N - 2}\sum_{i = 1}^{N} e_{i}^{2}} * - * @param array $errors Errors (e = y - y_forecasted) + * @param array $errors Errors (e = y - y_forecasted) * * @return float * @@ -109,11 +109,11 @@ abstract class RegressionAbstract * * @param float $fX Forecasted at x value * @param float $fY Forecasted y value - * @param array $x observex x values + * @param array $x observex x values * @param float $mse Errors for y values (y - y_forecasted) * @param float $multiplier Multiplier for interval * - * @return array + * @return array * * @since 1.0.0 */ @@ -137,8 +137,8 @@ abstract class RegressionAbstract * * @latex \beta_{1} = \frac{\sum_{i=1}^{N} \left(y_{i} - \bar{y}\right)\left(x_{i} - \bar{x}\right)}{\sum_{i=1}^{N} \left(x_{i} - \bar{x}\right)^{2}} * - * @param array $x Obersved x values - * @param array $y Observed y values + * @param array $x Obersved x values + * @param array $y Observed y values * * @return float * @@ -166,8 +166,8 @@ abstract class RegressionAbstract * * @latex \beta_{0} = \bar{x} - b_{1} \cdot \bar{x} * - * @param array $x Obersved x values - * @param array $y Observed y values + * @param array $x Obersved x values + * @param array $y Observed y values * @param float $b1 Beta 1 * * @return float diff --git a/Math/Statistic/MeasureOfDispersion.php b/Math/Statistic/MeasureOfDispersion.php index cd9ed8248..67af1f184 100644 --- a/Math/Statistic/MeasureOfDispersion.php +++ b/Math/Statistic/MeasureOfDispersion.php @@ -42,7 +42,7 @@ final class MeasureOfDispersion * * Example: ([4, 5, 9, 1, 3]) * - * @param array $values Values + * @param array $values Values * * @return float * @@ -62,7 +62,7 @@ final class MeasureOfDispersion * * Example: ([4, 5, 9, 1, 3]) * - * @param array $values Values + * @param array $values Values * @param float $mean Mean * * @return float @@ -89,7 +89,7 @@ final class MeasureOfDispersion * * @latex \sigma = \sqrt{\sigma^{2}} = \sqrt{Var(X)} * - * @param array $values Values + * @param array $values Values * @param float $mean Mean * * @return float @@ -117,7 +117,7 @@ final class MeasureOfDispersion * * @latex \sigma^{2} = Var(X) = \frac{1}{N - 1} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2} * - * @param array $values Values + * @param array $values Values * @param float $mean Mean * * @return float @@ -146,8 +146,8 @@ final class MeasureOfDispersion * * @latex \sigma^{2} = Var(X) = \frac{1}{N} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2} * - * @param array $values Values - * @param array $probabilities Probabilities + * @param array $values Values + * @param array $probabilities Probabilities * @param float $mean Mean * * @return float @@ -182,8 +182,8 @@ final class MeasureOfDispersion * * @latex \sigma_{XY} = cov(X, Y) = \sum_{i = 1}^{N}\frac{\left(x_{i} - \bar{X}\right) \left(y_{i} - \bar{Y}\right)}{N - 1} * - * @param array $x Values - * @param array $y Values + * @param array $x Values + * @param array $y Values * @param float $meanX Mean * @param float $meanY Mean * @@ -221,7 +221,7 @@ final class MeasureOfDispersion /** * Get interquartile range. * - * @param array $x Dataset + * @param array $x Dataset * * @return float * @@ -249,7 +249,7 @@ final class MeasureOfDispersion /** * Get mean deviation. * - * @param array $x Values + * @param array $x Values * @param float $mean Mean * @param int $offset Population/Size offset * @@ -272,7 +272,7 @@ final class MeasureOfDispersion /** * Get the deviation to the mean * - * @param array $x Values + * @param array $x Values * * @return array * @@ -292,7 +292,7 @@ final class MeasureOfDispersion /** * Get mean absolute deviation. * - * @param array $x Values + * @param array $x Values * @param float $mean Mean * @param int $offset Population/Size offset * @@ -315,7 +315,7 @@ final class MeasureOfDispersion /** * Get the deviation to the mean * - * @param array $x Values + * @param array $x Values * * @return array * @@ -335,7 +335,7 @@ final class MeasureOfDispersion /** * Get squared mean deviation. * - * @param array $x Values + * @param array $x Values * @param float $mean Mean * @param int $offset Population/Size offset * @@ -358,7 +358,7 @@ final class MeasureOfDispersion /** * Get the deviation to the mean squared * - * @param array $x Values + * @param array $x Values * * @return array * diff --git a/Message/Socket/Response.php b/Message/Socket/Response.php index f30193078..8b9b22c7b 100644 --- a/Message/Socket/Response.php +++ b/Message/Socket/Response.php @@ -16,6 +16,7 @@ namespace phpOMS\Message\Socket; use phpOMS\Contract\RenderableInterface; use phpOMS\Message\ResponseAbstract; +use phpOMS\System\MimeType; /** * Response class. diff --git a/Stdlib/Map/MultiMap.php b/Stdlib/Map/MultiMap.php index 9d9784a8a..c7ca8c644 100644 --- a/Stdlib/Map/MultiMap.php +++ b/Stdlib/Map/MultiMap.php @@ -37,7 +37,7 @@ final class MultiMap implements \Countable /** * Associated keys for values. * - * @var array + * @var array * @since 1.0.0 */ private array $keys = []; @@ -75,7 +75,7 @@ final class MultiMap implements \Countable /** * Add data. * - * @param array $keys Keys for value + * @param array $keys Keys for value * @param mixed $value Value to store * @param bool $overwrite Add value if key exists * diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index f21bd4627..b23641337 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -225,7 +225,7 @@ final class UriFactory * $ = Other data * * @param string $uri Path data - * @param array $toMatch Optional special replacements + * @param array $toMatch Optional special replacements * * @return string * diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index 314b0d476..e4954c8ba 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -332,7 +332,7 @@ final class ArrayUtils * @param int $start Start index * @param int $count Amount of elements to sum * - * @return float|int + * @return int|float * * @since 1.0.0 */ @@ -366,9 +366,9 @@ final class ArrayUtils /** * Applying abs to every array value * - * @param array $values Numeric values + * @param array $values Numeric values * - * @return array + * @return array * * @since 1.0.0 */ @@ -386,7 +386,7 @@ final class ArrayUtils /** * Power all values in array. * - * @param array $values Values to square + * @param array $values Values to square * @param float $exp Exponent * * @return float[] @@ -410,10 +410,10 @@ final class ArrayUtils /** * Power all values in array. * - * @param array $values Values to square + * @param array $values Values to square * @param int $exp Exponent * - * @return array + * @return array * * @todo Orange-Management/phpOMS#223 * In the ArrayUtils class the power* functions should be combined once union types become available. @@ -434,9 +434,9 @@ final class ArrayUtils /** * Sqrt all values in array. * - * @param array $values Values to sqrt + * @param array $values Values to sqrt * - * @return array + * @return array * * @since 1.0.0 */ diff --git a/Utils/Compression/LZW.php b/Utils/Compression/LZW.php index a2a9c76fd..2adfe6682 100644 --- a/Utils/Compression/LZW.php +++ b/Utils/Compression/LZW.php @@ -78,7 +78,7 @@ class LZW implements CompressionInterface } $w = \chr((int) $compressed[0]); - $result = $dictionary[(int) ($compressed[0])] ?? 0; + $result = $dictionary[(int) ($compressed[0])] ?? ''; $count = \count($compressed); for ($i = 1; $i < $count; ++$i) { @@ -97,6 +97,7 @@ class LZW implements CompressionInterface $w = $entry; } + /** @var string $result */ return $result; } } diff --git a/Validation/Validator.php b/Validation/Validator.php index 216f04ba5..eff7f786a 100644 --- a/Validation/Validator.php +++ b/Validation/Validator.php @@ -142,9 +142,9 @@ final class Validator extends ValidatorAbstract /** * Validate variable by interval. * - * @param float|int $var Variable to validate - * @param float|int $min Min. value - * @param float|int $max Max. value + * @param int|float $var Variable to validate + * @param int|float $min Min. value + * @param int|float $max Max. value * * @return bool * diff --git a/Views/View.php b/Views/View.php index 83f7cfeda..2aa70f5f8 100644 --- a/Views/View.php +++ b/Views/View.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace phpOMS\Views; -use phpOMS\ApplicationAbstract; +use phpOMS\Localization\L11nManager; use phpOMS\Localization\Localization; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; @@ -50,10 +50,10 @@ class View extends ViewAbstract /** * Application. * - * @var null|ApplicationAbstract + * @var null|L11nManager * @since 1.0.0 */ - protected ?ApplicationAbstract $app; + protected ?L11nManager $l11nManager; /** * Request. @@ -90,18 +90,18 @@ class View extends ViewAbstract /** * Constructor. * - * @param ApplicationAbstract $app Application - * @param RequestAbstract $request Request - * @param ResponseAbstract $response Request + * @param L11nManager $l11n Application + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Request * * @since 1.0.0 */ - public function __construct(ApplicationAbstract $app = null, RequestAbstract $request = null, ResponseAbstract $response = null) + public function __construct(L11nManager $l11n = null, RequestAbstract $request = null, ResponseAbstract $response = null) { - $this->app = $app; - $this->request = $request; - $this->response = $response; - $this->l11n = $response !== null ? $response->getHeader()->getL11n() : new Localization(); + $this->l11nManager = $l11n; + $this->request = $request; + $this->response = $response; + $this->l11n = $response !== null ? $response->getHeader()->getL11n() : new Localization(); } /** @@ -187,6 +187,10 @@ class View extends ViewAbstract */ public function getText($translation, string $module = null, string $theme = null) : string { + if ($this->l11nManager === null) { + return 'ERROR'; + } + if ($module === null && $this->module === null) { $this->setModuleDynamically(); } @@ -200,7 +204,7 @@ class View extends ViewAbstract /** @var string $theme */ $theme = $theme ?? $this->theme; - return $this->app->l11nManager->getText($this->l11n->getLanguage() ?? 'en', $module, $theme, $translation); + return $this->l11nManager->getText($this->l11n->getLanguage() ?? 'en', $module, $theme, $translation); } /** diff --git a/tests/Views/ViewTest.php b/tests/Views/ViewTest.php index 1db6ee266..5d877aa64 100644 --- a/tests/Views/ViewTest.php +++ b/tests/Views/ViewTest.php @@ -59,7 +59,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - $view = new View($this->app, new Request(new Http('')), new Response(new Localization())); + $view = new View($this->app->l11nManager, new Request(new Http('')), new Response(new Localization())); self::assertEmpty($view->getTemplate()); self::assertEmpty($view->getViews()); @@ -78,7 +78,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testGetText() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); $view->setTemplate('/Modules/Admin/Theme/Backend/accounts-list'); $expected = [ @@ -102,7 +102,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testGetHtml() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); $view->setTemplate('/Modules/Admin/Theme/Backend/accounts-list'); $expected = [ @@ -126,7 +126,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testDataInputOutput() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); $view->setData('key', 'value'); self::assertEquals('value', $view->getData('key')); @@ -139,7 +139,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testDataAdd() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); self::assertTrue($view->addData('key2', 'valu2')); self::assertEquals('valu2', $view->getData('key2')); @@ -152,7 +152,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataOverwrite() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); $view->addData('key2', 'valu2'); self::assertFalse($view->addData('key2', 'valu3')); @@ -166,7 +166,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testRemove() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); $view->addData('key2', 'valu2'); self::assertTrue($view->removeData('key2')); @@ -179,7 +179,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataRemove() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); self::assertFalse($view->removeData('key3')); } @@ -191,7 +191,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testGetRequest() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); self::assertEquals($request, $view->getRequest()); self::assertEquals($response, $view->getResponse()); @@ -204,7 +204,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testGetResponse() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); self::assertEquals($response, $view->getResponse()); } @@ -216,7 +216,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testPrintHtml() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); self::assertEquals('<a href="test">Test</a>', $view->printHtml('Test')); self::assertEquals('<a href="test">Test</a>', ViewAbstract::html('Test')); @@ -229,9 +229,9 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testViewInputOutput() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); - $tView = new View($this->app, $request, $response); + $tView = new View($this->app->l11nManager, $request, $response); self::assertTrue($view->addView('test', $tView)); self::assertEquals($tView, $view->getView('test')); self::assertCount(1, $view->getViews()); @@ -244,7 +244,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testInvalidViewGet() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); self::assertFalse($view->getView('test')); } @@ -256,9 +256,9 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testViewRemove() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); - $tView = new View($this->app, $request, $response); + $tView = new View($this->app->l11nManager, $request, $response); $view->addView('test', $tView); self::assertTrue($view->removeView('test')); } @@ -270,7 +270,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testInvalidViewRemove() : void { - $view = new View($this->app, $request = new Request(new Http('')), $response = new Response()); + $view = new View($this->app->l11nManager, $request = new Request(new Http('')), $response = new Response()); self::assertFalse($view->removeView('test')); } @@ -363,7 +363,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase { self::expectException(\phpOMS\System\File\PathException::class); - $view = new View($this->app); + $view = new View($this->app->l11nManager); $view->setTemplate('something.txt'); $view->render(); @@ -378,7 +378,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase { self::expectException(\phpOMS\System\File\PathException::class); - $view = new View($this->app); + $view = new View($this->app->l11nManager); $view->setTemplate('something.txt'); $view->serialize();