Started to fix via cs

This commit is contained in:
Dennis Eichhorn 2018-01-28 22:04:43 +01:00
parent 029fdb4600
commit f74c2e49c8
493 changed files with 535 additions and 828 deletions

View File

@ -121,6 +121,8 @@ class Group implements ArrayableInterface, \JsonSerializable
* *
* @param string $name Group name * @param string $name Group name
* *
* @return void
*
* @since 1.0.0 * @since 1.0.0
*/ */
public function setName(string $name) /* : void */ public function setName(string $name) /* : void */
@ -145,6 +147,8 @@ class Group implements ArrayableInterface, \JsonSerializable
* *
* @param string $description Group description * @param string $description Group description
* *
* @return void
*
* @since 1.0.0 * @since 1.0.0
*/ */
public function setDescription(string $description) /* : void */ public function setDescription(string $description) /* : void */
@ -169,11 +173,18 @@ class Group implements ArrayableInterface, \JsonSerializable
* *
* @param int $status Group status * @param int $status Group status
* *
* @return void
*
* @throws InvalidEnumValue
*
* @since 1.0.0 * @since 1.0.0
*/ */
public function setStatus(int $status) /* : void */ public function setStatus(int $status) /* : void */
{ {
// todo: check valid if (!GroupStatus::isValidValue($status)) {
throw new InvalidEnumValue($status);
}
$this->status = $status; $this->status = $status;
} }

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -17,6 +17,10 @@ namespace phpOMS;
/** /**
* Application class. * Application class.
* *
* This class contains all necessary application members. Access to them
* is restricted to write once in order to prevent manipulation
* and afterwards read only.
*
* @property mixed orgId * @property mixed orgId
* @property string appName * @property string appName
* @property \phpOMS\DataStorage\Database\DatabasePool dbPool * @property \phpOMS\DataStorage\Database\DatabasePool dbPool
@ -31,7 +35,7 @@ namespace phpOMS;
* @property \phpOMS\Account\AccountManager accountManager * @property \phpOMS\Account\AccountManager accountManager
* @property \phpOMS\Log\FileLogger logger * @property \phpOMS\Log\FileLogger logger
* *
* @package Framework * @package phpOMS
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -15,9 +15,11 @@ declare(strict_types = 1);
namespace phpOMS; namespace phpOMS;
/** /**
* Permission exception class. * Autoloader exception
* *
* @package Framework * This exception is thrown if a file couldn't be autoloaded
*
* @package phpOMS
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -19,7 +19,7 @@ spl_autoload_register('\phpOMS\Autoloader::default_autoloader');
/** /**
* Autoloader class. * Autoloader class.
* *
* @package Framework * @package phpOMS
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0

View File

@ -335,7 +335,8 @@ class Http implements UriInterface
*/ */
public function getAuthority() : string public function getAuthority() : string
{ {
return ($this->getUser() !== '' ? $this->getUser() . '@' : '') . $this->host . (isset($this->port) && $this->port !== 0 ? ':' . $this->port : ''); return ($this->getUser() !== '' ? $this->getUser() . '@' : '') . $this->host
. (isset($this->port) && $this->port !== 0 ? ':' . $this->port : '');
} }
/** /**

View File

@ -264,7 +264,7 @@ class ArrayUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function arrayToCSV(array $data, string $delimiter = ';', string $enclosure = '"', string $escape = '\\') : string public static function arrayToCsv(array $data, string $delimiter = ';', string $enclosure = '"', string $escape = '\\') : string
{ {
$outstream = fopen('php://memory', 'r+'); $outstream = fopen('php://memory', 'r+');
/** @noinspection PhpMethodParametersCountMismatchInspection */ /** @noinspection PhpMethodParametersCountMismatchInspection */

View File

@ -308,9 +308,23 @@ abstract class C128Abstract
$cur_size = $location + (int) (substr($codeString, ($position - 1), 1)); $cur_size = $location + (int) (substr($codeString, ($position - 1), 1));
if ($this->orientation === OrientationType::HORIZONTAL) { if ($this->orientation === OrientationType::HORIZONTAL) {
imagefilledrectangle($image, $location + $this->margin, 0 + $this->margin, $cur_size + $this->margin, $dimensions['height'] - $this->margin, ($position % 2 == 0 ? $white : $black)); imagefilledrectangle(
$image,
$location + $this->margin,
0 + $this->margin,
$cur_size + $this->margin,
$dimensions['height'] - $this->margin,
($position % 2 == 0 ? $white : $black)
);
} else { } else {
imagefilledrectangle($image, 0 + $this->margin, $location + $this->margin, $dimensions['width'] - $this->margin, $cur_size + $this->margin, ($position % 2 == 0 ? $white : $black)); imagefilledrectangle(
$image,
0 + $this->margin,
$location + $this->margin,
$dimensions['width'] - $this->margin,
$cur_size + $this->margin,
($position % 2 == 0 ? $white : $black)
);
} }
$location = $cur_size; $location = $cur_size;

View File

@ -100,7 +100,7 @@ class C128c extends C128Abstract
} }
$codeString .= self::$CODEARRAY[$activeKey]; $codeString .= self::$CODEARRAY[$activeKey];
$checksum += $values[$activeKey] * $checkPos; $checksum += $values[$activeKey] * $checkPos;
$checkPos++; $checkPos++;
} }

View File

@ -25,12 +25,19 @@ namespace phpOMS\Utils\Barcode;
class HIBCC class HIBCC
{ {
private $identifier = ''; private $identifier = '';
private $productId = ''; private $productId = '';
private $measureOfUnit = 0; private $measureOfUnit = 0;
private $dateFormat = ''; private $dateFormat = '';
private $expirationDate = null; private $expirationDate = null;
private $productionDate = null; private $productionDate = null;
private $lot = ''; private $lot = '';
private $checkValue = 0; private $checkValue = 0;
public function __construct() public function __construct()
@ -98,12 +105,12 @@ class HIBCC
return $this->productionDate; return $this->productionDate;
} }
public function setLOT(string $lot) /* : void */ public function setLot(string $lot) /* : void */
{ {
$this->lot = $lot; $this->lot = $lot;
} }
public function getLOT() : string public function getLot() : string
{ {
return $this->lot; return $this->lot;
} }
@ -113,14 +120,13 @@ class HIBCC
return $this->checkValue; return $this->checkValue;
} }
public function getPrimaryDI() : string public function getPrimaryDi() : string
{ {
return ''; return '';
} }
public function getSecondaryDI() : string public function getSecondaryDi() : string
{ {
return ''; return '';
} }
} }

View File

@ -27,5 +27,5 @@ use phpOMS\Stdlib\Base\Enum;
abstract class OrientationType extends Enum abstract class OrientationType extends Enum
{ {
/* public */ const HORIZONTAL = 0; /* public */ const HORIZONTAL = 0;
/* public */ const VERTICAL = 1; /* public */ const VERTICAL = 1;
} }

View File

@ -56,7 +56,7 @@ class ColorUtils
*/ */
public static function rgbToInt(array $rgb) : int public static function rgbToInt(array $rgb) : int
{ {
$i = (255 & $rgb['r']) << 16; $i = (255 & $rgb['r']) << 16;
$i += (255 & $rgb['g']) << 8; $i += (255 & $rgb['g']) << 8;
$i += (255 & $rgb['b']); $i += (255 & $rgb['b']);

View File

@ -83,15 +83,13 @@ class LZW implements CompressionInterface
if ($dictionary[$k]) { if ($dictionary[$k]) {
$entry = $dictionary[$k]; $entry = $dictionary[$k];
} else { } elseif ($k === $dictSize) {
if ($k !== $dictSize) {
throw new \Exception('Wrong dictionary size!' . $k . '.' . $dictSize);
}
$entry = $w . $w[0]; $entry = $w . $w[0];
} else {
throw new \Exception('Wrong dictionary size!' . $k . '.' . $dictSize);
} }
$result .= $entry; $result .= $entry;
$dictionary[$dictSize++] = $w . $entry[0]; $dictionary[$dictSize++] = $w . $entry[0];
$w = $entry; $w = $entry;
} }

View File

@ -26,14 +26,14 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class AngleType extends Enum abstract class AngleType extends Enum
{ {
/* public */ const DEGREE = 'deg'; /* public */ const DEGREE = 'deg';
/* public */ const RADIAN = 'rad'; /* public */ const RADIAN = 'rad';
/* public */ const SECOND = 'arcsec'; /* public */ const SECOND = 'arcsec';
/* public */ const MINUTE = 'arcmin'; /* public */ const MINUTE = 'arcmin';
/* public */ const MILLIRADIAN_US = 'mil (us ww2)'; /* public */ const MILLIRADIAN_US = 'mil (us ww2)';
/* public */ const MILLIRADIAN_UK = 'mil (uk)'; /* public */ const MILLIRADIAN_UK = 'mil (uk)';
/* public */ const MILLIRADIAN_USSR = 'mil (ussr)'; /* public */ const MILLIRADIAN_USSR = 'mil (ussr)';
/* public */ const MILLIRADIAN_NATO = 'mil (nato)'; /* public */ const MILLIRADIAN_NATO = 'mil (nato)';
/* public */ const GRADIAN = 'g'; /* public */ const GRADIAN = 'g';
/* public */ const CENTRAD = 'crad'; /* public */ const CENTRAD = 'crad';
} }

View File

@ -26,17 +26,17 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class AreaType extends Enum abstract class AreaType extends Enum
{ {
/* public */ const SQUARE_FEET = 'ft'; /* public */ const SQUARE_FEET = 'ft';
/* public */ const SQUARE_METERS = 'm'; /* public */ const SQUARE_METERS = 'm';
/* public */ const SQUARE_KILOMETERS = 'km'; /* public */ const SQUARE_KILOMETERS = 'km';
/* public */ const SQUARE_MILES = 'mi'; /* public */ const SQUARE_MILES = 'mi';
/* public */ const SQUARE_YARDS = 'yd'; /* public */ const SQUARE_YARDS = 'yd';
/* public */ const SQUARE_INCHES = 'in'; /* public */ const SQUARE_INCHES = 'in';
/* public */ const SQUARE_MICROINCHES = 'muin'; /* public */ const SQUARE_MICROINCHES = 'muin';
/* public */ const SQUARE_CENTIMETERS = 'cm'; /* public */ const SQUARE_CENTIMETERS = 'cm';
/* public */ const SQUARE_MILIMETERS = 'mm'; /* public */ const SQUARE_MILIMETERS = 'mm';
/* public */ const SQUARE_MICROMETERS = 'micron'; /* public */ const SQUARE_MICROMETERS = 'micron';
/* public */ const SQUARE_DECIMETERS = 'dm'; /* public */ const SQUARE_DECIMETERS = 'dm';
/* public */ const HECTARES = 'ha'; /* public */ const HECTARES = 'ha';
/* public */ const ACRES = 'ac'; /* public */ const ACRES = 'ac';
} }

View File

@ -105,7 +105,7 @@ class Currency
} }
$node = $xml->Cube->Cube->Cube; $node = $xml->Cube->Cube->Cube;
self::$ecbCurrencies = []; self::$ecbCurrencies = [];
foreach ($node as $key => $value) { foreach ($node as $key => $value) {

View File

@ -28,11 +28,11 @@ abstract class EnergyPowerType extends Enum
{ {
/* public */ const KILOWATT_HOUERS = 'kWh'; /* public */ const KILOWATT_HOUERS = 'kWh';
/* public */ const MEGAWATT_HOUERS = 'MWh'; /* public */ const MEGAWATT_HOUERS = 'MWh';
/* public */ const KILOTONS = 'kt'; /* public */ const KILOTONS = 'kt';
/* public */ const JOULS = 'J'; /* public */ const JOULS = 'J';
/* public */ const CALORIES = 'Cal'; /* public */ const CALORIES = 'Cal';
/* public */ const BTU = 'BTU'; /* public */ const BTU = 'BTU';
/* public */ const KILOJOULS = 'kJ'; /* public */ const KILOJOULS = 'kJ';
/* public */ const THERMEC = 'thmEC'; /* public */ const THERMEC = 'thmEC';
/* public */ const NEWTON_METERS = 'Nm'; /* public */ const NEWTON_METERS = 'Nm';
} }

View File

@ -27,13 +27,13 @@ use phpOMS\Stdlib\Base\Enum;
abstract class FileSizeType extends Enum abstract class FileSizeType extends Enum
{ {
/* public */ const TERRABYTE = 'TB'; /* public */ const TERRABYTE = 'TB';
/* public */ const GIGABYTE = 'GB'; /* public */ const GIGABYTE = 'GB';
/* public */ const MEGABYTE = 'MB'; /* public */ const MEGABYTE = 'MB';
/* public */ const KILOBYTE = 'KB'; /* public */ const KILOBYTE = 'KB';
/* public */ const BYTE = 'B'; /* public */ const BYTE = 'B';
/* public */ const TERRABIT = 'tbit'; /* public */ const TERRABIT = 'tbit';
/* public */ const GIGABIT = 'gbit'; /* public */ const GIGABIT = 'gbit';
/* public */ const MEGABIT = 'mbit'; /* public */ const MEGABIT = 'mbit';
/* public */ const KILOBIT = 'kbit'; /* public */ const KILOBIT = 'kbit';
/* public */ const BIT = 'bit'; /* public */ const BIT = 'bit';
} }

View File

@ -36,6 +36,13 @@ class Ip
{ {
} }
/**
* Convert ip to float
*
* @param string $ip IP
*
* @since 1.0.0
*/
public static function ip2Float(string $ip) : float public static function ip2Float(string $ip) : float
{ {
$split = explode('.', $ip); $split = explode('.', $ip);

View File

@ -26,25 +26,25 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class LengthType extends Enum abstract class LengthType extends Enum
{ {
/* public */ const MILES = 'mi'; /* public */ const MILES = 'mi';
/* public */ const METERS = 'm'; /* public */ const METERS = 'm';
/* public */ const MICROMETER = 'micron'; /* public */ const MICROMETER = 'micron';
/* public */ const CENTIMETERS = 'cm'; /* public */ const CENTIMETERS = 'cm';
/* public */ const MILLIMETERS = 'mm'; /* public */ const MILLIMETERS = 'mm';
/* public */ const KILOMETERS = 'km'; /* public */ const KILOMETERS = 'km';
/* public */ const CHAINS = 'ch'; /* public */ const CHAINS = 'ch';
/* public */ const FEET = 'ft'; /* public */ const FEET = 'ft';
/* public */ const FURLONGS = 'fur'; /* public */ const FURLONGS = 'fur';
/* public */ const MICROINCH = 'muin'; /* public */ const MICROINCH = 'muin';
/* public */ const INCHES = 'in'; /* public */ const INCHES = 'in';
/* public */ const YARDS = 'yd'; /* public */ const YARDS = 'yd';
/* public */ const PARSECS = 'pc'; /* public */ const PARSECS = 'pc';
/* public */ const UK_NAUTICAL_MILES = 'uk nmi'; /* public */ const UK_NAUTICAL_MILES = 'uk nmi';
/* public */ const US_NAUTICAL_MILES = 'us nmi'; /* public */ const US_NAUTICAL_MILES = 'us nmi';
/* public */ const UK_NAUTICAL_LEAGUES = 'uk nl'; /* public */ const UK_NAUTICAL_LEAGUES = 'uk nl';
/* public */ const NAUTICAL_LEAGUES = 'nl'; /* public */ const NAUTICAL_LEAGUES = 'nl';
/* public */ const UK_LEAGUES = 'uk lg'; /* public */ const UK_LEAGUES = 'uk lg';
/* public */ const US_LEAGUES = 'us lg'; /* public */ const US_LEAGUES = 'us lg';
/* public */ const LIGHTYEARS = 'ly'; /* public */ const LIGHTYEARS = 'ly';
/* public */ const DECIMETERS = 'dm'; /* public */ const DECIMETERS = 'dm';
} }

View File

@ -31,7 +31,11 @@ class Numeric
* @var array * @var array
* @since 1.0.0 * @since 1.0.0
*/ */
/* public */ const ROMANS = ['M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1]; /* public */ const ROMANS = [
'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100,
'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10,
'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1
];
/** /**
* Constructor. * Constructor.
@ -72,7 +76,13 @@ class Numeric
$newOutput = 0; $newOutput = 0;
for ($i = 1; $i <= $numberLen; $i++) { for ($i = 1; $i <= $numberLen; $i++) {
$newOutput = bcadd((string) $newOutput, bcmul((string) array_search($number[$i - 1], $fromBase), bcpow((string) $fromLen, (string) ($numberLen - $i)))); $newOutput = bcadd(
(string) $newOutput,
bcmul(
(string) array_search($number[$i - 1], $fromBase),
bcpow((string) $fromLen, (string) ($numberLen - $i))
)
);
} }
return $newOutput; return $newOutput;
@ -136,7 +146,7 @@ class Numeric
foreach (self::ROMANS as $key => $value) { foreach (self::ROMANS as $key => $value) {
while (strpos($roman, $key) === 0) { while (strpos($roman, $key) === 0) {
$result += $value; $result += $value;
$roman = substr($roman, strlen($key)); $roman = substr($roman, strlen($key));
} }
} }
@ -159,7 +169,7 @@ class Numeric
$alpha = ''; $alpha = '';
for ($i = 1; $number >= 0 && $i < 10; $i++) { for ($i = 1; $number >= 0 && $i < 10; $i++) {
$alpha = chr(0x41 + ($number % pow(26, $i) / pow(26, $i - 1))) . $alpha; $alpha = chr(0x41 + ($number % pow(26, $i) / pow(26, $i - 1))) . $alpha;
$number -= pow(26, $i); $number -= pow(26, $i);
} }

View File

@ -26,17 +26,17 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class PressureType extends Enum abstract class PressureType extends Enum
{ {
/* public */ const PASCALS = 'Pa'; /* public */ const PASCALS = 'Pa';
/* public */ const BAR = 'bar'; /* public */ const BAR = 'bar';
/* public */ const POUND_PER_SQUARE_INCH = 'psi'; /* public */ const POUND_PER_SQUARE_INCH = 'psi';
/* public */ const ATMOSPHERES = 'atm'; /* public */ const ATMOSPHERES = 'atm';
/* public */ const INCHES_OF_MERCURY = 'inHg'; /* public */ const INCHES_OF_MERCURY = 'inHg';
/* public */ const INCHES_OF_WATER = 'inH20'; /* public */ const INCHES_OF_WATER = 'inH20';
/* public */ const MILLIMETERS_OF_WATER = 'mmH20'; /* public */ const MILLIMETERS_OF_WATER = 'mmH20';
/* public */ const MILLIMETERS_OF_MERCURY = 'mmHg'; /* public */ const MILLIMETERS_OF_MERCURY = 'mmHg';
/* public */ const MILLIBAR = 'mbar'; /* public */ const MILLIBAR = 'mbar';
/* public */ const KILOGRAM_PER_SQUARE_METER = 'kg/m2'; /* public */ const KILOGRAM_PER_SQUARE_METER = 'kg/m2';
/* public */ const NEWTONS_PER_METER_SQUARED = 'N/m2'; /* public */ const NEWTONS_PER_METER_SQUARED = 'N/m2';
/* public */ const POUNDS_PER_SQUARE_FOOT = 'psf'; /* public */ const POUNDS_PER_SQUARE_FOOT = 'psf';
/* public */ const TORRS = 'Torr'; /* public */ const TORRS = 'Torr';
} }

View File

@ -26,38 +26,38 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class SpeedType extends Enum abstract class SpeedType extends Enum
{ {
/* public */ const MILES_PER_DAY = 'mpd'; /* public */ const MILES_PER_DAY = 'mpd';
/* public */ const MILES_PER_HOUR = 'mph'; /* public */ const MILES_PER_HOUR = 'mph';
/* public */ const MILES_PER_MINUTE = 'mpm'; /* public */ const MILES_PER_MINUTE = 'mpm';
/* public */ const MILES_PER_SECOND = 'mps'; /* public */ const MILES_PER_SECOND = 'mps';
/* public */ const KILOMETERS_PER_DAY = 'kpd'; /* public */ const KILOMETERS_PER_DAY = 'kpd';
/* public */ const KILOMETERS_PER_HOUR = 'kph'; /* public */ const KILOMETERS_PER_HOUR = 'kph';
/* public */ const KILOMETERS_PER_MINUTE = 'kpm'; /* public */ const KILOMETERS_PER_MINUTE = 'kpm';
/* public */ const KILOMETERS_PER_SECOND = 'kps'; /* public */ const KILOMETERS_PER_SECOND = 'kps';
/* public */ const METERS_PER_DAY = 'md'; /* public */ const METERS_PER_DAY = 'md';
/* public */ const METERS_PER_HOUR = 'mh'; /* public */ const METERS_PER_HOUR = 'mh';
/* public */ const METERS_PER_MINUTE = 'mm'; /* public */ const METERS_PER_MINUTE = 'mm';
/* public */ const METERS_PER_SECOND = 'ms'; /* public */ const METERS_PER_SECOND = 'ms';
/* public */ const CENTIMETERS_PER_DAY = 'cpd'; /* public */ const CENTIMETERS_PER_DAY = 'cpd';
/* public */ const CENTIMETERS_PER_HOUR = 'cph'; /* public */ const CENTIMETERS_PER_HOUR = 'cph';
/* public */ const CENTIMETERS_PER_MINUTES = 'cpm'; /* public */ const CENTIMETERS_PER_MINUTES = 'cpm';
/* public */ const CENTIMETERS_PER_SECOND = 'cps'; /* public */ const CENTIMETERS_PER_SECOND = 'cps';
/* public */ const MILLIMETERS_PER_DAY = 'mmpd'; /* public */ const MILLIMETERS_PER_DAY = 'mmpd';
/* public */ const MILLIMETERS_PER_HOUR = 'mmph'; /* public */ const MILLIMETERS_PER_HOUR = 'mmph';
/* public */ const MILLIMETERS_PER_MINUTE = 'mmpm'; /* public */ const MILLIMETERS_PER_MINUTE = 'mmpm';
/* public */ const MILLIMETERS_PER_SECOND = 'mmps'; /* public */ const MILLIMETERS_PER_SECOND = 'mmps';
/* public */ const YARDS_PER_DAY = 'ypd'; /* public */ const YARDS_PER_DAY = 'ypd';
/* public */ const YARDS_PER_HOUR = 'yph'; /* public */ const YARDS_PER_HOUR = 'yph';
/* public */ const YARDS_PER_MINUTE = 'ypm'; /* public */ const YARDS_PER_MINUTE = 'ypm';
/* public */ const YARDS_PER_SECOND = 'yps'; /* public */ const YARDS_PER_SECOND = 'yps';
/* public */ const INCHES_PER_DAY = 'ind'; /* public */ const INCHES_PER_DAY = 'ind';
/* public */ const INCHES_PER_HOUR = 'inh'; /* public */ const INCHES_PER_HOUR = 'inh';
/* public */ const INCHES_PER_MINUTE = 'inm'; /* public */ const INCHES_PER_MINUTE = 'inm';
/* public */ const INCHES_PER_SECOND = 'ins'; /* public */ const INCHES_PER_SECOND = 'ins';
/* public */ const FEET_PER_DAY = 'ftd'; /* public */ const FEET_PER_DAY = 'ftd';
/* public */ const FEET_PER_HOUR = 'fth'; /* public */ const FEET_PER_HOUR = 'fth';
/* public */ const FEET_PER_MINUTE = 'ftm'; /* public */ const FEET_PER_MINUTE = 'ftm';
/* public */ const FEET_PER_SECOND = 'fts'; /* public */ const FEET_PER_SECOND = 'fts';
/* public */ const MACH = 'mach'; /* public */ const MACH = 'mach';
/* public */ const KNOTS = 'knots'; /* public */ const KNOTS = 'knots';
} }

View File

@ -26,12 +26,12 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class TemperatureType extends Enum abstract class TemperatureType extends Enum
{ {
/* public */ const CELSIUS = 'celsius'; /* public */ const CELSIUS = 'celsius';
/* public */ const FAHRENHEIT = 'fahrenheit'; /* public */ const FAHRENHEIT = 'fahrenheit';
/* public */ const KELVIN = 'kelvin'; /* public */ const KELVIN = 'kelvin';
/* public */ const REAUMUR = 'reaumur'; /* public */ const REAUMUR = 'reaumur';
/* public */ const RANKINE = 'rankine'; /* public */ const RANKINE = 'rankine';
/* public */ const DELISLE = 'delisle'; /* public */ const DELISLE = 'delisle';
/* public */ const NEWTON = 'newton'; /* public */ const NEWTON = 'newton';
/* public */ const ROMER = 'romer'; /* public */ const ROMER = 'romer';
} }

View File

@ -27,12 +27,12 @@ use phpOMS\Stdlib\Base\Enum;
abstract class TimeType extends Enum abstract class TimeType extends Enum
{ {
/* public */ const MILLISECONDS = 'ms'; /* public */ const MILLISECONDS = 'ms';
/* public */ const SECONDS = 's'; /* public */ const SECONDS = 's';
/* public */ const MINUTES = 'i'; /* public */ const MINUTES = 'i';
/* public */ const HOURS = 'h'; /* public */ const HOURS = 'h';
/* public */ const DAYS = 'd'; /* public */ const DAYS = 'd';
/* public */ const WEEKS = 'w'; /* public */ const WEEKS = 'w';
/* public */ const MONTH = 'm'; /* public */ const MONTH = 'm';
/* public */ const QUARTER = 'q'; /* public */ const QUARTER = 'q';
/* public */ const YEAR = 'y'; /* public */ const YEAR = 'y';
} }

View File

@ -26,42 +26,42 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class VolumeType extends Enum abstract class VolumeType extends Enum
{ {
/* public */ const UK_GALLON = 'UK gal'; /* public */ const UK_GALLON = 'UK gal';
/* public */ const US_GALLON_LIQUID = 'US gal lqd'; /* public */ const US_GALLON_LIQUID = 'US gal lqd';
/* public */ const US_GALLON_DRY = 'US gal dry'; /* public */ const US_GALLON_DRY = 'US gal dry';
/* public */ const UK_PINT = 'pt'; /* public */ const UK_PINT = 'pt';
/* public */ const US_PINT_LIQUID = 'US pt lqd'; /* public */ const US_PINT_LIQUID = 'US pt lqd';
/* public */ const US_PINT_DRY = 'US pt dry'; /* public */ const US_PINT_DRY = 'US pt dry';
/* public */ const US_QUARTS_LIQUID = 'US qt lqd'; /* public */ const US_QUARTS_LIQUID = 'US qt lqd';
/* public */ const US_QUARTS_DRY = 'US qt dry'; /* public */ const US_QUARTS_DRY = 'US qt dry';
/* public */ const UK_QUARTS = 'UK qt dry'; /* public */ const UK_QUARTS = 'UK qt dry';
/* public */ const US_GILL = 'US gi'; /* public */ const US_GILL = 'US gi';
/* public */ const UK_GILL = 'UK gi'; /* public */ const UK_GILL = 'UK gi';
/* public */ const LITER = 'L'; /* public */ const LITER = 'L';
/* public */ const MICROLITER = 'mul'; /* public */ const MICROLITER = 'mul';
/* public */ const MILLILITER = 'mL'; /* public */ const MILLILITER = 'mL';
/* public */ const CENTILITER = 'cl'; /* public */ const CENTILITER = 'cl';
/* public */ const KILOLITER = 'kl'; /* public */ const KILOLITER = 'kl';
/* public */ const UK_BARREL = 'UK bbl'; /* public */ const UK_BARREL = 'UK bbl';
/* public */ const US_BARREL_DRY = 'US bbl dry'; /* public */ const US_BARREL_DRY = 'US bbl dry';
/* public */ const US_BARREL_LIQUID = 'US bbl lqd'; /* public */ const US_BARREL_LIQUID = 'US bbl lqd';
/* public */ const US_BARREL_OIL = 'US bbl oil'; /* public */ const US_BARREL_OIL = 'US bbl oil';
/* public */ const US_BARREL_FEDERAL = 'US bbl fed'; /* public */ const US_BARREL_FEDERAL = 'US bbl fed';
/* public */ const US_OUNCES = 'us fl oz'; /* public */ const US_OUNCES = 'us fl oz';
/* public */ const UK_OUNCES = 'uk fl oz'; /* public */ const UK_OUNCES = 'uk fl oz';
/* public */ const US_TEASPOON = 'US tsp'; /* public */ const US_TEASPOON = 'US tsp';
/* public */ const UK_TEASPOON = 'UK tsp'; /* public */ const UK_TEASPOON = 'UK tsp';
/* public */ const METRIC_TEASPOON = 'Metric tsp'; /* public */ const METRIC_TEASPOON = 'Metric tsp';
/* public */ const US_TABLESPOON = 'US tblsp'; /* public */ const US_TABLESPOON = 'US tblsp';
/* public */ const UK_TABLESPOON = 'UK tblsp'; /* public */ const UK_TABLESPOON = 'UK tblsp';
/* public */ const METRIC_TABLESPOON = 'Metric tblsp'; /* public */ const METRIC_TABLESPOON = 'Metric tblsp';
/* public */ const US_CUP = 'US cup'; /* public */ const US_CUP = 'US cup';
/* public */ const CAN_CUP = 'Can cup'; /* public */ const CAN_CUP = 'Can cup';
/* public */ const METRIC_CUP = 'Metric cup'; /* public */ const METRIC_CUP = 'Metric cup';
/* public */ const CUBIC_CENTIMETER = 'cm'; /* public */ const CUBIC_CENTIMETER = 'cm';
/* public */ const CUBIC_MILLIMETER = 'mm'; /* public */ const CUBIC_MILLIMETER = 'mm';
/* public */ const CUBIC_METER = 'm'; /* public */ const CUBIC_METER = 'm';
/* public */ const CUBIC_INCH = 'in'; /* public */ const CUBIC_INCH = 'in';
/* public */ const CUBIC_FEET = 'ft'; /* public */ const CUBIC_FEET = 'ft';
/* public */ const CUBIC_YARD = 'yd'; /* public */ const CUBIC_YARD = 'yd';
} }

View File

@ -26,18 +26,18 @@ use phpOMS\Stdlib\Base\Enum;
*/ */
abstract class WeightType extends Enum abstract class WeightType extends Enum
{ {
/* public */ const MICROGRAM = 'mg'; /* public */ const MICROGRAM = 'mg';
/* public */ const MILLIGRAM = 'mug'; /* public */ const MILLIGRAM = 'mug';
/* public */ const GRAM = 'g'; /* public */ const GRAM = 'g';
/* public */ const KILOGRAM = 'kg'; /* public */ const KILOGRAM = 'kg';
/* public */ const METRIC_TONS = 't'; /* public */ const METRIC_TONS = 't';
/* public */ const POUNDS = 'lb'; /* public */ const POUNDS = 'lb';
/* public */ const OUNCES = 'oz'; /* public */ const OUNCES = 'oz';
/* public */ const STONES = 'st'; /* public */ const STONES = 'st';
/* public */ const GRAIN = 'gr'; /* public */ const GRAIN = 'gr';
/* public */ const CARAT = 'ct'; /* public */ const CARAT = 'ct';
/* public */ const LONG_TONS = 'uk t'; /* public */ const LONG_TONS = 'uk t';
/* public */ const SHORT_TONS = 'us ton'; /* public */ const SHORT_TONS = 'us ton';
/* public */ const TROY_POUNDS = 't lb'; /* public */ const TROY_POUNDS = 't lb';
/* public */ const TROY_OUNCES = 't oz'; /* public */ const TROY_OUNCES = 't oz';
} }

View File

@ -47,7 +47,7 @@ final class XorEncoding
$j = 0; $j = 0;
} }
$ascii = ord($source[$i]) ^ ord($key[$j]); $ascii = ord($source[$i]) ^ ord($key[$j]);
$result .= chr($ascii); $result .= chr($ascii);
} }

View File

@ -97,10 +97,10 @@ class Commit
*/ */
public function __construct(string $id = '') public function __construct(string $id = '')
{ {
$this->id = $id; $this->id = $id;
$this->author = new Author(); $this->author = new Author();
$this->branch = new Branch(); $this->branch = new Branch();
$this->tag = new Tag(); $this->tag = new Tag();
$this->repository = new Repository(realpath(__DIR__ . '/../../../../../')); $this->repository = new Repository(realpath(__DIR__ . '/../../../../../'));
} }

View File

@ -157,9 +157,14 @@ class Repository
private function run(string $cmd) : array private function run(string $cmd) : array
{ {
if (strtolower(substr(PHP_OS, 0, 3)) == 'win') { if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
$cmd = 'cd ' . escapeshellarg(dirname(Git::getBin())) . ' && ' . basename(Git::getBin()) . ' -C ' . escapeshellarg($this->path) . ' ' . $cmd; $cmd = 'cd ' . escapeshellarg(dirname(Git::getBin()))
. ' && ' . basename(Git::getBin())
. ' -C ' . escapeshellarg($this->path) . ' '
. $cmd;
} else { } else {
$cmd = escapeshellarg(Git::getBin()) . ' -C ' . escapeshellarg($this->path) . ' ' . $cmd; $cmd = escapeshellarg(Git::getBin())
. ' -C ' . escapeshellarg($this->path) . ' '
. $cmd;
} }
$pipes = []; $pipes = [];
@ -626,7 +631,7 @@ class Repository
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getLOC(array $extensions = ['*']) : int public function getLoc(array $extensions = ['*']) : int
{ {
$lines = $this->run('ls-files'); $lines = $this->run('ls-files');
$loc = 0; $loc = 0;
@ -750,12 +755,17 @@ class Repository
} }
$addremove = ['added' => 0, 'removed' => 0]; $addremove = ['added' => 0, 'removed' => 0];
$lines = $this->run('log --author=' . escapeshellarg($author->getName()) . ' --since="' . $start->format('Y-m-d') . '" --before="' . $end->format('Y-m-d') . '" --pretty=tformat: --numstat'); $lines = $this->run(
'log --author=' . escapeshellarg($author->getName())
. ' --since="' . $start->format('Y-m-d')
. '" --before="' . $end->format('Y-m-d')
. '" --pretty=tformat: --numstat'
);
foreach ($lines as $line) { foreach ($lines as $line) {
$nums = explode(' ', $line); $nums = explode(' ', $line);
$addremove['added'] += $nums[0]; $addremove['added'] += $nums[0];
$addremove['removed'] += $nums[1]; $addremove['removed'] += $nums[1];
} }
@ -801,7 +811,11 @@ class Repository
$author = ' --author=' . escapeshellarg($author->getName()) . ''; $author = ' --author=' . escapeshellarg($author->getName()) . '';
} }
$lines = $this->run('git log --before="' . $end->format('Y-m-d') . '" --after="' . $start->format('Y-m-d') . '"' . $author . ' --reverse --date=short'); $lines = $this->run(
'git log --before="' . $end->format('Y-m-d')
. '" --after="' . $start->format('Y-m-d') . '"'
. $author . ' --reverse --date=short');
$count = count($lines); $count = count($lines);
$commits = []; $commits = [];

View File

@ -87,5 +87,4 @@ class Tag
{ {
return $this->name; return $this->name;
} }
} }

View File

@ -25,7 +25,9 @@ class CsvDatabaseMapper implements IODatabaseMapper
private $sources = []; private $sources = [];
private $delimiter = ';'; private $delimiter = ';';
private $enclosure = '"'; private $enclosure = '"';
private $lineBuffer = 500; private $lineBuffer = 500;
private $autoIdentifyCsvSettings = false; private $autoIdentifyCsvSettings = false;

View File

@ -19,6 +19,7 @@ use phpOMS\Utils\IO\IODatabaseMapper;
class ExcelDatabaseMapper implements IODatabaseMapper class ExcelDatabaseMapper implements IODatabaseMapper
{ {
private $sources = []; private $sources = [];
private $lineBuffer = 500; private $lineBuffer = 500;
public function addSource(string $source) public function addSource(string $source)
@ -40,4 +41,3 @@ class ExcelDatabaseMapper implements IODatabaseMapper
{ {
} }
} }

View File

@ -11,7 +11,9 @@
* @link http://website.orange-management.de * @link http://website.orange-management.de
*/ */
declare(strict_types = 1); declare(strict_types = 1);
namespace phpOMS\Utils\IO\Zip; namespace phpOMS\Utils\IO\Zip;
/** /**
* Archive interface * Archive interface
* *

View File

@ -11,7 +11,9 @@
* @link http://website.orange-management.de * @link http://website.orange-management.de
*/ */
declare(strict_types = 1); declare(strict_types = 1);
namespace phpOMS\Utils\IO\Zip; namespace phpOMS\Utils\IO\Zip;
/** /**
* Zip class for handling zip files. * Zip class for handling zip files.
* *

View File

@ -11,7 +11,9 @@
* @link http://website.orange-management.de * @link http://website.orange-management.de
*/ */
declare(strict_types = 1); declare(strict_types = 1);
namespace phpOMS\Utils\IO\Zip; namespace phpOMS\Utils\IO\Zip;
/** /**
* Zip class for handling zip files. * Zip class for handling zip files.
* *
@ -44,7 +46,10 @@ class Tar implements ArchiveInterface
} }
if (is_dir($source)) { if (is_dir($source)) {
$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source), \RecursiveIteratorIterator::SELF_FIRST); $files = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($source),
\RecursiveIteratorIterator::SELF_FIRST
);
foreach ($files as $file) { foreach ($files as $file) {
$file = str_replace('\\', '/', $file); $file = str_replace('\\', '/', $file);

View File

@ -11,7 +11,9 @@
* @link http://website.orange-management.de * @link http://website.orange-management.de
*/ */
declare(strict_types = 1); declare(strict_types = 1);
namespace phpOMS\Utils\IO\Zip; namespace phpOMS\Utils\IO\Zip;
/** /**
* Zip class for handling zip files. * Zip class for handling zip files.
* *

View File

@ -66,7 +66,7 @@ class Zip implements ArchiveInterface
$absolute = realpath($file); $absolute = realpath($file);
$absolute = str_replace('\\', '/', $absolute); $absolute = str_replace('\\', '/', $absolute);
$dir = str_replace($source . '/', '', $relative . '/' . $absolute); $dir = str_replace($source . '/', '', $relative . '/' . $absolute);
if (is_dir($absolute)) { if (is_dir($absolute)) {
$zip->addEmptyDir($dir . '/'); $zip->addEmptyDir($dir . '/');

View File

@ -27,9 +27,13 @@ use phpOMS\Stdlib\Queue\PriorityQueue;
class JobQueue class JobQueue
{ {
private $queue = null; private $queue = null;
private $run = true; private $run = true;
private $suspended = false; private $suspended = false;
private $isTerminating = true; private $isTerminating = true;
private $isDeamonized; private $isDeamonized;
public function __construct() public function __construct()

View File

@ -123,9 +123,10 @@ class Markdown
public static function parse(string $text) : string public static function parse(string $text) : string
{ {
self::$definitionData = []; self::$definitionData = [];
$text = str_replace(["\r\n", "\r"], "\n", $text);
$text = trim($text, "\n"); $text = str_replace(["\r\n", "\r"], "\n", $text);
$lines = explode("\n", $text); $text = trim($text, "\n");
$lines = explode("\n", $text);
$markup = self::lines($lines); $markup = self::lines($lines);
return trim($markup, "\n"); return trim($markup, "\n");
@ -146,7 +147,7 @@ class Markdown
if (strpos($line, "\t") !== false) { if (strpos($line, "\t") !== false) {
$parts = explode("\t", $line); $parts = explode("\t", $line);
$line = $parts[0]; $line = $parts[0];
unset($parts[0]); unset($parts[0]);
@ -163,7 +164,7 @@ class Markdown
$indent ++; $indent ++;
} }
$text = $indent > 0 ? substr($line, $indent) : $line; $text = $indent > 0 ? substr($line, $indent) : $line;
$lineArray = ['body' => $line, 'indent' => $indent, 'text' => $text]; $lineArray = ['body' => $line, 'indent' => $indent, 'text' => $text];
if (isset($currentBlock['continuable'])) { if (isset($currentBlock['continuable'])) {
@ -178,7 +179,7 @@ class Markdown
} }
} }
$marker = $text[0]; $marker = $text[0];
$blockTypes = self::$unmarkedBlockTypes; $blockTypes = self::$unmarkedBlockTypes;
if (isset(self::$blockTypes[$marker])) { if (isset(self::$blockTypes[$marker])) {
@ -212,8 +213,8 @@ class Markdown
if (isset($currentBlock) && !isset($currentBlock['type']) && !isset($currentBlock['interrupted'])) { if (isset($currentBlock) && !isset($currentBlock['type']) && !isset($currentBlock['interrupted'])) {
$currentBlock['element']['text'] .= "\n" . $text; $currentBlock['element']['text'] .= "\n" . $text;
} else { } else {
$blocks[] = $currentBlock; $blocks[] = $currentBlock;
$currentBlock = self::paragraph($lineArray); $currentBlock = self::paragraph($lineArray);
$currentBlock['identified'] = true; $currentBlock['identified'] = true;
} }
} }
@ -250,15 +251,13 @@ class Markdown
return; return;
} }
$text = substr($lineArray['body'], 4);
return [ return [
'element' => [ 'element' => [
'name' => 'pre', 'name' => 'pre',
'handler' => 'element', 'handler' => 'element',
'text' => [ 'text' => [
'name' => 'code', 'name' => 'code',
'text' => $text, 'text' => substr($lineArray['body'], 4),
], ],
], ],
]; ];
@ -277,17 +276,13 @@ class Markdown
} }
$block['element']['text']['text'] .= "\n"; $block['element']['text']['text'] .= "\n";
$text = substr($lineArray['body'], 4); $block['element']['text']['text'] .= substr($lineArray['body'], 4);
$block['element']['text']['text'] .= $text;
return $block; return $block;
} }
protected static function blockCodeComplete(array $block) : array protected static function blockCodeComplete(array $block) : array
{ {
$text = $block['element']['text']['text'];
$block['element']['text']['text'] = $text;
return $block; return $block;
} }
@ -332,7 +327,7 @@ class Markdown
if (preg_match('/^' . $block['char'] . '{3,}[ ]*$/', $lineArray['text'])) { if (preg_match('/^' . $block['char'] . '{3,}[ ]*$/', $lineArray['text'])) {
$block['element']['text']['text'] = substr($block['element']['text']['text'], 1); $block['element']['text']['text'] = substr($block['element']['text']['text'], 1);
$block['complete'] = true; $block['complete'] = true;
return $block; return $block;
} }
@ -344,9 +339,6 @@ class Markdown
protected static function blockFencedCodeComplete(array $block) : array protected static function blockFencedCodeComplete(array $block) : array
{ {
$text = $block['element']['text']['text'];
$block['element']['text']['text'] = $text;
return $block; return $block;
} }
@ -365,12 +357,10 @@ class Markdown
return; return;
} }
$text = trim($lineArray['text'], '# ');
return [ return [
'element' => [ 'element' => [
'name' => 'h' . min(6, $level), 'name' => 'h' . min(6, $level),
'text' => $text, 'text' => trim($lineArray['text'], '# '),
'handler' => 'line', 'handler' => 'line',
], ],
]; ];
@ -393,8 +383,12 @@ class Markdown
], ],
]; ];
if($name === 'ol') { if ($name === 'ol') {
$listStart = stristr($matches[0], '.', true); $listStart = stristr($matches[0], '.', true);
if ($listStart !== '1') {
$block['element']['attributes'] = ['start' => $listStart];
}
} }
$block['li'] = [ $block['li'] = [
@ -421,16 +415,15 @@ class Markdown
unset($block['li']); unset($block['li']);
$text = isset($matches[1]) ? $matches[1] : '';
$block['li'] = [ $block['li'] = [
'name' => 'li', 'name' => 'li',
'handler' => 'li', 'handler' => 'li',
'text' => [ 'text' => [
$text, isset($matches[1]) ? $matches[1] : '',
], ],
]; ];
$block['element']['text'][] = & $block['li']; $block['element']['text'][] = &$block['li'];
return $block; return $block;
} }
@ -440,16 +433,14 @@ class Markdown
} }
if (!isset($block['interrupted'])) { if (!isset($block['interrupted'])) {
$text = preg_replace('/^[ ]{0,4}/', '', $lineArray['body']); $block['li']['text'][] = preg_replace('/^[ ]{0,4}/', '', $lineArray['body']);
$block['li']['text'][] = $text;
return $block; return $block;
} }
if ($lineArray['indent'] > 0) { if ($lineArray['indent'] > 0) {
$block['li']['text'][] = ''; $block['li']['text'][] = '';
$text = preg_replace('/^[ ]{0,4}/', '', $lineArray['body']); $block['li']['text'][] = preg_replace('/^[ ]{0,4}/', '', $lineArray['body']);
$block['li']['text'][] = $text;
unset($block['interrupted']); unset($block['interrupted']);
@ -527,13 +518,12 @@ class Markdown
return; return;
} }
$id = strtolower($matches[1]);
$data = [ $data = [
'url' => $matches[2], 'url' => $matches[2],
'title' => $matches[3] ?? null, 'title' => $matches[3] ?? null,
]; ];
self::$definitionData['Reference'][$id] = $data; self::$definitionData['Reference'][strtolower($matches[1])] = $data;
return ['hidden' => true]; return ['hidden' => true];
} }
@ -545,10 +535,10 @@ class Markdown
} }
if (strpos($block['element']['text'], '|') !== false && chop($lineArray['text'], ' -:|') === '') { if (strpos($block['element']['text'], '|') !== false && chop($lineArray['text'], ' -:|') === '') {
$alignments = []; $alignments = [];
$divider = $lineArray['text']; $divider = $lineArray['text'];
$divider = trim($divider); $divider = trim($divider);
$divider = trim($divider, '|'); $divider = trim($divider, '|');
$dividerCells = explode('|', $divider); $dividerCells = explode('|', $divider);
foreach ($dividerCells as $dividerCell) { foreach ($dividerCells as $dividerCell) {
@ -572,23 +562,21 @@ class Markdown
} }
$headerElements = []; $headerElements = [];
$header = $block['element']['text']; $header = $block['element']['text'];
$header = trim($header); $header = trim($header);
$header = trim($header, '|'); $header = trim($header, '|');
$headerCells = explode('|', $header); $headerCells = explode('|', $header);
foreach ($headerCells as $index => $headerCell) { foreach ($headerCells as $index => $headerCell) {
$headerCell = trim($headerCell);
$headerElement = [ $headerElement = [
'name' => 'th', 'name' => 'th',
'text' => $headerCell, 'text' => trim($headerCell),
'handler' => 'line', 'handler' => 'line',
]; ];
if (isset($alignments[$index])) { if (isset($alignments[$index])) {
$alignment = $alignments[$index];
$headerElement['attributes'] = [ $headerElement['attributes'] = [
'style' => 'text-align: ' . $alignment . ';', 'style' => 'text-align: ' . $alignments[$index] . ';',
]; ];
} }
@ -633,18 +621,17 @@ class Markdown
if ($lineArray['text'][0] === '|' || strpos($lineArray['text'], '|')) { if ($lineArray['text'][0] === '|' || strpos($lineArray['text'], '|')) {
$elements = []; $elements = [];
$row = $lineArray['text']; $row = $lineArray['text'];
$row = trim($row); $row = trim($row);
$row = trim($row, '|'); $row = trim($row, '|');
preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]+`|`)+/', $row, $matches); preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]+`|`)+/', $row, $matches);
foreach ($matches[0] as $index => $cell) { foreach ($matches[0] as $index => $cell) {
$cell = trim($cell);
$element = [ $element = [
'name' => 'td', 'name' => 'td',
'handler' => 'line', 'handler' => 'line',
'text' => $cell, 'text' => trim($cell),
]; ];
if (isset($block['alignments'][$index])) { if (isset($block['alignments'][$index])) {
@ -656,12 +643,11 @@ class Markdown
$elements[] = $element; $elements[] = $element;
} }
$element = [ $block['element']['text'][1]['text'][] = [
'name' => 'tr', 'name' => 'tr',
'handler' => 'elements', 'handler' => 'elements',
'text' => $elements, 'text' => $elements,
]; ];
$block['element']['text'][1]['text'][] = $element;
return $block; return $block;
} }
@ -683,9 +669,9 @@ class Markdown
$markup = ''; $markup = '';
while ($excerpt = strpbrk($text, self::$inlineMarkerList)) { while ($excerpt = strpbrk($text, self::$inlineMarkerList)) {
$marker = $excerpt[0]; $marker = $excerpt[0];
$markerPosition = strpos($text, $marker); $markerPosition = strpos($text, $marker);
$excerptArray = ['text' => $excerpt, 'context' => $text]; $excerptArray = ['text' => $excerpt, 'context' => $text];
foreach (self::$inlineTypes[$marker] as $inlineType) { foreach (self::$inlineTypes[$marker] as $inlineType) {
$inline = self::{'inline' . $inlineType}($excerptArray); $inline = self::{'inline' . $inlineType}($excerptArray);
@ -703,16 +689,16 @@ class Markdown
} }
$unmarkedText = substr($text, 0, $inline['position']); $unmarkedText = substr($text, 0, $inline['position']);
$markup .= self::unmarkedText($unmarkedText); $markup .= self::unmarkedText($unmarkedText);
$markup .= isset($inline['markup']) ? $inline['markup'] : self::element($inline['element']); $markup .= isset($inline['markup']) ? $inline['markup'] : self::element($inline['element']);
$text = substr($text, $inline['position'] + $inline['extent']); $text = substr($text, $inline['position'] + $inline['extent']);
continue 2; continue 2;
} }
$unmarkedText = substr($text, 0, $markerPosition + 1); $unmarkedText = substr($text, 0, $markerPosition + 1);
$markup .= self::unmarkedText($unmarkedText); $markup .= self::unmarkedText($unmarkedText);
$text = substr($text, $markerPosition + 1); $text = substr($text, $markerPosition + 1);
} }
$markup .= self::unmarkedText($text); $markup .= self::unmarkedText($text);
@ -728,13 +714,11 @@ class Markdown
return; return;
} }
$text = preg_replace("/[ ]*\n/", ' ', $matches[2]);
return [ return [
'extent' => strlen($matches[0]), 'extent' => strlen($matches[0]),
'element' => [ 'element' => [
'name' => 'code', 'name' => 'code',
'text' => $text, 'text' => preg_replace("/[ ]*\n/", ' ', $matches[2]),
], ],
]; ];
} }
@ -808,7 +792,7 @@ class Markdown
} }
$excerpt['text'] = substr($excerpt['text'], 1); $excerpt['text'] = substr($excerpt['text'], 1);
$link = self::inlineLink($excerpt); $link = self::inlineLink($excerpt);
if (!isset($link)) { if (!isset($link)) {
return; return;
@ -843,7 +827,8 @@ class Markdown
'title' => null, 'title' => null,
], ],
]; ];
$extent = 0;
$extent = 0;
$remainder = $excerpt['text']; $remainder = $excerpt['text'];
if (!preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches)) { if (!preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches)) {
@ -851,8 +836,8 @@ class Markdown
} }
$element['text'] = $matches[1]; $element['text'] = $matches[1];
$extent += strlen($matches[0]); $extent += strlen($matches[0]);
$remainder = substr($remainder, $extent); $remainder = substr($remainder, $extent);
if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*"|\'[^\']*\'))?\s*[)]/', $remainder, $matches)) { if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*"|\'[^\']*\'))?\s*[)]/', $remainder, $matches)) {
$element['attributes']['href'] = $matches[1]; $element['attributes']['href'] = $matches[1];
@ -866,6 +851,7 @@ class Markdown
if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) { if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) {
$definition = strlen($matches[1]) ? $matches[1] : $element['text']; $definition = strlen($matches[1]) ? $matches[1] : $element['text'];
$definition = strtolower($definition); $definition = strtolower($definition);
$extent += strlen($matches[0]); $extent += strlen($matches[0]);
} else { } else {
$definition = strtolower($element['text']); $definition = strtolower($element['text']);
@ -876,7 +862,8 @@ class Markdown
} }
$def = self::$definitionData['Reference'][$definition]; $def = self::$definitionData['Reference'][$definition];
$element['attributes']['href'] = $def['url'];
$element['attributes']['href'] = $def['url'];
$element['attributes']['title'] = $def['title']; $element['attributes']['title'] = $def['title'];
} }
@ -954,15 +941,13 @@ class Markdown
return; return;
} }
$url = $matches[1];
return [ return [
'extent' => strlen($matches[0]), 'extent' => strlen($matches[0]),
'element' => [ 'element' => [
'name' => 'a', 'name' => 'a',
'text' => $url, 'text' => $matches[1],
'attributes' => [ 'attributes' => [
'href' => $url, 'href' => $matches[1],
], ],
], ],
]; ];
@ -979,7 +964,7 @@ class Markdown
protected static function element(array $element) : string protected static function element(array $element) : string
{ {
$element = self::sanitizeElement($element); $element = self::sanitizeElement($element);
$markup = '<' . $element['name']; $markup = '<' . $element['name'];
if (isset($element['attributes'])) { if (isset($element['attributes'])) {
foreach ($element['attributes'] as $name => $value) { foreach ($element['attributes'] as $name => $value) {
@ -1017,14 +1002,14 @@ class Markdown
protected static function li(array $lines) : string protected static function li(array $lines) : string
{ {
$markup = self::lines($lines); $markup = self::lines($lines);
$trimmedMarkup = trim($markup); $trimmedMarkup = trim($markup);
if (!in_array('', $lines) && substr($trimmedMarkup, 0, 3) === '<p>') { if (!in_array('', $lines) && substr($trimmedMarkup, 0, 3) === '<p>') {
$markup = $trimmedMarkup; $markup = $trimmedMarkup;
$markup = substr($markup, 3); $markup = substr($markup, 3);
$position = strpos($markup, '</p>'); $position = strpos($markup, '</p>');
$markup = substr_replace($markup, '', $position, 4); $markup = substr_replace($markup, '', $position, 4);
} }
return $markup; return $markup;

View File

@ -27,5 +27,5 @@ use phpOMS\Stdlib\Base\Enum;
abstract class DistributionType extends Enum abstract class DistributionType extends Enum
{ {
/* public */ const UNIFORM = 0; /* public */ const UNIFORM = 0;
/* public */ const NORMAL = 1; /* public */ const NORMAL = 1;
} }

View File

@ -24,7 +24,20 @@ namespace phpOMS\Utils\RnG;
*/ */
class LinearCongruentialGenerator class LinearCongruentialGenerator
{ {
/**
* BSD seed value.
*
* @var int
* @since 1.0.0
*/
private static $bsdSeed = 0; private static $bsdSeed = 0;
/**
* MSVCRT seed value.
*
* @var int
* @since 1.0.0
*/
private static $msvcrtSeed = 0; private static $msvcrtSeed = 0;
/** /**

View File

@ -469,17 +469,18 @@ class Name
'female' => ['none'], 'female' => ['none'],
'male' => ['none'], 'male' => ['none'],
'family' => [ 'family' => [
'Հովհաննիսյան', 'Հարությունյան', 'Սարգսյան', 'Խաչատրյան', 'Գրիգորյան', 'Հովհաննիսյան', 'Հարությունյան', 'Սարգսյան', 'Խաչատրյան', 'Գրիգորյան', 'আহমেদ', 'আলী', 'আক্তার',
'আহমেদ', 'আলী', 'আক্তার', 'বন্দ্যোপাধ্যায়', 'নিক', 'ব্যাপারী', 'বড়ুয়া', 'বিশ্বাস', 'ভৌমিক', 'বসু', 'বন্দ্যোপাধ্যায়', 'নিক', 'ব্যাপারী', 'বড়ুয়া', 'বিশ্বাস', 'ভৌমিক', 'বসু', '王', '李', '张', '刘', '陈', '杨',
'王', '李', '张', '刘', '陈', '杨', '黄', '赵', '吴', '周', '徐', '孙', '马', '朱', '胡', '郭', '何', '高', '林', '罗', '黄', '赵', '吴', '周', '徐', '孙', '马', '朱', '胡', '郭', '何', '高', '林', '罗', 'כהן', 'לוי',
'כהן', 'לוי', 'מזרחי', 'פרץ', 'ביטון', 'דהן', 'אברהם', 'פרידמן', 'מלכה', 'אזולאי', 'כץ', 'יוסף', 'דוד', 'עמר', 'אוחיון', 'מזרחי', 'פרץ', 'ביטון', 'דהן', 'אברהם', 'פרידמן', 'מלכה', 'אזולאי', 'כץ', 'יוסף', 'דוד', 'עמר',
'김', '리', '박', '최', '정', '강', '조', '윤', '장', '림', '한', '신', '서', '권', '황', '안', '송', '홍', '고', '문', '손', '량', 'אוחיון', '김', '리', '박', '최', '정', '강', '조', '윤', '장', '림', '한', '신', '서', '권', '황',
'Yılmaz', 'Kaya', 'Demir', 'Şahin', 'Çelik', 'Yıldız', 'Yıldırım', 'Öztürk', 'Aydın', 'Özdemir', 'Arslan', 'Doğan', 'Kılıç', 'Aslan', 'Çetin', 'Kara', 'Koç', 'Kurt', 'Özkan', 'Şimşek', '안', '송', '홍', '고', '문', '손', '량', 'Yılmaz', 'Kaya', 'Demir', 'Şahin', 'Çelik', 'Yıldız',
'Yıldırım', 'Öztürk', 'Aydın', 'Özdemir', 'Arslan', 'Doğan', 'Kılıç', 'Aslan', 'Çetin', 'Kara',
'Koç', 'Kurt', 'Özkan', 'Şimşek',
], ],
] ]
]; ];
/** /**
* Get a random string. * Get a random string.
* *

View File

@ -55,7 +55,10 @@ class Phone
$numberParts = substr_count($layout['struct'], '$'); $numberParts = substr_count($layout['struct'], '$');
for ($i = ($isInt ? 2 : 1); $i < $numberParts; $i++) { for ($i = ($isInt ? 2 : 1); $i < $numberParts; $i++) {
$numberString = str_replace('$' . $i, StringUtils::generateString($layout['size'][$i - 1][0], $layout['size'][$i - 1][1], '0123456789'), $numberString); $numberString = str_replace(
'$' . $i, StringUtils::generateString($layout['size'][$i - 1][0], $layout['size'][$i - 1][1], '0123456789'),
$numberString
);
} }
return $numberString; return $numberString;

View File

@ -36,7 +36,9 @@ class StringUtils
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function generateString(int $min = 10, int $max = 10, string $charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') : string public static function generateString(int $min = 10, int $max = 10,
string $charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
) : string
{ {
$length = mt_rand($min, $max); $length = mt_rand($min, $max);
$charactersLength = strlen($charset); $charactersLength = strlen($charset);

View File

@ -31,7 +31,7 @@ class Text
* @var string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
private static $words_west = [ private static $wordsWest = [
'lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'curabitur', 'vel', 'hendrerit', 'libero', 'lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'curabitur', 'vel', 'hendrerit', 'libero',
'eleifend', 'blandit', 'nunc', 'ornare', 'odio', 'ut', 'orci', 'gravida', 'imperdiet', 'nullam', 'purus', 'lacinia', 'a', 'eleifend', 'blandit', 'nunc', 'ornare', 'odio', 'ut', 'orci', 'gravida', 'imperdiet', 'nullam', 'purus', 'lacinia', 'a',
'pretium', 'quis', 'congue', 'praesent', 'sagittis', 'laoreet', 'auctor', 'mauris', 'non', 'velit', 'eros', 'dictum', 'pretium', 'quis', 'congue', 'praesent', 'sagittis', 'laoreet', 'auctor', 'mauris', 'non', 'velit', 'eros', 'dictum',
@ -131,7 +131,7 @@ class Text
} }
if ($words === null) { if ($words === null) {
$words = self::$words_west; $words = self::$wordsWest;
} }
$punctuation = $this->generatePunctuation($length); $punctuation = $this->generatePunctuation($length);
@ -294,7 +294,7 @@ class Text
$paragraphLength = $length - $i; $paragraphLength = $length - $i;
} }
$i += $paragraphLength; $i += $paragraphLength;
$paragraph[] = $i; $paragraph[] = $i;
} }

View File

@ -100,7 +100,7 @@ class StringCompare
{ {
$words1 = preg_split('/[ _-]/', $s1); $words1 = preg_split('/[ _-]/', $s1);
$words2 = preg_split('/[ _-]/', $s2); $words2 = preg_split('/[ _-]/', $s2);
$total = 0; $total = 0;
foreach ($words1 as $word1) { foreach ($words1 as $word1) {
$best = strlen($s2); $best = strlen($s2);
@ -156,19 +156,24 @@ class StringCompare
/** /**
* Calculate fuzzy match score. * Calculate fuzzy match score.
* *
* @param string $s1 Word 1 * @param string $s1 Word 1
* @param string $s2 Word 2 * @param string $s2 Word 2
* @param float $phraseWeight Weighting for phrase score * @param float $phraseWeight Weighting for phrase score
* @param float $wordWeight Weighting for word score * @param float $wordWeight Weighting for word score
* @param float $minWeight Min weight * @param float $minWeight Min weight
* @param float $maxWeight Max weight * @param float $maxWeight Max weight
* @param float $lengthWeight Weighting for word length * @param float $lengthWeight Weighting for word length
* *
* @return float * @return float
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function fuzzyMatch(string $s1, string $s2, float $phraseWeight = 0.5, float $wordWeight = 1, float $minWeight = 10, float $maxWeight = 1, float $lengthWeight = -0.3) : float public static function fuzzyMatch(
string $s1, string $s2,
float $phraseWeight = 0.5, float $wordWeight = 1,
float $minWeight = 10, float $maxWeight = 1,
float $lengthWeight = -0.3
) : float
{ {
$phraseValue = self::valuePhrase($s1, $s2); $phraseValue = self::valuePhrase($s1, $s2);
$wordValue = self::valueWords($s1, $s2); $wordValue = self::valueWords($s1, $s2);

View File

@ -356,12 +356,12 @@ class StringUtils
*/ */
public static function getEntropy(string $value) : float public static function getEntropy(string $value) : float
{ {
$entroy = 0.0; $entroy = 0.0;
$size = mb_strlen($value); $size = mb_strlen($value);
$countChars = self::mb_count_chars($value); $countChars = self::mb_count_chars($value);
foreach ($countChars as $v) { foreach ($countChars as $v) {
$p = $v / $size; $p = $v / $size;
$entroy -= $p * log($p) / log(2); $entroy -= $p * log($p) / log(2);
} }

View File

@ -88,7 +88,7 @@ class Cron extends SchedulerAbstract
$jobs = []; $jobs = [];
foreach ($lines as $line) { foreach ($lines as $line) {
if($line !== '' && strrpos($line, '#', -strlen($line)) === false) { if ($line !== '' && strrpos($line, '#', -strlen($line)) === false) {
$jobs[] = CronJob::createWith(str_getcsv($line, ' ')); $jobs[] = CronJob::createWith(str_getcsv($line, ' '));
} }
} }
@ -109,7 +109,7 @@ class Cron extends SchedulerAbstract
foreach ($lines as $line) { foreach ($lines as $line) {
$csv = str_getcsv($line, ' '); $csv = str_getcsv($line, ' ');
if($line !== '' && strrpos($line, '#', -strlen($line)) === false && $csv[5] === $name) { if ($line !== '' && strrpos($line, '#', -strlen($line)) === false && $csv[5] === $name) {
$jobs[] = CronJob::createWith($csv); $jobs[] = CronJob::createWith($csv);
} }
} }
@ -118,7 +118,7 @@ class Cron extends SchedulerAbstract
foreach ($lines as $line) { foreach ($lines as $line) {
$csv = str_getcsv($line, ' '); $csv = str_getcsv($line, ' ');
if($line !== '' && strrpos($line, '#', -strlen($line)) === false && stripos($csv[5], $name) !== false) { if ($line !== '' && strrpos($line, '#', -strlen($line)) === false && stripos($csv[5], $name) !== false) {
$jobs[] = CronJob::createWith($csv); $jobs[] = CronJob::createWith($csv);
} }
} }

View File

@ -13,6 +13,7 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace phpOMS\Utils\TaskSchedule; namespace phpOMS\Utils\TaskSchedule;
use phpOMS\System\File\PathException; use phpOMS\System\File\PathException;
/** /**

View File

@ -91,10 +91,10 @@ abstract class TaskAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct(string $name, string $cmd = '') { public function __construct(string $name, string $cmd = '')
$this->id = $name; {
$this->command = $cmd; $this->id = $name;
$this->command = $cmd;
$this->lastRunTime = new \DateTime('1900-01-01'); $this->lastRunTime = new \DateTime('1900-01-01');
$this->nextRunTime = new \DateTime('1900-01-01'); $this->nextRunTime = new \DateTime('1900-01-01');
} }

View File

@ -30,8 +30,8 @@ final class TaskFactory
/** /**
* Create task instance. * Create task instance.
* *
* @param string $id Task id * @param string $id Task id
* @param string $cmd Command to run * @param string $cmd Command to run
* *
* @return TaskAbstract * @return TaskAbstract
* *

View File

@ -11,7 +11,9 @@
* @link http://website.orange-management.de * @link http://website.orange-management.de
*/ */
declare(strict_types = 1); declare(strict_types = 1);
namespace phpOMS\Utils; namespace phpOMS\Utils;
/** /**
* Test utils. * Test utils.
* *

View File

@ -17,7 +17,7 @@ namespace phpOMS\Validation\Base;
use phpOMS\Validation\ValidatorAbstract; use phpOMS\Validation\ValidatorAbstract;
/** /**
* Validator abstract. * Validate date.
* *
* @package Validation * @package Validation
* @license OMS License 1.0 * @license OMS License 1.0

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Finance
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -17,14 +17,14 @@ namespace phpOMS\Validation\Finance;
use phpOMS\Validation\ValidatorAbstract; use phpOMS\Validation\ValidatorAbstract;
/** /**
* Validator abstract. * Validate BIC
* *
* @package Validation * @package phpOMS\Validation\Finance
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
class BIC extends ValidatorAbstract abstract class BIC extends ValidatorAbstract
{ {
/** /**

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Finance
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -17,9 +17,9 @@ namespace phpOMS\Validation\Finance;
use phpOMS\Validation\ValidatorAbstract; use phpOMS\Validation\ValidatorAbstract;
/** /**
* Validator abstract. * Credit card validation
* *
* @package Validation * @package phpOMS\Validation\Finance
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Finance
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -17,9 +17,9 @@ namespace phpOMS\Validation\Finance;
use phpOMS\Validation\ValidatorAbstract; use phpOMS\Validation\ValidatorAbstract;
/** /**
* Validator abstract. * Iban validation.
* *
* @package Validation * @package phpOMS\Validation\Finance
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Finance
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -19,7 +19,7 @@ use phpOMS\Stdlib\Base\Enum;
/** /**
* Iban layout definition. * Iban layout definition.
* *
* @package Framework * @package phpOMS\Validation\Finance
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Finance
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -19,16 +19,16 @@ use phpOMS\Stdlib\Base\Enum;
/** /**
* Iban error type enum. * Iban error type enum.
* *
* @package Framework * @package phpOMS\Validation\Finance
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class IbanErrorType extends Enum abstract class IbanErrorType extends Enum
{ {
/* public */ const INVALID_COUNTRY = 1; /* public */ const INVALID_COUNTRY = 1;
/* public */ const INVALID_LENGTH = 2; /* public */ const INVALID_LENGTH = 2;
/* public */ const INVALID_CHECKSUM = 4; /* public */ const INVALID_CHECKSUM = 4;
/* public */ const EXPECTED_ZERO = 8; /* public */ const EXPECTED_ZERO = 8;
/* public */ const EXPECTED_NUMERIC = 16; /* public */ const EXPECTED_NUMERIC = 16;
} }

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Network
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -17,14 +17,14 @@ namespace phpOMS\Validation\Network;
use phpOMS\Validation\ValidatorAbstract; use phpOMS\Validation\ValidatorAbstract;
/** /**
* Validator abstract. * Validate email.
* *
* @package Validation * @package phpOMS\Validation\Network
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
class Email extends ValidatorAbstract abstract class Email extends ValidatorAbstract
{ {
/** /**

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Network
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -17,9 +17,9 @@ namespace phpOMS\Validation\Network;
use phpOMS\Validation\ValidatorAbstract; use phpOMS\Validation\ValidatorAbstract;
/** /**
* Validator abstract. * Validate hostname.
* *
* @package Validation * @package phpOMS\Validation\Network
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0

View File

@ -4,7 +4,7 @@
* *
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package phpOMS\Validation\Network
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -17,14 +17,14 @@ namespace phpOMS\Validation\Network;
use phpOMS\Validation\ValidatorAbstract; use phpOMS\Validation\ValidatorAbstract;
/** /**
* Validator abstract. * Validate IP.
* *
* @package Validation * @package phpOMS\Validation\Network
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
class Ip extends ValidatorAbstract abstract class Ip extends ValidatorAbstract
{ {
/** /**

View File

@ -45,8 +45,8 @@ final class Validator extends ValidatorAbstract
foreach ($constraints as $callback => $settings) { foreach ($constraints as $callback => $settings) {
$callback = StringUtils::endsWith($callback, 'Not') ? substr($callback, 0, -3) : $callback; $callback = StringUtils::endsWith($callback, 'Not') ? substr($callback, 0, -3) : $callback;
$valid = self::$callback($var, ...$settings); $valid = self::$callback($var, ...$settings);
$valid = (StringUtils::endsWith($callback, 'Not') ? $valid : !$valid); $valid = (StringUtils::endsWith($callback, 'Not') ? $valid : !$valid);
if (!$valid) { if (!$valid) {
return false; return false;

View File

@ -58,15 +58,11 @@ abstract class ValidatorAbstract implements ValidatorInterface
} }
/** /**
* Reset error information * {@inheritdoc}
*
* @return bool
*
* @since 1.0.0
*/ */
public static function resetError() /* : void */ public static function resetError() /* : void */
{ {
self::$error = 0; self::$error = 0;
self::$msg = ''; self::$msg = '';
} }
} }

View File

@ -28,7 +28,7 @@ interface ValidatorInterface
/** /**
* Check if value is valid. * Check if value is valid.
* *
* @param mixed $value Value to validate * @param mixed $value Value to validate
* @param array $constraints Constraints for validation * @param array $constraints Constraints for validation
* *
* @return bool * @return bool
@ -54,4 +54,13 @@ interface ValidatorInterface
* @since 1.0.0 * @since 1.0.0
*/ */
public static function getErrorCode() : int; public static function getErrorCode() : int;
/**
* Reset error information
*
* @return void
*
* @since 1.0.0
*/
public static function resetError() /* : void */;
} }

View File

@ -22,7 +22,7 @@ use phpOMS\Module\Exception\InvalidModuleException;
use phpOMS\Module\Exception\InvalidThemeException; use phpOMS\Module\Exception\InvalidThemeException;
/** /**
* List view. * Basic view which can be used as basis for specific implementations.
* *
* @package phpOMS\Views * @package phpOMS\Views
* @license OMS License 1.0 * @license OMS License 1.0
@ -89,6 +89,8 @@ class View extends ViewAbstract
} }
/** /**
* Get data attached to view
*
* @param string $id Data Id * @param string $id Data Id
* *
* @return mixed * @return mixed
@ -101,6 +103,8 @@ class View extends ViewAbstract
} }
/** /**
* Set data of view
*
* @param string $id Data ID * @param string $id Data ID
* @param mixed $data Data * @param mixed $data Data
* *
@ -134,6 +138,8 @@ class View extends ViewAbstract
} }
/** /**
* Add data to view
*
* @param string $id Data ID * @param string $id Data ID
* @param mixed $data Data * @param mixed $data Data
* *
@ -226,6 +232,8 @@ class View extends ViewAbstract
} }
/** /**
* Get request of view
*
* @return RequestAbstract * @return RequestAbstract
* *
* @since 1.0.0 * @since 1.0.0
@ -236,6 +244,8 @@ class View extends ViewAbstract
} }
/** /**
* Get response of view
*
* @return ResponseAbstract * @return ResponseAbstract
* *
* @since 1.0.0 * @since 1.0.0
@ -244,5 +254,4 @@ class View extends ViewAbstract
{ {
return $this->response; return $this->response;
} }
} }

View File

@ -17,7 +17,7 @@ namespace phpOMS\Views;
use phpOMS\System\File\PathException; use phpOMS\System\File\PathException;
/** /**
* List view. * View Abstract.
* *
* @package phpOMS\Views * @package phpOMS\Views
* @license OMS License 1.0 * @license OMS License 1.0
@ -46,7 +46,7 @@ abstract class ViewAbstract implements \Serializable
/** /**
* Constructor. * Constructor.
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function __construct() public function __construct()
{ {
@ -60,7 +60,7 @@ abstract class ViewAbstract implements \Serializable
* *
* @return int * @return int
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
private static function viewSort(array $a, array $b) : int private static function viewSort(array $a, array $b) : int
{ {
@ -76,7 +76,7 @@ abstract class ViewAbstract implements \Serializable
* *
* @return string * @return string
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function getTemplate() : string public function getTemplate() : string
{ {
@ -86,11 +86,11 @@ abstract class ViewAbstract implements \Serializable
/** /**
* Set the template. * Set the template.
* *
* @param string $template * @param string $template View template
* *
* @return void * @return void
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function setTemplate(string $template) /* : void */ public function setTemplate(string $template) /* : void */
{ {
@ -98,9 +98,11 @@ abstract class ViewAbstract implements \Serializable
} }
/** /**
* Returns all views
*
* @return View[] * @return View[]
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function getViews() : array public function getViews() : array
{ {
@ -108,11 +110,13 @@ abstract class ViewAbstract implements \Serializable
} }
/** /**
* Returns a specific view
*
* @param string $id View ID * @param string $id View ID
* *
* @return false|View * @return false|View
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function getView($id) public function getView($id)
{ {
@ -124,13 +128,13 @@ abstract class ViewAbstract implements \Serializable
} }
/** /**
* Remove view. * Remove view bz id
* *
* @param string $id View ID * @param string $id View ID
* *
* @return bool * @return bool
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function removeView(string $id) : bool public function removeView(string $id) : bool
{ {
@ -147,13 +151,13 @@ abstract class ViewAbstract implements \Serializable
* Add view. * Add view.
* *
* @param string $id View ID * @param string $id View ID
* @param View $view * @param View $view View to add
* @param int $order Order of view * @param int $order Order of view
* @param bool $overwrite Overwrite existing view * @param bool $overwrite Overwrite existing view
* *
* @return bool * @return bool
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function addView(string $id, View $view, int $order = 0, bool $overwrite = true) : bool public function addView(string $id, View $view, int $order = 0, bool $overwrite = true) : bool
{ {
@ -175,7 +179,7 @@ abstract class ViewAbstract implements \Serializable
* *
* @return string * @return string
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function serialize() public function serialize()
{ {
@ -191,7 +195,7 @@ abstract class ViewAbstract implements \Serializable
* *
* @return array * @return array
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function toArray() : array public function toArray() : array
{ {
@ -211,11 +215,11 @@ abstract class ViewAbstract implements \Serializable
/** /**
* Get view/template response. * Get view/template response.
* *
* @param array $data Data to pass to renderer * @param array ...$data Data to pass to renderer
* *
* @return string * @return string
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
*/ */
public function render(...$data) : string public function render(...$data) : string
{ {
@ -230,7 +234,7 @@ abstract class ViewAbstract implements \Serializable
ob_start(); ob_start();
/** @noinspection PhpIncludeInspection */ /** @noinspection PhpIncludeInspection */
$includeData = include $path; $includeData = include $path;
$ob = ob_get_clean(); $ob = ob_get_clean();
if (is_array($includeData)) { if (is_array($includeData)) {
return json_encode($includeData); return json_encode($includeData);
@ -249,11 +253,10 @@ abstract class ViewAbstract implements \Serializable
* *
* @return void * @return void
* *
* @since 1.0.0 <d.eichhorn@oms.com> * @since 1.0.0
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
public function unserialize($raw) public function unserialize($raw)
{ {
} }
} }

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -5,7 +5,6 @@
* PHP Version 7.1 * PHP Version 7.1
* *
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

Some files were not shown because too many files have changed in this diff Show More