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

@ -120,6 +120,8 @@ class Group implements ArrayableInterface, \JsonSerializable
* Set group name.
*
* @param string $name Group name
*
* @return void
*
* @since 1.0.0
*/
@ -144,6 +146,8 @@ class Group implements ArrayableInterface, \JsonSerializable
* Set group description.
*
* @param string $description Group description
*
* @return void
*
* @since 1.0.0
*/
@ -168,12 +172,19 @@ class Group implements ArrayableInterface, \JsonSerializable
* Set group status.
*
* @param int $status Group status
*
* @return void
*
* @throws InvalidEnumValue
*
* @since 1.0.0
*/
public function setStatus(int $status) /* : void */
{
// todo: check valid
if (!GroupStatus::isValidValue($status)) {
throw new InvalidEnumValue($status);
}
$this->status = $status;
}

View File

@ -4,7 +4,7 @@
*
* PHP Version 7.1
*
* @package TBD
* @package phpOMS
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
@ -16,6 +16,10 @@ namespace phpOMS;
/**
* 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 string appName
@ -31,7 +35,7 @@ namespace phpOMS;
* @property \phpOMS\Account\AccountManager accountManager
* @property \phpOMS\Log\FileLogger logger
*
* @package Framework
* @package phpOMS
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0

View File

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

View File

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

View File

@ -335,7 +335,8 @@ class Http implements UriInterface
*/
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
*/
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+');
/** @noinspection PhpMethodParametersCountMismatchInspection */

View File

@ -308,9 +308,23 @@ abstract class C128Abstract
$cur_size = $location + (int) (substr($codeString, ($position - 1), 1));
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 {
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;

View File

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

View File

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

View File

@ -27,5 +27,5 @@ use phpOMS\Stdlib\Base\Enum;
abstract class OrientationType extends Enum
{
/* 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
{
$i = (255 & $rgb['r']) << 16;
$i = (255 & $rgb['r']) << 16;
$i += (255 & $rgb['g']) << 8;
$i += (255 & $rgb['b']);

View File

@ -45,4 +45,4 @@ interface CompressionInterface
* @since 1.0.0
*/
public function decompress(string $compressed) : string;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,10 +36,17 @@ class Ip
{
}
/**
* Convert ip to float
*
* @param string $ip IP
*
* @since 1.0.0
*/
public static function ip2Float(string $ip) : float
{
$split = explode('.', $ip);
return $split[0] * (256 ** 3) + $split[1] * (256 ** 2) + $split[2] * (256 ** 1) + $split[3];
}
}
}

View File

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

View File

@ -31,7 +31,11 @@ class Numeric
* @var array
* @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.
@ -72,7 +76,13 @@ class Numeric
$newOutput = 0;
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;
@ -136,7 +146,7 @@ class Numeric
foreach (self::ROMANS as $key => $value) {
while (strpos($roman, $key) === 0) {
$result += $value;
$roman = substr($roman, strlen($key));
$roman = substr($roman, strlen($key));
}
}
@ -159,7 +169,7 @@ class Numeric
$alpha = '';
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);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -91,4 +91,4 @@ class Caesar
return $result;
}
}
}

View File

@ -45,4 +45,4 @@ interface EncodingInterface
* @since 1.0.0
*/
public static function decode($decoded);
}
}

View File

@ -45,4 +45,4 @@ final class Gray
return $source;
}
}
}

View File

@ -215,4 +215,4 @@ final class Dictionary
return null;
}
}
}

View File

@ -147,4 +147,4 @@ final class Huffman
return $source;
}
}
}

View File

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

View File

@ -179,4 +179,4 @@ class Author
{
return $this->removalsCount;
}
}
}

View File

@ -67,4 +67,4 @@ class Branch
{
$this->name = $name;
}
}
}

View File

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

View File

@ -157,9 +157,14 @@ class Repository
private function run(string $cmd) : array
{
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 {
$cmd = escapeshellarg(Git::getBin()) . ' -C ' . escapeshellarg($this->path) . ' ' . $cmd;
$cmd = escapeshellarg(Git::getBin())
. ' -C ' . escapeshellarg($this->path) . ' '
. $cmd;
}
$pipes = [];
@ -626,7 +631,7 @@ class Repository
*
* @since 1.0.0
*/
public function getLOC(array $extensions = ['*']) : int
public function getLoc(array $extensions = ['*']) : int
{
$lines = $this->run('ls-files');
$loc = 0;
@ -750,12 +755,17 @@ class Repository
}
$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) {
$nums = explode(' ', $line);
$addremove['added'] += $nums[0];
$addremove['added'] += $nums[0];
$addremove['removed'] += $nums[1];
}
@ -801,7 +811,11 @@ class Repository
$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);
$commits = [];

View File

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

View File

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

View File

@ -19,6 +19,7 @@ use phpOMS\Utils\IO\IODatabaseMapper;
class ExcelDatabaseMapper implements IODatabaseMapper
{
private $sources = [];
private $lineBuffer = 500;
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
*/
declare(strict_types = 1);
namespace phpOMS\Utils\IO\Zip;
/**
* Archive interface
*

View File

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

View File

@ -11,7 +11,9 @@
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace phpOMS\Utils\IO\Zip;
/**
* Zip class for handling zip files.
*
@ -44,7 +46,10 @@ class Tar implements ArchiveInterface
}
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) {
$file = str_replace('\\', '/', $file);

View File

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

View File

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

View File

@ -48,4 +48,4 @@ class Job
{
$this->priority = $priority;
}
}
}

View File

@ -27,9 +27,13 @@ use phpOMS\Stdlib\Queue\PriorityQueue;
class JobQueue
{
private $queue = null;
private $run = true;
private $suspended = false;
private $isTerminating = true;
private $isDeamonized;
public function __construct()
@ -139,4 +143,4 @@ class JobQueue
{
// todo: save pid somewhere for kill
}
}
}

View File

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

View File

@ -121,4 +121,4 @@ class Permutation
return $toPermute;
}
}
}

View File

@ -67,4 +67,4 @@ class ArrayRandomize
return $shuffled;
}
}
}

View File

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

View File

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

View File

@ -469,17 +469,18 @@ class Name
'female' => ['none'],
'male' => ['none'],
'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.
*

View File

@ -55,7 +55,10 @@ class Phone
$numberParts = substr_count($layout['struct'], '$');
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;

View File

@ -36,7 +36,9 @@ class StringUtils
*
* @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);
$charactersLength = strlen($charset);

View File

@ -31,7 +31,7 @@ class Text
* @var string[]
* @since 1.0.0
*/
private static $words_west = [
private static $wordsWest = [
'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',
'pretium', 'quis', 'congue', 'praesent', 'sagittis', 'laoreet', 'auctor', 'mauris', 'non', 'velit', 'eros', 'dictum',
@ -131,7 +131,7 @@ class Text
}
if ($words === null) {
$words = self::$words_west;
$words = self::$wordsWest;
}
$punctuation = $this->generatePunctuation($length);
@ -294,7 +294,7 @@ class Text
$paragraphLength = $length - $i;
}
$i += $paragraphLength;
$i += $paragraphLength;
$paragraph[] = $i;
}

View File

@ -100,7 +100,7 @@ class StringCompare
{
$words1 = preg_split('/[ _-]/', $s1);
$words2 = preg_split('/[ _-]/', $s2);
$total = 0;
$total = 0;
foreach ($words1 as $word1) {
$best = strlen($s2);
@ -156,19 +156,24 @@ class StringCompare
/**
* Calculate fuzzy match score.
*
* @param string $s1 Word 1
* @param string $s2 Word 2
* @param string $s1 Word 1
* @param string $s2 Word 2
* @param float $phraseWeight Weighting for phrase score
* @param float $wordWeight Weighting for word score
* @param float $minWeight Min weight
* @param float $maxWeight Max weight
* @param float $wordWeight Weighting for word score
* @param float $minWeight Min weight
* @param float $maxWeight Max weight
* @param float $lengthWeight Weighting for word length
*
* @return float
*
* @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);
$wordValue = self::valueWords($s1, $s2);
@ -178,4 +183,4 @@ class StringCompare
+ max($phraseValue * $phraseWeight, $wordValue * $wordWeight) * $maxWeight
+ $lengthValue * $lengthWeight;
}
}
}

View File

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

View File

@ -88,7 +88,7 @@ class Cron extends SchedulerAbstract
$jobs = [];
foreach ($lines as $line) {
if($line !== '' && strrpos($line, '#', -strlen($line)) === false) {
if ($line !== '' && strrpos($line, '#', -strlen($line)) === false) {
$jobs[] = CronJob::createWith(str_getcsv($line, ' '));
}
}
@ -109,7 +109,7 @@ class Cron extends SchedulerAbstract
foreach ($lines as $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);
}
}
@ -118,7 +118,7 @@ class Cron extends SchedulerAbstract
foreach ($lines as $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);
}
}

View File

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

View File

@ -47,4 +47,4 @@ final class SchedulerFactory
throw new \Exception('Unsupported system.');
}
}
}
}

View File

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

View File

@ -30,8 +30,8 @@ final class TaskFactory
/**
* Create task instance.
*
* @param string $id Task id
* @param string $cmd Command to run
* @param string $id Task id
* @param string $cmd Command to run
*
* @return TaskAbstract
*
@ -50,4 +50,4 @@ final class TaskFactory
throw new \Exception('Unsupported system.');
}
}
}
}

View File

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

View File

@ -22,4 +22,4 @@ class Barcode extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class Barcode11 extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class Barcode128 extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class Barcode25 extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class Barcode39 extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class Barcode93 extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class BarcodeCodebar extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class BarcodeDatamatrix extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class BarcodeEAN extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class BarcodeMSI extends ValidatorAbstract
{
}
}
}

View File

@ -22,4 +22,4 @@ class QrCode extends ValidatorAbstract
{
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@
*
* PHP Version 7.1
*
* @package TBD
* @package phpOMS\Validation\Network
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
@ -17,14 +17,14 @@ namespace phpOMS\Validation\Network;
use phpOMS\Validation\ValidatorAbstract;
/**
* Validator abstract.
* Validate IP.
*
* @package Validation
* @package phpOMS\Validation\Network
* @license OMS License 1.0
* @link http://website.orange-management.de
* @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) {
$callback = StringUtils::endsWith($callback, 'Not') ? substr($callback, 0, -3) : $callback;
$valid = self::$callback($var, ...$settings);
$valid = (StringUtils::endsWith($callback, 'Not') ? $valid : !$valid);
$valid = self::$callback($var, ...$settings);
$valid = (StringUtils::endsWith($callback, 'Not') ? $valid : !$valid);
if (!$valid) {
return false;

View File

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

View File

@ -28,7 +28,7 @@ interface ValidatorInterface
/**
* Check if value is valid.
*
* @param mixed $value Value to validate
* @param mixed $value Value to validate
* @param array $constraints Constraints for validation
*
* @return bool
@ -54,4 +54,13 @@ interface ValidatorInterface
* @since 1.0.0
*/
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;
/**
* List view.
* Basic view which can be used as basis for specific implementations.
*
* @package phpOMS\Views
* @license OMS License 1.0
@ -89,6 +89,8 @@ class View extends ViewAbstract
}
/**
* Get data attached to view
*
* @param string $id Data Id
*
* @return mixed
@ -101,6 +103,8 @@ class View extends ViewAbstract
}
/**
* Set data of view
*
* @param string $id Data ID
* @param mixed $data Data
*
@ -134,6 +138,8 @@ class View extends ViewAbstract
}
/**
* Add data to view
*
* @param string $id Data ID
* @param mixed $data Data
*
@ -226,6 +232,8 @@ class View extends ViewAbstract
}
/**
* Get request of view
*
* @return RequestAbstract
*
* @since 1.0.0
@ -236,6 +244,8 @@ class View extends ViewAbstract
}
/**
* Get response of view
*
* @return ResponseAbstract
*
* @since 1.0.0
@ -244,5 +254,4 @@ class View extends ViewAbstract
{
return $this->response;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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