Fix code style

This commit is contained in:
Dennis Eichhorn 2023-11-11 21:44:06 +00:00
parent d4aa5b1bc5
commit 5433e64d8e
48 changed files with 622 additions and 57 deletions

View File

@ -22,7 +22,7 @@ namespace phpOMS\Ai\NeuralNetwork;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Neuron final class Neuron
{ {
/** /**
* Neuron inputs * Neuron inputs

View File

@ -26,54 +26,116 @@ use phpOMS\Utils\NumericUtils;
*/ */
final class Kernel final class Kernel
{ {
/**
* Kernel matrix for ridge
*
* @var array<int, int[]>
* @since 1.0.0
*/
public const KERNEL_RIDGE_1 = [ public const KERNEL_RIDGE_1 = [
[0, -1, 0], [0, -1, 0],
[-1, 4, -1], [-1, 4, -1],
[0, -1, 0], [0, -1, 0],
]; ];
/**
* Kernel matrix for ridge
*
* @var array<int, int[]>
* @since 1.0.0
*/
public const KERNEL_RIDGE_2 = [ public const KERNEL_RIDGE_2 = [
[-1, -1, -1], [-1, -1, -1],
[-1, 8, -1], [-1, 8, -1],
[-1, -1, -1], [-1, -1, -1],
]; ];
/**
* Kernel matrix for sharpening
*
* @var array<int, int[]>
* @since 1.0.0
*/
public const KERNEL_SHARPEN = [ public const KERNEL_SHARPEN = [
[0, -1, 0], [0, -1, 0],
[-1, 5, -1], [-1, 5, -1],
[0, -1, 0], [0, -1, 0],
]; ];
/**
* Kernel matrix for blurring
*
* @var array<int, int[]>
* @since 1.0.0
*/
public const KERNEL_BOX_BLUR = [ public const KERNEL_BOX_BLUR = [
[1 / 9, 1 / 9, 1 / 9], [1 / 9, 1 / 9, 1 / 9],
[1 / 9, 1 / 9, 1 / 9], [1 / 9, 1 / 9, 1 / 9],
[1 / 9, 1 / 9, 1 / 9], [1 / 9, 1 / 9, 1 / 9],
]; ];
/**
* Kernel matrix for gaussian blurring
*
* @var array<int, int[]>
* @since 1.0.0
*/
public const KERNEL_GAUSSUAN_BLUR_3 = [ public const KERNEL_GAUSSUAN_BLUR_3 = [
[1 / 16, 2 / 16, 1 / 16], [1 / 16, 2 / 16, 1 / 16],
[2 / 16, 4 / 16, 2 / 16], [2 / 16, 4 / 16, 2 / 16],
[1 / 16, 2 / 16, 1 / 16], [1 / 16, 2 / 16, 1 / 16],
]; ];
/**
* Kernel matrix for embossing
*
* @var array<int, int[]>
* @since 1.0.0
*/
public const KERNEL_EMBOSS = [ public const KERNEL_EMBOSS = [
[-2, -1, 0], [-2, -1, 0],
[-1, 1, 1], [-1, 1, 1],
[0, 1, 2], [0, 1, 2],
]; ];
/**
* Kernel matrix for unsharpening
*
* @var array<int, int[]>
* @since 1.0.0
*/
public const KERNEL_UNSHARP_MASKING = [ public const KERNEL_UNSHARP_MASKING = [
[-1 / 256, -4 / 256, -6 / 256, -4 / 256, -1 / 256], [-1 / 256, -4 / 256, -6 / 256, -4 / 256, -1 / 256],
[-4 / 256, -16 / 256, -24 / 256, -16 / 256, -4 / 256], [-4 / 256, -16 / 256, -24 / 256, -16 / 256, -4 / 256],
[-6 / 256, -24 / 256, 476 / 256, -24 / 256, -6 / 256], [-6 / 256, -24 / 256, 476 / 256, -24 / 256, -6 / 256],
[-4 / 256, -16 / 256, -24 / 256, -16 / 256, -4 / 256], [-4 / 256, -16 / 256, -24 / 256, -16 / 256, -4 / 256],
[-1 / 256, -4 / 256, -6 / 256, -4 / 256, -1 / 256], [-1 / 256, -4 / 256, -6 / 256, -4 / 256, -1 / 256],
]; ];
/** /**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/**
* Apply kernel matrix
*
* @param string $inParth Image file path
* @param string $outPath Image output path
* @param array $kernel Kernel matrix
*
* @return void
*
* @see https://en.wikipedia.org/wiki/Kernel_(image_processing) * @see https://en.wikipedia.org/wiki/Kernel_(image_processing)
* @see https://towardsdatascience.com/image-processing-with-python-blurring-and-sharpening-for-beginners-3bcebec0583a * @see https://towardsdatascience.com/image-processing-with-python-blurring-and-sharpening-for-beginners-3bcebec0583a
* @see https://web.eecs.umich.edu/~jjcorso/t/598F14/files/lecture_0924_filtering.pdf * @see https://web.eecs.umich.edu/~jjcorso/t/598F14/files/lecture_0924_filtering.pdf
*
* @since 1.0.0
*/ */
public static function convolve(string $inPath, string $outPath, array $kernel) : void public static function convolve(string $inPath, string $outPath, array $kernel) : void
{ {

View File

@ -24,6 +24,16 @@ namespace phpOMS\Image;
*/ */
final class Skew final class Skew
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Automatically rotate image based on projection profile * Automatically rotate image based on projection profile
* *

View File

@ -26,6 +26,16 @@ use phpOMS\Utils\ImageUtils;
*/ */
final class Thresholding final class Thresholding
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Perform integral thresholding * Perform integral thresholding
* *

View File

@ -26,6 +26,16 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException;
*/ */
final class Algebra final class Algebra
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get the product of two arrays * Get the product of two arrays
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D2;
*/ */
final class Circle implements D2ShapeInterface final class Circle implements D2ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Area * Area
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D2;
*/ */
final class Ellipse implements D2ShapeInterface final class Ellipse implements D2ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Area * Area
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D2;
*/ */
final class Quadrilateral implements D2ShapeInterface final class Quadrilateral implements D2ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Calculate the surface area from the length of all sides and the angle between a and b * Calculate the surface area from the length of all sides and the angle between a and b
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D2;
*/ */
final class Rectangle implements D2ShapeInterface final class Rectangle implements D2ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Area * Area
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D2;
*/ */
final class Trapezoid implements D2ShapeInterface final class Trapezoid implements D2ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Area * Area
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D2;
*/ */
final class Triangle implements D2ShapeInterface final class Triangle implements D2ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Area * Area
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D3;
*/ */
final class Cone implements D3ShapeInterface final class Cone implements D3ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Volume * Volume
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D3;
*/ */
final class Cuboid implements D3ShapeInterface final class Cuboid implements D3ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Volume * Volume
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D3;
*/ */
final class Cylinder implements D3ShapeInterface final class Cylinder implements D3ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Volume * Volume
* *

View File

@ -26,6 +26,16 @@ use phpOMS\Math\Geometry\Shape\D2\Polygon;
*/ */
final class Prism implements D3ShapeInterface final class Prism implements D3ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get volume of regular polygon prism by side length * Get volume of regular polygon prism by side length
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D3;
*/ */
final class RectangularPyramid implements D3ShapeInterface final class RectangularPyramid implements D3ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Volume * Volume
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Geometry\Shape\D3;
*/ */
final class Tetrahedron implements D3ShapeInterface final class Tetrahedron implements D3ShapeInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Volume * Volume
* *

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Numerics;
*/ */
final class Integration final class Integration
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Integrate function by using rectangles from the left side * Integrate function by using rectangles from the left side
* *

View File

@ -39,7 +39,8 @@ final class LagrangeInterpolation implements InterpolationInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct(array $points) { public function __construct(array $points)
{
$this->points = $points; $this->points = $points;
} }

View File

@ -65,7 +65,8 @@ final class LinearInterpolation implements InterpolationInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct(array $points) { public function __construct(array $points)
{
$this->points = $points; $this->points = $points;
$n = \count($this->points); $n = \count($this->points);

View File

@ -17,31 +17,113 @@ namespace phpOMS\Math\Optimization;
/** /**
* Simplex class. * Simplex class.
* *
* The Simplex algorithm aims to solve a linear program - optimising a linear function subject
* to linear constraints. As such it is useful for a very wide range of applications.
*
* N.B. The linear program has to be given in *slack form*, which is as follows:
* maximise
* c_1 * x_1 + c_2 * x_2 + ... + c_n * x_n + v
* subj. to
* a_11 * x_1 + a_12 * x_2 + ... + a_1n * x_n + b_1 = s_1
* a_21 * x_1 + a_22 * x_2 + ... + a_2n * x_n + b_2 = s_2
* ...
* a_m1 * x_1 + a_m2 * x_2 + ... + a_mn * x_n + b_m = s_m
* and
* x_1, x_2, ..., x_n, s_1, s_2, ..., s_m >= 0
*
* Every linear program can be translated into slack form; the parameters to specify are:
* - the number of variables, n, and the number of constraints, m;
* - the matrix A = [[A_11, A_12, ..., A_1n], ..., [A_m1, A_m2, ..., A_mn]];
* - the vector b = [b_1, b_2, ..., b_m];
* - the vector c = [c_1, c_2, ..., c_n] and the constant v.
*
* Complexity: O(m^(n/2)) worst case
* O(n + m) average case (common)
*
* @package phpOMS\Math\Optimization * @package phpOMS\Math\Optimization
* @license Copyright (c) 2015 Petar Veličković
* @license OMS License 2.0 * @license OMS License 2.0
* @link https://jingga.app * @link https://jingga.app
* @link https://github.com/PetarV-/Algorithms/blob/master/Mathematical%20Algorithms/Simplex%20Algorithm.cpp * @link https://github.com/PetarV-/Algorithms/blob/master/Mathematical%20Algorithms/Simplex%20Algorithm.cpp
* @since 1.0.0 * @since 1.0.0
*/ */
class Simplex final class Simplex
{ {
/**
* Bounding equations
*
* @var int
* @since 1.0.0
*/
private int $m = 0; private int $m = 0;
/**
* Bounding variables
*
* @var int
* @since 1.0.0
*/
private int $n = 0; private int $n = 0;
/**
* Bounding equations
*
* @var array<int, array<int|float>>
* @since 1.0.0
*/
private array $A = []; private array $A = [];
/**
* Bounds for bounding equations
*
* @var array<int|float>
* @since 1.0.0
*/
private array $b = []; private array $b = [];
/**
* Maximize vector
*
* @var array<int|float>
* @since 1.0.0
*/
private array $c = []; private array $c = [];
/**
* Maximized value
*
* @var float
* @since 1.0.0
*/
private float $v = 0.0; private float $v = 0.0;
private array $Basic = []; /**
* Basic solutions
*
* @var array<int|float>
* @since 1.0.0
*/
private array $basic = [];
private array $Nonbasic = []; /**
* Non-basic solutions
*
* @var array<int|float>
* @since 1.0.0
*/
private array $nonbasic = [];
private function pivot (int $x, int $y) : void /**
* Pivot yth variable around xth constraint
*
* @param int $x Constraint index
* @param int $y Variable index
*
* @return void
*
* @since 1.0.0
*/
private function pivot(int $x, int $y) : void
{ {
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
if ($j !== $y) { if ($j !== $y) {
@ -74,11 +156,18 @@ class Simplex
$this->v += $this->c[$y] * $this->b[$x]; $this->v += $this->c[$y] * $this->b[$x];
$this->c[$y] *= $this->A[$x][$y]; $this->c[$y] *= $this->A[$x][$y];
$temp = $this->Basic[$x]; $temp = $this->basic[$x];
$this->Basic[$x] = $this->Nonbasic[$y]; $this->basic[$x] = $this->nonbasic[$y];
$this->Nonbasic[$y] = $temp; $this->nonbasic[$y] = $temp;
} }
/**
* Perform simplex iteration step
*
* @return int 0 = OK, 1 = stop, -1 = unbound
*
* @since 1.0.0
*/
private function iterate() : int private function iterate() : int
{ {
$ind = -1; $ind = -1;
@ -86,9 +175,9 @@ class Simplex
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
if ($this->c[$j] > 0 if ($this->c[$j] > 0
&& ($best === -1 || $this->Nonbasic[$j] < $ind) && ($best === -1 || $this->nonbasic[$j] < $ind)
) { ) {
$ind = $this->Nonbasic[$j]; $ind = $this->nonbasic[$j];
$best = $j; $best = $j;
} }
} }
@ -119,6 +208,16 @@ class Simplex
return 0; return 0;
} }
/**
* Initialize simplex algorithm
*
* 1. possibly converts LP to slack form
* 2. find feasible basic solution
*
* @return int 0 = OK, 1 = stop, -1 = unbound
*
* @since 1.0.0
*/
private function initialize() : int private function initialize() : int
{ {
$k = -1; $k = -1;
@ -133,11 +232,11 @@ class Simplex
if ($this->b[$k] >= 0) { if ($this->b[$k] >= 0) {
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
$this->Nonbasic[$j] = $j; $this->nonbasic[$j] = $j;
} }
for ($i = 0; $i < $this->m; ++$i) { for ($i = 0; $i < $this->m; ++$i) {
$this->Basic[$i] = $this->n + $i; $this->basic[$i] = $this->n + $i;
} }
return 0; return 0;
@ -145,11 +244,11 @@ class Simplex
++$this->n; ++$this->n;
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
$this->Nonbasic[$j] = $j; $this->nonbasic[$j] = $j;
} }
for ($i = 0; $i < $this->m; ++$i) { for ($i = 0; $i < $this->m; ++$i) {
$this->Basic[$i] = $this->n + $i; $this->basic[$i] = $this->n + $i;
} }
$oldC = []; $oldC = [];
@ -180,7 +279,7 @@ class Simplex
$basicZ = -1; $basicZ = -1;
for ($i = 0; $i < $this->m; ++$i) { for ($i = 0; $i < $this->m; ++$i) {
if ($this->Basic[$i] === $this->n - 1) { if ($this->basic[$i] === $this->n - 1) {
$basicZ = $i; $basicZ = $i;
break; break;
} }
@ -192,7 +291,7 @@ class Simplex
$nonbasicZ = -1; $nonbasicZ = -1;
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
if ($this->Nonbasic[$j] === $this->n - 1) { if ($this->nonbasic[$j] === $this->n - 1) {
$nonbasicZ = $j; $nonbasicZ = $j;
break; break;
} }
@ -202,20 +301,20 @@ class Simplex
$this->A[$i][$nonbasicZ] = $this->A[$i][$this->n - 1]; $this->A[$i][$nonbasicZ] = $this->A[$i][$this->n - 1];
} }
$temp = $this->Nonbasic[$nonbasicZ]; $temp = $this->nonbasic[$nonbasicZ];
$this->Nonbasic[$nonbasicZ] = $this->Nonbasic[$this->n - 1]; $this->nonbasic[$nonbasicZ] = $this->nonbasic[$this->n - 1];
$this->Nonbasic[$this->n - 1] = $temp; $this->nonbasic[$this->n - 1] = $temp;
--$this->n; --$this->n;
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
if ($this->Nonbasic[$j] > $this->n) { if ($this->nonbasic[$j] > $this->n) {
--$this->Nonbasic[$j]; --$this->nonbasic[$j];
} }
} }
for ($i = 0; $i < $this->m; ++$i) { for ($i = 0; $i < $this->m; ++$i) {
if ($this->Basic[$i] > $this->n) { if ($this->basic[$i] > $this->n) {
--$this->Basic[$i]; --$this->basic[$i];
} }
} }
@ -228,7 +327,7 @@ class Simplex
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
$ok = false; $ok = false;
for ($k = 0; $k < $this->n; ++$k) { for ($k = 0; $k < $this->n; ++$k) {
if ($j === $this->Nonbasic[$k]) { if ($j === $this->nonbasic[$k]) {
$this->c[$k] += $oldC[$j]; $this->c[$k] += $oldC[$j];
$ok = true; $ok = true;
break; break;
@ -240,7 +339,7 @@ class Simplex
} }
for ($i = 0; $i < $this->m; ++$i) { for ($i = 0; $i < $this->m; ++$i) {
if ($j === $this->Basic[$i]) { if ($j === $this->basic[$i]) {
for ($k = 0; $k < $this->n; ++$k) { for ($k = 0; $k < $this->n; ++$k) {
$this->c[$k] = $oldC[$j] * $this->A[$i][$k]; $this->c[$k] = $oldC[$j] * $this->A[$i][$k];
} }
@ -254,13 +353,25 @@ class Simplex
return 0; return 0;
} }
public function solve(array $A, array $b, array $c) /**
* Solve simplex problem
*
* @param array<int, array<int|float>> $A Bounding equations
* @param int[]|float[] $b Boundings for equations
* @param int[]|float[] $c Equation to maximize
*
* @return array{0:array<int|float>, 1:float}
*
* @since 1.0.0
*/
public function solve(array $A, array $b, array $c) : array
{ {
$this->A = $A; $this->A = $A;
$this->b = $b; $this->b = $b;
$this->c = $c; $this->c = $c;
// @todo: createSlackForm() required? // @todo: createSlackForm() required?
// @todo: create minimize
$this->m = \count($A); $this->m = \count($A);
$this->n = \count(\reset($A)); $this->n = \count(\reset($A));
@ -278,11 +389,11 @@ class Simplex
$result = []; $result = [];
for ($j = 0; $j < $this->n; ++$j) { for ($j = 0; $j < $this->n; ++$j) {
$result[$this->Nonbasic[$j]] = 0; $result[$this->nonbasic[$j]] = 0;
} }
for ($i = 0; $i < $this->m; ++$i) { for ($i = 0; $i < $this->m; ++$i) {
$result[$this->Basic[$i]] = $this->b[$i]; $result[$this->basic[$i]] = $this->b[$i];
} }
return [$result, $this->v]; return [$result, $this->v];

View File

@ -24,6 +24,16 @@ namespace phpOMS\Math\Parser;
*/ */
final class Evaluator final class Evaluator
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Evaluate function. * Evaluate function.
* *

View File

@ -32,6 +32,16 @@ final class Bisection
*/ */
public const EPSILON = 1e-6; public const EPSILON = 1e-6;
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Perform bisection to find the root of a function * Perform bisection to find the root of a function
* *

View File

@ -32,6 +32,16 @@ final class Illinois
*/ */
public const EPSILON = 1e-6; public const EPSILON = 1e-6;
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Perform bisection to find the root of a function * Perform bisection to find the root of a function
* *

View File

@ -32,6 +32,16 @@ final class RegulaFalsi
*/ */
public const EPSILON = 1e-6; public const EPSILON = 1e-6;
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Perform bisection to find the root of a function * Perform bisection to find the root of a function
* *

View File

@ -26,7 +26,7 @@ use phpOMS\Utils\IO\IODatabaseMapper;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class CsvDatabaseMapper implements IODatabaseMapper final class CsvDatabaseMapper implements IODatabaseMapper
{ {
/** /**
* Database connection * Database connection

View File

@ -22,7 +22,7 @@ namespace phpOMS\Utils\IO\Json;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class InvalidJsonException extends \UnexpectedValueException final class InvalidJsonException extends \UnexpectedValueException
{ {
/** /**
* Constructor. * Constructor.

View File

@ -27,7 +27,7 @@ use phpOMS\Utils\StringUtils;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class SpreadsheetDatabaseMapper implements IODatabaseMapper final class SpreadsheetDatabaseMapper implements IODatabaseMapper
{ {
/** /**
* Database connection * Database connection

View File

@ -24,8 +24,18 @@ namespace phpOMS\Utils\IO\Zip;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Gz implements ArchiveInterface final class Gz implements ArchiveInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@ -31,8 +31,18 @@ use phpOMS\System\File\Local\Directory;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Tar implements ArchiveInterface final class Tar implements ArchiveInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@ -26,8 +26,18 @@ use phpOMS\System\File\Local\File;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class TarGz implements ArchiveInterface final class TarGz implements ArchiveInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@ -27,8 +27,18 @@ use phpOMS\System\File\Local\Directory;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Zip implements ArchiveInterface final class Zip implements ArchiveInterface
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@ -22,8 +22,18 @@ namespace phpOMS\Utils\Parser\Calendar;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class ICalParser final class ICalParser
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Parse iCal data * Parse iCal data
* *

View File

@ -25,8 +25,18 @@ use PhpOffice\PhpWord\Writer\HTML;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class DocumentParser final class DocumentParser
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Document to string * Document to string
* *

View File

@ -26,7 +26,7 @@ use phpOMS\Utils\StringUtils;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class PdfParser final class PdfParser
{ {
/** /**
* PDFToText path. * PDFToText path.
@ -44,6 +44,16 @@ class PdfParser
*/ */
public static string $pdftoppm = '/usr/bin/pdftoppm'; public static string $pdftoppm = '/usr/bin/pdftoppm';
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Pdf to text * Pdf to text
* *

View File

@ -26,8 +26,18 @@ use phpOMS\Contract\SerializableInterface;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class ArrayParser final class ArrayParser
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Serializing array (recursively). * Serializing array (recursively).
* *

View File

@ -24,8 +24,18 @@ use PhpOffice\PhpPresentation\IOFactory;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class PresentationParser final class PresentationParser
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Presentation to string * Presentation to string
* *

View File

@ -25,8 +25,18 @@ use PhpOffice\PhpSpreadsheet\Worksheet\PageSetup;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class SpreadsheetParser final class SpreadsheetParser
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Spreadsheet to string * Spreadsheet to string
* *

View File

@ -22,8 +22,18 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class ArrayRandomize final class ArrayRandomize
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Yates array shuffler. * Yates array shuffler.
* *

View File

@ -22,8 +22,18 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class DateTime final class DateTime
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get a random \DateTime. * Get a random \DateTime.
* *

View File

@ -22,8 +22,18 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Email final class Email
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get a random email. * Get a random email.
* *

View File

@ -22,7 +22,7 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class File final class File
{ {
/** /**
* Extensions. * Extensions.
@ -44,6 +44,16 @@ class File
['flv'], ['fla'], ['deb'], ['py'], ['pl'], ['flv'], ['fla'], ['deb'], ['py'], ['pl'],
]; ];
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get a random file extension. * Get a random file extension.
* *

View File

@ -22,7 +22,7 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class LinearCongruentialGenerator final class LinearCongruentialGenerator
{ {
/** /**
* BSD seed value. * BSD seed value.
@ -40,6 +40,16 @@ class LinearCongruentialGenerator
*/ */
private static $msvcrtSeed = 0; private static $msvcrtSeed = 0;
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* BSD random number * BSD random number
* *

View File

@ -22,7 +22,7 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Name final class Name
{ {
private static array $names = [ private static array $names = [
'western' => [ 'western' => [
@ -481,6 +481,16 @@ class Name
], ],
]; ];
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get a random string. * Get a random string.
* *

View File

@ -22,8 +22,18 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Phone final class Phone
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get a random phone number. * Get a random phone number.
* *

View File

@ -22,8 +22,18 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class StringUtils final class StringUtils
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get a random string. * Get a random string.
* *

View File

@ -22,7 +22,7 @@ namespace phpOMS\Utils\RnG;
* @link https://jingga.app * @link https://jingga.app
* @since 1.0.0 * @since 1.0.0
*/ */
class Text final class Text
{ {
/** /**
* Vocabulary. * Vocabulary.

View File

@ -24,6 +24,16 @@ namespace phpOMS\Utils\RnG;
*/ */
final class UUID final class UUID
{ {
/**
* Constructor.
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function __construct()
{
}
/** /**
* Get default random UUID * Get default random UUID
* *