diff --git a/Account/Group.php b/Account/Group.php index 7fc6949f7..1a8f874b4 100644 --- a/Account/Group.php +++ b/Account/Group.php @@ -112,7 +112,7 @@ class Group implements ArrayableInterface, \JsonSerializable * Set group name. * * @param string $name Group name - * + * * @return void * * @since 1.0.0 @@ -138,7 +138,7 @@ class Group implements ArrayableInterface, \JsonSerializable * Set group description. * * @param string $description Group description - * + * * @return void * * @since 1.0.0 @@ -164,9 +164,9 @@ class Group implements ArrayableInterface, \JsonSerializable * Set group status. * * @param int $status Group status - * + * * @return void - * + * * @throws InvalidEnumValue * * @since 1.0.0 diff --git a/ApplicationAbstract.php b/ApplicationAbstract.php index ca3ba4103..5bddb2f24 100644 --- a/ApplicationAbstract.php +++ b/ApplicationAbstract.php @@ -16,9 +16,9 @@ namespace phpOMS; /** * Application class. - * - * This class contains all necessary application members. Access to them - * is restricted to write once in order to prevent manipulation + * + * 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 string $appName diff --git a/AutoloadException.php b/AutoloadException.php index 3a6b63d48..1e1f64a55 100644 --- a/AutoloadException.php +++ b/AutoloadException.php @@ -16,7 +16,7 @@ namespace phpOMS; /** * Autoloader exception - * + * * This exception is thrown if a file couldn't be autoloaded * * @package phpOMS diff --git a/Autoloader.php b/Autoloader.php index 762ade0b2..08e8506db 100644 --- a/Autoloader.php +++ b/Autoloader.php @@ -47,7 +47,7 @@ final class Autoloader { } - + /** * Add base path for autoloading * @@ -57,7 +57,7 @@ final class Autoloader * * @since 1.0.0 */ - public static function addPath(string $path) : void + public static function addPath(string $path) : void { self::$paths[] = $path; } @@ -83,7 +83,7 @@ final class Autoloader foreach (self::$paths as $path) { if (file_exists($file = $path . $class . '.php')) { include_once $file; - + return; } } @@ -110,7 +110,7 @@ final class Autoloader return true; } } - + return false; } } diff --git a/Business/Finance/Depreciation.php b/Business/Finance/Depreciation.php index 6a7c3ecbf..08cf01016 100644 --- a/Business/Finance/Depreciation.php +++ b/Business/Finance/Depreciation.php @@ -57,8 +57,8 @@ final class Depreciation /** * Calculate the degression factor - * - * This factor is the amount of years + * + * This factor is the amount of years * * @param float $start Value to depreciate (reduced by residual value if required) * @param float $residual Residual value @@ -160,7 +160,7 @@ final class Depreciation */ public static function getArithmeticProgressivDepreciationResidualInT(float $start, float $residual, int $duration, int $t) : float { - return $start - self::getArithmeticProgressivDepreciationFactor($start, $residual, $duration) * $t * ($t + 1) / 2; + return $start - self::getArithmeticProgressivDepreciationFactor($start, $residual, $duration) * $t * ($t + 1) / 2; } /** diff --git a/Business/Finance/FinanceFormulas.php b/Business/Finance/FinanceFormulas.php index 6630eda16..ba21fee44 100644 --- a/Business/Finance/FinanceFormulas.php +++ b/Business/Finance/FinanceFormulas.php @@ -24,7 +24,7 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseParameterName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ @@ -33,7 +33,7 @@ final class FinanceFormulas /** * Annual Percentage Yield - * + * * The annual percentage yield (APY) calculates the yield taking compounding * into consideration. * @@ -871,9 +871,9 @@ final class FinanceFormulas /** * Future Value - * + * * The Future Value (FV) is used to calculate the value of a cash flow after a specific amount of periods. - * + * * @latex FV = C_{0} \cdot \left(1 + r\right)^{n} * * @param float $C Cash flow at period 0 @@ -907,10 +907,10 @@ final class FinanceFormulas /** * Future Value Factor - * - * The future value factor is used to calculate a facture which can be used to calculate - * the future value after a certain amount of periods at a give interest rate. - * + * + * The future value factor is used to calculate a facture which can be used to calculate + * the future value after a certain amount of periods at a give interest rate. + * * @latex f = \left(1 + r\right)^{n} * * @param float $r Rate of return diff --git a/Business/Finance/Forecasting/ARIMA.php b/Business/Finance/Forecasting/ARIMA.php index bc1f074e3..62e863dea 100644 --- a/Business/Finance/Forecasting/ARIMA.php +++ b/Business/Finance/Forecasting/ARIMA.php @@ -43,7 +43,7 @@ class ARIMA /** * Constructor. - * + * * @param array $data Data points * @param int $order Data intervals (only 12 and 4 are valid). * @@ -61,7 +61,7 @@ class ARIMA /** * Return data decomposition. - * + * * @return array * * @since 1.0.0 diff --git a/Business/Finance/Loan.php b/Business/Finance/Loan.php index c76f3cc5b..8b4df68fd 100644 --- a/Business/Finance/Loan.php +++ b/Business/Finance/Loan.php @@ -21,7 +21,7 @@ namespace phpOMS\Business\Finance; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseParameterName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ diff --git a/Business/Finance/StockBonds.php b/Business/Finance/StockBonds.php index 9ee58eb7c..40ae2024a 100644 --- a/Business/Finance/StockBonds.php +++ b/Business/Finance/StockBonds.php @@ -21,7 +21,7 @@ namespace phpOMS\Business\Finance; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseParameterName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ diff --git a/Business/Programming/Metrics.php b/Business/Programming/Metrics.php index 855b88f12..76075c1fe 100644 --- a/Business/Programming/Metrics.php +++ b/Business/Programming/Metrics.php @@ -55,7 +55,7 @@ final class Metrics * @return int * * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseMethodName) */ public static function CRAP(int $complexity, float $coverage) : int diff --git a/DataStorage/Cache/Connection/MemCached.php b/DataStorage/Cache/Connection/MemCached.php index 6334292dd..b5bf80927 100644 --- a/DataStorage/Cache/Connection/MemCached.php +++ b/DataStorage/Cache/Connection/MemCached.php @@ -43,7 +43,7 @@ class MemCached extends ConnectionAbstract /** * Constructor. - * + * * @param array $data Cache data * * @since 1.0.0 diff --git a/DataStorage/Cache/Connection/RedisCache.php b/DataStorage/Cache/Connection/RedisCache.php index 801a26437..51e0ab748 100644 --- a/DataStorage/Cache/Connection/RedisCache.php +++ b/DataStorage/Cache/Connection/RedisCache.php @@ -47,7 +47,7 @@ class RedisCache extends ConnectionAbstract { $this->status = CacheStatus::ACTIVE; } - + /** * {@inheritdoc} */ diff --git a/DataStorage/Cookie/CookieJar.php b/DataStorage/Cookie/CookieJar.php index fd207f9e9..3b05d78a1 100644 --- a/DataStorage/Cookie/CookieJar.php +++ b/DataStorage/Cookie/CookieJar.php @@ -45,7 +45,7 @@ final class CookieJar * Constructor. * * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.Superglobals) */ public function __construct() diff --git a/DataStorage/DataStorageConnectionInterface.php b/DataStorage/DataStorageConnectionInterface.php index 85d27ad3f..3f79866a3 100644 --- a/DataStorage/DataStorageConnectionInterface.php +++ b/DataStorage/DataStorageConnectionInterface.php @@ -33,7 +33,7 @@ interface DataStorageConnectionInterface * @param string[] $data the basic datastorage information for establishing a connection * * @return void - * + * * @todo make private, reason was that not everyone wants to connect during initialization?! * * @since 1.0.0 diff --git a/DataStorage/Database/BuilderAbstract.php b/DataStorage/Database/BuilderAbstract.php index f724f9a6f..f5f81816b 100644 --- a/DataStorage/Database/BuilderAbstract.php +++ b/DataStorage/Database/BuilderAbstract.php @@ -87,7 +87,7 @@ abstract class BuilderAbstract * Escape string value * * @param string $value Value to escape - * + * * @return string * * @since 1.0.0 diff --git a/DataStorage/Database/Connection/ConnectionAbstract.php b/DataStorage/Database/Connection/ConnectionAbstract.php index c28c008c7..1adf1530f 100644 --- a/DataStorage/Database/Connection/ConnectionAbstract.php +++ b/DataStorage/Database/Connection/ConnectionAbstract.php @@ -46,7 +46,7 @@ abstract class ConnectionAbstract implements ConnectionInterface * Database prefix. * * The database prefix name for unique table names - * + * * @todo: make private? could add huge overhead since function call required * * @var string diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index 85540294f..0894da0a1 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -468,7 +468,7 @@ class DataMapperAbstract implements DataMapperInterface $query->prefix(self::$db->getPrefix())->into(static::$table); foreach (static::$columns as $key => $column) { - if (isset(static::$hasMany[$key]) + if (isset(static::$hasMany[$key]) || isset(static::$hasOne[$key]) ) { continue; @@ -609,7 +609,7 @@ class DataMapperAbstract implements DataMapperInterface continue; } - if (!isset($relReflectionClass)) { + if ($relReflectionClass === null) { $relReflectionClass = new \ReflectionClass($value); } @@ -877,12 +877,19 @@ class DataMapperAbstract implements DataMapperInterface */ private static function parseValue(string $type, $value = null) { - // todo: checking for string === string and is_* is slow. maybe only check type or only string if ($value === null) { return null; - } elseif ($type === 'DateTime' || $value instanceof \DateTime) { + } elseif ($type === 'int') { + return (int) $value; + } elseif ($type === 'string') { + return (string) $value; + } elseif ($type === 'float') { + return (float) $value; + } elseif ($type === 'bool') { + return (bool) $value; + } elseif ($type === 'DateTime') { return $value->format('Y-m-d H:i:s'); - } elseif ($type === 'Json' || $type === 'jsonSerializable' || is_array($value)) { + } elseif ($type === 'Json' || $type === 'jsonSerializable') { return json_encode($value); } elseif ($type === 'Serializable') { return $value->serialize(); @@ -890,14 +897,6 @@ class DataMapperAbstract implements DataMapperInterface return json_encode($value->jsonSerialize()); } elseif (is_object($value) && method_exists($value, 'getId')) { return $value->getId(); - } elseif ($type === 'int' || is_int($value)) { - return (int) $value; - } elseif ($type === 'string' || is_string($value)) { - return (string) $value; - } elseif ($type === 'float' || is_float($value)) { - return (float) $value; - } elseif ($type === 'bool' || is_bool($value)) { - return (bool) $value; } return $value; @@ -950,7 +949,7 @@ class DataMapperAbstract implements DataMapperInterface continue; } - if (!isset($relReflectionClass)) { + if ($relReflectionClass === null) { $relReflectionClass = new \ReflectionClass($value); } @@ -1120,8 +1119,8 @@ class DataMapperAbstract implements DataMapperInterface foreach (static::$columns as $key => $column) { $propertyName = stripos($column['internal'], '/') !== false ? explode('/', $column['internal'])[0] : $column['internal']; - if (isset(static::$hasMany[$propertyName]) - || isset(static::$hasOne[$propertyName]) + if (isset(static::$hasMany[$propertyName]) + || isset(static::$hasOne[$propertyName]) || $column['internal'] === static::$primaryField ) { continue; @@ -1148,7 +1147,7 @@ class DataMapperAbstract implements DataMapperInterface } elseif ($column['name'] !== static::$primaryField) { $tValue = $property->getValue($obj); if (stripos($column['internal'], '/') !== false) { - $path = explode('/', $column['internal']); + $path = explode('/', $column['internal']); array_shift($path); $path = implode('/', $path); @@ -1254,7 +1253,7 @@ class DataMapperAbstract implements DataMapperInterface continue; } - if (!isset($relReflectionClass)) { + if ($relReflectionClass === null) { $relReflectionClass = new \ReflectionClass($value); } @@ -1776,19 +1775,26 @@ class DataMapperAbstract implements DataMapperInterface continue; } + $hasPath = false; + if (stripos(static::$columns[$column]['internal'], '/') !== false) { - $refProp = $refClass->getProperty(explode('/', static::$columns[$column]['internal'])[0]); - $path = explode(static::$columns[$column]['internal']); + $hasPath = true; + $path = explode('/', static::$columns[$column]['internal']); + $refProp = $refClass->getProperty($path[0]); + + if (!($accessible = $refProp->isPublic())) { + $refProp->setAccessible(true); + } array_shift($path); - $path = implode('/', $path); - $aValue = $refProp->getValue($obj); + $path = implode('/', $path); + $aValue = $refProp->getValue($obj); } else { $refProp = $refClass->getProperty(static::$columns[$column]['internal']); - } - if (!($accessible = $refProp->isPublic())) { - $refProp->setAccessible(true); + if (!($accessible = $refProp->isPublic())) { + $refProp->setAccessible(true); + } } if (in_array(static::$columns[$column]['type'], ['string', 'int', 'float', 'bool'])) { @@ -1797,20 +1803,20 @@ class DataMapperAbstract implements DataMapperInterface settype($value, static::$columns[$column]['type']); } - if (isset($path)) { + if ($hasPath) { $value = ArrayUtils::setArray($path, $aValue, $value, '/', true); } $refProp->setValue($obj, $value); } elseif (static::$columns[$column]['type'] === 'DateTime') { $value = new \DateTime($value ?? ''); - if (stripos(static::$columns[$column]['internal'], '/') !== false) { + if ($hasPath) { $value = ArrayUtils::setArray($path, $aValue, $value, '/', true); } $refProp->setValue($obj, $value); } elseif (static::$columns[$column]['type'] === 'Json') { - if (stripos(static::$columns[$column]['internal'], '/') !== false) { + if ($hasPath) { $value = ArrayUtils::setArray($path, $aValue, $value, '/', true); } @@ -1837,8 +1843,6 @@ class DataMapperAbstract implements DataMapperInterface * * @return array * - * @throws \UnexpectedValueException - * * @since 1.0.0 */ public static function populateAbstractArray(array $result) : array @@ -1890,7 +1894,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(self::$parentMapper)) { - self::setUpParentMapper(); + self::$parentMapper = static::class; } self::extend(__CLASS__); @@ -1972,7 +1976,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(self::$parentMapper)) { - self::setUpParentMapper(); + self::$parentMapper = static::class; } self::extend(__CLASS__); @@ -2017,7 +2021,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(self::$parentMapper)) { - self::setUpParentMapper(); + self::$parentMapper = static::class; } self::extend(__CLASS__); @@ -2063,7 +2067,7 @@ class DataMapperAbstract implements DataMapperInterface public static function getForArray($refKey, string $ref, int $relations = RelationType::ALL, $fill = null) { if (!isset(self::$parentMapper)) { - self::setUpParentMapper(); + self::$parentMapper = static::class; } self::extend(__CLASS__); @@ -2104,7 +2108,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(self::$parentMapper)) { - self::setUpParentMapper(); + self::$parentMapper = static::class; } $obj = self::populateIterable(self::getAllRaw($lang)); @@ -2132,7 +2136,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(self::$parentMapper)) { - self::setUpParentMapper(); + self::$parentMapper = static::class; } $obj = self::populateIterableArray(self::getAllRaw($lang)); @@ -2506,7 +2510,7 @@ class DataMapperAbstract implements DataMapperInterface ->leftOuterJoin($value['table']) ->on(new And('1', new And(new Or('d1', 'd2'), 'id'))) ->where($value['table'] . '.' . $value['dst'], '=', 'NULL'); - + }*/ $sth = self::$db->con->prepare($query->toSql()); @@ -2660,18 +2664,6 @@ class DataMapperAbstract implements DataMapperInterface } } - /** - * Define the highest mapper of this request - * - * @return void - * - * @since 1.0.0 - */ - private static function setUpParentMapper() : void - { - self::$parentMapper = static::class; - } - /** * Check if model exists in database * diff --git a/DataStorage/Database/GrammarAbstract.php b/DataStorage/Database/GrammarAbstract.php index 752cfe5d9..a02be1092 100644 --- a/DataStorage/Database/GrammarAbstract.php +++ b/DataStorage/Database/GrammarAbstract.php @@ -144,7 +144,7 @@ abstract class GrammarAbstract * Set table prefix. * * @param string $prefix Table prefix - * + * * @return void * * @since 1.0.0 diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index 4fb668335..1cae96965 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -777,7 +777,7 @@ final class Builder extends BuilderAbstract /** * Lock query. - * + * * @return void * * @since 1.0.0 @@ -788,7 +788,7 @@ final class Builder extends BuilderAbstract /** * Lock for update query. - * + * * @return void * * @since 1.0.0 @@ -799,7 +799,7 @@ final class Builder extends BuilderAbstract /** * Create query string. - * + * * @return string * * @since 1.0.0 @@ -811,7 +811,7 @@ final class Builder extends BuilderAbstract /** * Find query. - * + * * @return void * * @since 1.0.0 @@ -837,7 +837,7 @@ final class Builder extends BuilderAbstract /** * Select minimum. - * + * * @return void * * @since 1.0.0 @@ -848,7 +848,7 @@ final class Builder extends BuilderAbstract /** * Select maximum. - * + * * @return void * * @since 1.0.0 @@ -859,7 +859,7 @@ final class Builder extends BuilderAbstract /** * Select sum. - * + * * @return void * * @since 1.0.0 @@ -870,7 +870,7 @@ final class Builder extends BuilderAbstract /** * Select average. - * + * * @return void * * @since 1.0.0 @@ -1034,7 +1034,7 @@ final class Builder extends BuilderAbstract /** * Delete query - * + * * @return Builder * * @since 1.0.0 @@ -1052,7 +1052,7 @@ final class Builder extends BuilderAbstract /** * Increment value. - * + * * @return void * * @since 1.0.0 @@ -1063,7 +1063,7 @@ final class Builder extends BuilderAbstract /** * Decrement value. - * + * * @return void * * @since 1.0.0 @@ -1074,7 +1074,7 @@ final class Builder extends BuilderAbstract /** * Join. - * + * * @return Builder * * @since 1.0.0 @@ -1086,7 +1086,7 @@ final class Builder extends BuilderAbstract /** * Join where. - * + * * @return void * * @since 1.0.0 @@ -1097,7 +1097,7 @@ final class Builder extends BuilderAbstract /** * Left join. - * + * * @return void * * @since 1.0.0 @@ -1108,7 +1108,7 @@ final class Builder extends BuilderAbstract /** * Left join where. - * + * * @return void * * @since 1.0.0 @@ -1119,7 +1119,7 @@ final class Builder extends BuilderAbstract /** * Right join. - * + * * @return void * * @since 1.0.0 @@ -1130,7 +1130,7 @@ final class Builder extends BuilderAbstract /** * Right join where. - * + * * @return void * * @since 1.0.0 @@ -1153,7 +1153,7 @@ final class Builder extends BuilderAbstract /** * On. - * + * * @return void * * @since 1.0.0 diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index a900d0405..4eabb1397 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -25,7 +25,7 @@ use phpOMS\DataStorage\LockException; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.Superglobals) */ class HttpSession implements SessionInterface @@ -109,7 +109,7 @@ class HttpSession implements SessionInterface /** * Set Csrf protection for forms. - * + * * @return void * * @since 1.0.0 diff --git a/Localization/Localization.php b/Localization/Localization.php index f0ad0e8fb..83fbc5382 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -147,7 +147,7 @@ final class Localization /** * Get country - * + * * @return string * * @since 1.0.0 @@ -159,7 +159,7 @@ final class Localization /** * Set country name - * + * * @param string $country Contry name * * @return void @@ -189,9 +189,9 @@ final class Localization /** * Set timezone - * + * * @param string $timezone Timezone - * + * * @return void * * @todo : maybe make parameter int @@ -209,7 +209,7 @@ final class Localization /** * Get language - * + * * @return string * * @since 1.0.0 @@ -221,7 +221,7 @@ final class Localization /** * Set language code - * + * * @param string $language Language code * * @return void @@ -243,7 +243,7 @@ final class Localization /** * Get currency - * + * * @return string * * @since 1.0.0 @@ -255,7 +255,7 @@ final class Localization /** * Set currency code - * + * * @param string $currency Currency code * * @return void @@ -273,7 +273,7 @@ final class Localization /** * get datetime format - * + * * @return string * * @since 1.0.0 @@ -285,7 +285,7 @@ final class Localization /** * Set datetime format - * + * * @param string $datetime Datetime format * * @return void @@ -299,7 +299,7 @@ final class Localization /** * Set decimal char - * + * * @return string * * @since 1.0.0 @@ -311,7 +311,7 @@ final class Localization /** * Get decimal char - * + * * @param string $decimal Decimal char * * @return void @@ -325,7 +325,7 @@ final class Localization /** * Get thousands char - * + * * @return string * * @since 1.0.0 @@ -337,7 +337,7 @@ final class Localization /** * Set thousands char - * + * * @param string $thousands Thousands char * * @return void @@ -351,7 +351,7 @@ final class Localization /** * Get angle type - * + * * @return string * * @since 1.0.0 @@ -363,7 +363,7 @@ final class Localization /** * Set angle type - * + * * @param string $angle Angle * * @return void @@ -377,7 +377,7 @@ final class Localization /** * Get temperature type - * + * * @return string * * @since 1.0.0 @@ -389,7 +389,7 @@ final class Localization /** * Set temperature string - * + * * @param string $temperature Temperature * * @return void @@ -403,7 +403,7 @@ final class Localization /** * Get speed type - * + * * @return array * * @since 1.0.0 @@ -415,7 +415,7 @@ final class Localization /** * Set speed type - * + * * @param array $speed Speed * * @return void @@ -429,7 +429,7 @@ final class Localization /** * Get weight type - * + * * @return array * * @since 1.0.0 @@ -441,7 +441,7 @@ final class Localization /** * Set weight type - * + * * @param array $weight Weight type * * @return void @@ -455,7 +455,7 @@ final class Localization /** * Get length type - * + * * @return array * * @since 1.0.0 @@ -467,7 +467,7 @@ final class Localization /** * Set length type - * + * * @param array $length Length type * * @return void @@ -481,7 +481,7 @@ final class Localization /** * Get area type - * + * * @return array * * @since 1.0.0 @@ -493,7 +493,7 @@ final class Localization /** * Set area type - * + * * @param array $area Area type * * @return void @@ -507,7 +507,7 @@ final class Localization /** * Get volume type - * + * * @return array * * @since 1.0.0 @@ -519,7 +519,7 @@ final class Localization /** * Set volume type - * + * * @param array $volume Volume type * * @return void diff --git a/Log/FileLogger.php b/Log/FileLogger.php index 10828c6da..ef3fce48b 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -24,7 +24,7 @@ use phpOMS\System\File\Local\File; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.Superglobals) */ final class FileLogger implements LoggerInterface @@ -161,7 +161,7 @@ final class FileLogger implements LoggerInterface /** * Protect instance from getting copied from outside. - * + * * @return void * * @since 1.0.0 @@ -375,7 +375,7 @@ final class FileLogger implements LoggerInterface * Analyse logging file. * * @return array - * + * * @since 1.0.0 */ public function countLogs() @@ -411,7 +411,7 @@ final class FileLogger implements LoggerInterface * @param int $limit Amout of perpetrators * * @return array - * + * * @since 1.0.0 */ public function getHighestPerpetrator(int $limit = 10) : array @@ -449,7 +449,7 @@ final class FileLogger implements LoggerInterface * @param int $offset Offset * * @return array - * + * * @since 1.0.0 */ public function get(int $limit = 25, int $offset = 0) : array @@ -498,7 +498,7 @@ final class FileLogger implements LoggerInterface * @param int $id Id/Line number of the logging message * * @return array - * + * * @since 1.0.0 */ public function getByLine(int $id = 1) : array @@ -545,7 +545,7 @@ final class FileLogger implements LoggerInterface * @param string $message Log message * @param bool $verbose Is verbose * @param array $context Context - * + * * @return void * * @since 1.0.0 diff --git a/Math/Functions/Functions.php b/Math/Functions/Functions.php index 77f4004d0..3fb814044 100644 --- a/Math/Functions/Functions.php +++ b/Math/Functions/Functions.php @@ -34,7 +34,7 @@ final class Functions { } - + /** * Calculate gammar function value. * @@ -236,7 +236,7 @@ final class Functions { return !((bool) ($a & 1)); } - + /** * Power all values in array. * @@ -258,7 +258,7 @@ final class Functions return $squared; } - + /** * Power all values in array. * diff --git a/Math/Functions/Gamma.php b/Math/Functions/Gamma.php index f6c4d5cd7..4e5201e61 100644 --- a/Math/Functions/Gamma.php +++ b/Math/Functions/Gamma.php @@ -34,7 +34,7 @@ final class Gamma { } - + /** * approximation values. * diff --git a/Math/Geometry/ConvexHull/MonotoneChain.php b/Math/Geometry/ConvexHull/MonotoneChain.php index 7951d6368..741498c93 100644 --- a/Math/Geometry/ConvexHull/MonotoneChain.php +++ b/Math/Geometry/ConvexHull/MonotoneChain.php @@ -36,7 +36,7 @@ final class MonotoneChain { } - + /** * Create convex hull * diff --git a/Math/Geometry/Shape/D2/Circle.php b/Math/Geometry/Shape/D2/Circle.php index 535b37c34..b933cd97a 100644 --- a/Math/Geometry/Shape/D2/Circle.php +++ b/Math/Geometry/Shape/D2/Circle.php @@ -75,7 +75,7 @@ final class Circle implements D2ShapeInterface * @return float * * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseVariableName) * @SuppressWarnings(PHPMD.CamelCaseParameterName) */ diff --git a/Math/Geometry/Shape/D3/Cone.php b/Math/Geometry/Shape/D3/Cone.php index c907ec70d..6ce8b28d7 100644 --- a/Math/Geometry/Shape/D3/Cone.php +++ b/Math/Geometry/Shape/D3/Cone.php @@ -79,7 +79,7 @@ final class Cone implements D3ShapeInterface * @return float * * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseVariableName) * @SuppressWarnings(PHPMD.CamelCaseParameterName) */ diff --git a/Math/Geometry/Shape/D3/Sphere.php b/Math/Geometry/Shape/D3/Sphere.php index 4ebab7b85..e440f3db6 100644 --- a/Math/Geometry/Shape/D3/Sphere.php +++ b/Math/Geometry/Shape/D3/Sphere.php @@ -141,7 +141,7 @@ final class Sphere implements D3ShapeInterface * @return float * * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseVariableName) * @SuppressWarnings(PHPMD.CamelCaseParameterName) */ diff --git a/Math/Matrix/CholeskyDecomposition.php b/Math/Matrix/CholeskyDecomposition.php index e78a6e082..3de6933b6 100644 --- a/Math/Matrix/CholeskyDecomposition.php +++ b/Math/Matrix/CholeskyDecomposition.php @@ -118,7 +118,7 @@ final class CholeskyDecomposition * Solve Ax = b * * @param Matrix $B Matrix - * + * * @return Matrix * * @since 1.0.0 diff --git a/Math/Matrix/LUDecomposition.php b/Math/Matrix/LUDecomposition.php index 575b1c20f..59ceaa9dd 100644 --- a/Math/Matrix/LUDecomposition.php +++ b/Math/Matrix/LUDecomposition.php @@ -237,7 +237,7 @@ final class LUDecomposition * Solve Ax = b * * @param Matrix $B Matrix - * + * * @return Matrix * * @since 1.0.0 diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index 0e7549a51..e5f982c6a 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -82,7 +82,7 @@ class Matrix implements \ArrayAccess, \Iterator * @param int $m Row * @param int $n Column * @param int $value Value - * + * * @return void * * @throws InvalidDimensionException @@ -218,7 +218,7 @@ class Matrix implements \ArrayAccess, \Iterator /** * Swap values in rows - * + * * @param array $matrix Matrix reference to modify * @param int $row1 Row to swap * @param int $row2 Row to swap @@ -573,7 +573,7 @@ class Matrix implements \ArrayAccess, \Iterator /** * Solve matrix - * + * * @param Matix $B Matrix/Vector b * * @return Matrix diff --git a/Math/Number/Complex.php b/Math/Number/Complex.php index dd27625e0..139646ba9 100644 --- a/Math/Number/Complex.php +++ b/Math/Number/Complex.php @@ -80,7 +80,7 @@ final class Complex /** * Conjugate - * + * * @latex z = a - b*i * * @return Complex @@ -94,24 +94,24 @@ final class Complex /** * Reciprocal - * + * * @return Complex - * + * * @since 1.0.0 */ public function reciprocal() : Complex { return new self( - $this->re / ($this->re ** 2 + $this->im ** 2), + $this->re / ($this->re ** 2 + $this->im ** 2), -$this->im / ($this->re ** 2 + $this->im ** 2) ); } /** * Square root - * + * * @return Complex - * + * * @since 1.0.0 */ public function sqrt() : Complex @@ -124,9 +124,9 @@ final class Complex /** * Absolute - * + * * @return mixed - * + * * @since 1.0.0 */ public function abs() @@ -136,9 +136,9 @@ final class Complex /** * Square - * + * * @return Complex - * + * * @since 1.0.0 */ public function square() : Complex @@ -166,11 +166,11 @@ final class Complex /** * Power with integer - * + * * @param int $value Power - * + * * @return Complex - * + * * @since 1.0.0 */ public function powInteger(int $value) : Complex @@ -191,13 +191,13 @@ final class Complex /** * Add opperator - * + * * @param mixed $value Value to add - * + * * @return Complex - * + * * @throws \InvalidArgumentException - * + * * @since 1.0.0 */ public function add($value) : Complex @@ -210,14 +210,14 @@ final class Complex throw new \InvalidArgumentException(); } - + /** * Add opperator - * + * * @param Complex $cpl Value to add - * + * * @return Complex - * + * * @since 1.0.0 */ private function addComplex(Complex $cpl) : Complex @@ -227,11 +227,11 @@ final class Complex /** * Add opperator - * + * * @param mixed $val Value to add - * + * * @return Complex - * + * * @since 1.0.0 */ private function addScalar($val) : Complex @@ -241,13 +241,13 @@ final class Complex /** * Sub opperator - * + * * @param mixed $value Value to sub - * + * * @return Complex - * + * * @throws \InvalidArgumentException - * + * * @since 1.0.0 */ public function sub($value) : Complex @@ -263,11 +263,11 @@ final class Complex /** * Sub opperator - * + * * @param Complex $cpl Value to sub - * + * * @return Complex - * + * * @since 1.0.0 */ private function subComplex(Complex $cpl) : Complex @@ -277,11 +277,11 @@ final class Complex /** * Sub opperator - * + * * @param mixed $val Value to sub - * + * * @return Complex - * + * * @since 1.0.0 */ private function subScalar($val) : Complex @@ -291,13 +291,13 @@ final class Complex /** * Mult opperator - * + * * @param mixed $value Value to mult - * + * * @return Complex - * + * * @throws \InvalidArgumentException - * + * * @since 1.0.0 */ public function mult($value) : Complex @@ -313,11 +313,11 @@ final class Complex /** * Mult opperator - * + * * @param Complex $cpl Value to mult - * + * * @return Complex - * + * * @since 1.0.0 */ private function multComplex(Complex $cpl) : Complex @@ -330,11 +330,11 @@ final class Complex /** * Mult opperator - * + * * @param mixed $val Value to mult - * + * * @return Complex - * + * * @since 1.0.0 */ private function multScalar($val) : Complex @@ -344,13 +344,13 @@ final class Complex /** * Div opperator - * + * * @param mixed $value Value to div - * + * * @return Complex - * + * * @throws \InvalidArgumentException - * + * * @since 1.0.0 */ public function div($value) : Complex @@ -366,11 +366,11 @@ final class Complex /** * Div opperator - * + * * @param Complex $cpl Value to div - * + * * @return Complex - * + * * @since 1.0.0 */ private function divComplex(Complex $cpl) : Complex @@ -383,11 +383,11 @@ final class Complex /** * Div opperator - * + * * @param mixed $val Value to div - * + * * @return Complex - * + * * @since 1.0.0 */ private function divScalar($val) : Complex @@ -397,18 +397,18 @@ final class Complex /** * Render complex number - * + * * @param int $precision Output precision - * + * * @return string - * + * * @since 1.0.0 */ public function render(int $precision = 2) : string { - return ($this->re !== 0 ? number_format($this->re, $precision) : '') - . ($this->im > 0 && $this->re !== 0 ? ' +' : '') - . ($this->im < 0 && $this->re !== 0 ? ' -' : '') + return ($this->re !== 0 ? number_format($this->re, $precision) : '') + . ($this->im > 0 && $this->re !== 0 ? ' +' : '') + . ($this->im < 0 && $this->re !== 0 ? ' -' : '') . ($this->im !== 0 ? ( ($this->re !== 0 ? ' ' : '') . number_format( ($this->im < 0 && $this->re === 0 ? $this->im : abs($this->im)), $precision diff --git a/Math/Number/Integer.php b/Math/Number/Integer.php index 2b958e8e5..0f503e187 100644 --- a/Math/Number/Integer.php +++ b/Math/Number/Integer.php @@ -34,7 +34,7 @@ final class Integer { } - + /** * Is integer. * diff --git a/Math/Number/Natural.php b/Math/Number/Natural.php index 712bae656..e9a70f90e 100644 --- a/Math/Number/Natural.php +++ b/Math/Number/Natural.php @@ -34,7 +34,7 @@ final class Natural { } - + /** * Is natural number. * diff --git a/Math/Number/Numbers.php b/Math/Number/Numbers.php index bd18fd112..454634d1b 100644 --- a/Math/Number/Numbers.php +++ b/Math/Number/Numbers.php @@ -34,7 +34,7 @@ final class Numbers { } - + /** * Is perfect number? * diff --git a/Math/Number/Prime.php b/Math/Number/Prime.php index f252d1d99..b2de1c394 100644 --- a/Math/Number/Prime.php +++ b/Math/Number/Prime.php @@ -34,7 +34,7 @@ final class Prime { } - + /** * Is mersenne number? * diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index 1c77a471a..756e4f99c 100644 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -50,7 +50,7 @@ final class Average { } - + /** * Average change. * diff --git a/Math/Statistic/MeasureOfDispersion.php b/Math/Statistic/MeasureOfDispersion.php index d9366898c..a24c3de04 100644 --- a/Math/Statistic/MeasureOfDispersion.php +++ b/Math/Statistic/MeasureOfDispersion.php @@ -87,7 +87,7 @@ final class MeasureOfDispersion * Calculage standard deviation. * * Example: ([4, 5, 9, 1, 3]) - * + * * @latex \sigma = \sqrt{\sigma^{2}} = \sqrt{Var(X)} * * @param array $values Values @@ -111,11 +111,11 @@ final class MeasureOfDispersion /** * Calculage sample variance. - * + * * Similar to `empiricalVariance`. * * Example: ([4, 5, 9, 1, 3]) - * + * * @latex \sigma^{2} = Var(X) = \frac{1}{N - 1} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2} * * @param array $values Values @@ -140,11 +140,11 @@ final class MeasureOfDispersion /** * Calculage empirical variance. - * + * * Similar to `sampleVariance`. * * Example: ([4, 5, 9, 1, 3]) - * + * * @latex \sigma^{2} = Var(X) = \frac{1}{N} \sum_{i = 1}^{N}\left(x_{i} - \bar{X}\right)^{2} * * @param array $values Values @@ -180,7 +180,7 @@ final class MeasureOfDispersion * Calculage empirical covariance. * * Example: ([4, 5, 9, 1, 3], [4, 5, 9, 1, 3]) - * + * * @latex \sigma_{XY} = cov(X, Y) = \sum_{i = 1}^{N}\frac{\left(x_{i} - \bar{X}\right) \left(y_{i} - \bar{Y}\right)}{N - 1} * * @param array $x Values diff --git a/Math/Stochastic/Distribution/BernoulliDistribution.php b/Math/Stochastic/Distribution/BernoulliDistribution.php index 4f3f33afd..62d663cf9 100644 --- a/Math/Stochastic/Distribution/BernoulliDistribution.php +++ b/Math/Stochastic/Distribution/BernoulliDistribution.php @@ -64,7 +64,7 @@ class BernoulliDistribution } elseif ($k >= 1) { return 1; } - + return 1 - $p; } @@ -84,7 +84,7 @@ class BernoulliDistribution } elseif ($p > 0.5) { return 1; } - + return 0; } diff --git a/Math/Stochastic/Distribution/CauchyDistribution.php b/Math/Stochastic/Distribution/CauchyDistribution.php index f81a119f9..6dbb6a68a 100644 --- a/Math/Stochastic/Distribution/CauchyDistribution.php +++ b/Math/Stochastic/Distribution/CauchyDistribution.php @@ -83,7 +83,7 @@ class CauchyDistribution { return $x0; } - + /** * Get entropy. * diff --git a/Message/Console/Request.php b/Message/Console/Request.php index 28f1de400..8724f8e47 100644 --- a/Message/Console/Request.php +++ b/Message/Console/Request.php @@ -26,7 +26,7 @@ use phpOMS\Router\RouteVerb; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.Superglobals) */ final class Request extends RequestAbstract diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index 91ef1a7da..7514da230 100644 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -70,7 +70,7 @@ abstract class HeaderAbstract /** * Set header locked. - * + * * @return void * * @since 1.0.0 @@ -164,7 +164,7 @@ abstract class HeaderAbstract * Generate header based on status code. * * @param int $statusCode Status code - * + * * @return void * * @since 1.0.0 @@ -198,7 +198,7 @@ abstract class HeaderAbstract * @param string $key Header key * @param string $value Header value * @param bool $overwrite Overwrite if key already exists - * + * * @return bool * * @since 1.0.0 diff --git a/Message/Http/Header.php b/Message/Http/Header.php index 49fe50695..8851c23e1 100644 --- a/Message/Http/Header.php +++ b/Message/Http/Header.php @@ -24,7 +24,7 @@ use phpOMS\DataStorage\LockException; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.Superglobals) */ final class Header extends HeaderAbstract @@ -221,7 +221,7 @@ final class Header extends HeaderAbstract /** * Push all headers. - * + * * @return void * * @since 1.0.0 diff --git a/Message/Http/Request.php b/Message/Http/Request.php index f05d1a2f9..693eb4c1a 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -29,7 +29,7 @@ use phpOMS\Uri\UriInterface; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.Superglobals) */ final class Request extends RequestAbstract @@ -58,7 +58,7 @@ final class Request extends RequestAbstract * @since 1.0.0 */ private $os = null; - + /** * Request information. * @@ -452,8 +452,8 @@ final class Request extends RequestAbstract public function __toString() : string { if ($this->getMethod() === RequestMethod::GET && !empty($this->data)) { - return $this->uri->__toString() - . (parse_url($this->uri->__toString(), PHP_URL_QUERY) ? '&' : '?') + return $this->uri->__toString() + . (parse_url($this->uri->__toString(), PHP_URL_QUERY) ? '&' : '?') . http_build_query($this->data); } diff --git a/Message/RequestAbstract.php b/Message/RequestAbstract.php index fa23aa1db..49fe4656e 100644 --- a/Message/RequestAbstract.php +++ b/Message/RequestAbstract.php @@ -107,7 +107,7 @@ abstract class RequestAbstract implements MessageInterface * Set request uri. * * @param UriInterface $uri Uri - * + * * @return void * * @since 1.0.0 @@ -142,7 +142,7 @@ abstract class RequestAbstract implements MessageInterface * Set request method. * * @param string $method Request method - * + * * @return void * * @since 1.0.0 diff --git a/Message/RequestSource.php b/Message/RequestSource.php index ffbc9b1f5..51af67e08 100644 --- a/Message/RequestSource.php +++ b/Message/RequestSource.php @@ -29,5 +29,5 @@ abstract class RequestSource extends Enum public const WEB = 0; /* This is a http request */ public const CONSOLE = 1; /* Request is a console command */ public const SOCKET = 2; /* Request through socket connection */ - public const UNDEFINED = 3; + public const UNDEFINED = 3; } diff --git a/Message/UploadedFileInterface.php b/Message/UploadedFileInterface.php index b0896cc50..583abc9ac 100644 --- a/Message/UploadedFileInterface.php +++ b/Message/UploadedFileInterface.php @@ -27,7 +27,7 @@ interface UploadedFileInterface /** * Retrieve a stream representing the uploaded file. - * + * * @since 1.0.0 */ public function getStream(); @@ -45,7 +45,7 @@ interface UploadedFileInterface /** * Retrieve the file size. - * + * * @return int * * @since 1.0.0 @@ -54,7 +54,7 @@ interface UploadedFileInterface /** * Retrieve the error associated with the uploaded file. - * + * * @return int * * @since 1.0.0 @@ -63,7 +63,7 @@ interface UploadedFileInterface /** * Retrieve the filename sent by the client. - * + * * @return string * * @since 1.0.0 @@ -72,7 +72,7 @@ interface UploadedFileInterface /** * Retrieve the media type sent by the client. - * + * * @return string * * @since 1.0.0 diff --git a/Model/Html/Head.php b/Model/Html/Head.php index 60f8758b3..d2fe2bb9b 100644 --- a/Model/Html/Head.php +++ b/Model/Html/Head.php @@ -101,7 +101,7 @@ class Head implements RenderableInterface /** * Set page meta. - * + * * @return Meta * * @since 1.0.0 diff --git a/Module/InfoManager.php b/Module/InfoManager.php index 261e09a13..35c8ecc69 100644 --- a/Module/InfoManager.php +++ b/Module/InfoManager.php @@ -110,7 +110,7 @@ final class InfoManager * @param string $path Value path * @param mixed $data Scalar or array of data to set * @param string $delim Delimiter of path - * + * * @return void * * @since 1.0.0 diff --git a/Module/InstallerAbstract.php b/Module/InstallerAbstract.php index 3849d3849..fe3ceb7ff 100644 --- a/Module/InstallerAbstract.php +++ b/Module/InstallerAbstract.php @@ -80,7 +80,7 @@ class InstallerAbstract $dbPool->get()->con->commit(); break; - default: + default: throw new InvalidDatabaseTypeException($dbPool->get()->getType()); } } diff --git a/Module/ModuleFactory.php b/Module/ModuleFactory.php index 9f905dd99..1de722ef2 100644 --- a/Module/ModuleFactory.php +++ b/Module/ModuleFactory.php @@ -94,7 +94,7 @@ final class ModuleFactory * Load modules this module is requesting from * * @param ModuleAbstract $obj Current module - * + * * @return void * * @since 1.0.0 @@ -114,7 +114,7 @@ final class ModuleFactory * Register modules this module is receiving from * * @param ModuleAbstract $obj Current module - * + * * @return void * * @since 1.0.0 diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index c805aace4..d4c707387 100644 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -176,7 +176,7 @@ final class ModuleManager $this->uriLoad = $sth->fetchAll(\PDO::FETCH_GROUP); break; - default: + default: throw new InvalidDatabaseTypeException($this->app->dbPool->get('select')->getType()); } } @@ -202,7 +202,7 @@ final class ModuleManager $sth->execute(); $this->active = $sth->fetchAll(\PDO::FETCH_COLUMN); break; - default: + default: throw new InvalidDatabaseTypeException($this->app->dbPool->get('select')->getType()); } } @@ -284,7 +284,7 @@ final class ModuleManager $sth->execute(); $this->installed = $sth->fetchAll(\PDO::FETCH_GROUP); break; - default: + default: throw new InvalidDatabaseTypeException($this->app->dbPool->get('select')->getType()); } } diff --git a/Module/StatusAbstract.php b/Module/StatusAbstract.php index ceedaae32..7f043fc2a 100644 --- a/Module/StatusAbstract.php +++ b/Module/StatusAbstract.php @@ -87,7 +87,7 @@ class StatusAbstract $dbPool->get()->con->commit(); break; - default: + default: throw new InvalidDatabaseTypeException($dbPool->get()->getType()); } } @@ -150,7 +150,7 @@ class StatusAbstract $dbPool->get()->con->commit(); break; - default: + default: throw new InvalidDatabaseTypeException($dbPool->get()->getType()); } } diff --git a/Socket/SocketInterface.php b/Socket/SocketInterface.php index ac9735358..3b17e3849 100644 --- a/Socket/SocketInterface.php +++ b/Socket/SocketInterface.php @@ -30,7 +30,7 @@ interface SocketInterface * * @param string $ip IP address * @param int $port Port - * + * * @return void * * @since 1.0.0 diff --git a/System/File/ContainerInterface.php b/System/File/ContainerInterface.php index 4fd963cea..5d0aba240 100644 --- a/System/File/ContainerInterface.php +++ b/System/File/ContainerInterface.php @@ -324,7 +324,7 @@ interface ContainerInterface * * This is used in order to initialize all resources. * Sub-sub-resources are only initialized once they are needed. - * + * * @return void * * @since 1.0.0 diff --git a/System/File/Ftp/FtpStorage.php b/System/File/Ftp/FtpStorage.php index c7f73a856..6af890e31 100644 --- a/System/File/Ftp/FtpStorage.php +++ b/System/File/Ftp/FtpStorage.php @@ -32,7 +32,7 @@ class FtpStorage extends StorageAbstract { private static $instance = null; - public function __construct() + public function __construct() { } diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index d7af93adf..4d8cbaa35 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -118,7 +118,7 @@ final class Directory extends FileAbstract implements DirectoryInterface new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item ) { - if ((empty($extension) || $item->getExtension() === $extension) + if ((empty($extension) || $item->getExtension() === $extension) && (empty($exclude) || (!(bool) preg_match('/' . $exclude . '/', $iterator->getSubPathname()))) ) { $list[] = str_replace('\\', '/', $iterator->getSubPathname()); diff --git a/System/OperatingSystem.php b/System/OperatingSystem.php index a61229d6a..fe84ce6e1 100644 --- a/System/OperatingSystem.php +++ b/System/OperatingSystem.php @@ -34,7 +34,7 @@ final class OperatingSystem { } - + /** * Get OS. * diff --git a/Uri/Http.php b/Uri/Http.php index d304a73ed..647cbeb15 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -25,7 +25,7 @@ use phpOMS\Utils\StringUtils; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.Superglobals) */ final class Http implements UriInterface @@ -337,7 +337,7 @@ final class Http implements UriInterface */ public function getAuthority() : string { - return ($this->getUser() !== '' ? $this->getUser() . '@' : '') . $this->host + return ($this->getUser() !== '' ? $this->getUser() . '@' : '') . $this->host . ($this->port !== null && $this->port !== 0 ? ':' . $this->port : ''); } diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index e0e5b9eae..bf77a272a 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -128,7 +128,7 @@ final class ArrayUtils if (!isset($current[$key])) { return null; } - + $current = $current[$key]; } diff --git a/Utils/Barcode/C128Abstract.php b/Utils/Barcode/C128Abstract.php index 2bd7a1ffc..4ef6482ec 100644 --- a/Utils/Barcode/C128Abstract.php +++ b/Utils/Barcode/C128Abstract.php @@ -23,7 +23,7 @@ use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCasePropertyName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ @@ -145,7 +145,7 @@ abstract class C128Abstract * * @param int $width Barcode width * @param int $height Barcode height - * + * * @return void * * @since 1.0.0 @@ -168,7 +168,7 @@ abstract class C128Abstract * Set barcode margins * * @param int $margin Barcode margin - * + * * @return void * * @since 1.0.0 @@ -182,7 +182,7 @@ abstract class C128Abstract * Set barcode orientation * * @param int $orientation Barcode orientation - * + * * @return void * * @since 1.0.0 @@ -212,7 +212,7 @@ abstract class C128Abstract * Set content to encrypt * * @param string $content Barcode content - * + * * @return void * * @since 1.0.0 @@ -320,20 +320,20 @@ abstract class C128Abstract if ($this->orientation === OrientationType::HORIZONTAL) { imagefilledrectangle( - $image, - $location + $this->margin, - 0 + $this->margin, - $cur_size + $this->margin, - $dimensions['height'] - $this->margin, + $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, + $image, + 0 + $this->margin, + $location + $this->margin, + $dimensions['width'] - $this->margin, + $cur_size + $this->margin, ($position % 2 == 0 ? $white : $black) ); } @@ -357,7 +357,7 @@ abstract class C128Abstract { $codeLength = 0; $length = strlen($codeString); - + for ($i = 1; $i <= $length; ++$i) { $codeLength = $codeLength + (int) (substr($codeString, ($i - 1), 1)); } diff --git a/Utils/Barcode/C128a.php b/Utils/Barcode/C128a.php index 4cc91b088..69c54ea79 100644 --- a/Utils/Barcode/C128a.php +++ b/Utils/Barcode/C128a.php @@ -21,7 +21,7 @@ namespace phpOMS\Utils\Barcode; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCasePropertyName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ @@ -84,7 +84,7 @@ class C128a extends C128Abstract * Set content to encrypt * * @param string $content Content to encrypt - * + * * @return void * * @todo : add mirror parameter diff --git a/Utils/Barcode/C128b.php b/Utils/Barcode/C128b.php index 0f47ce480..468170e6e 100644 --- a/Utils/Barcode/C128b.php +++ b/Utils/Barcode/C128b.php @@ -21,7 +21,7 @@ namespace phpOMS\Utils\Barcode; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCasePropertyName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ diff --git a/Utils/Barcode/C128c.php b/Utils/Barcode/C128c.php index 0bc036123..7b605f1cc 100644 --- a/Utils/Barcode/C128c.php +++ b/Utils/Barcode/C128c.php @@ -21,7 +21,7 @@ namespace phpOMS\Utils\Barcode; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCasePropertyName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ diff --git a/Utils/Barcode/C25.php b/Utils/Barcode/C25.php index 9ed332496..e7fd316ab 100644 --- a/Utils/Barcode/C25.php +++ b/Utils/Barcode/C25.php @@ -21,7 +21,7 @@ namespace phpOMS\Utils\Barcode; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCasePropertyName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ @@ -87,7 +87,7 @@ class C25 extends C128Abstract * Set content to encrypt * * @param string $content Barcode content - * + * * @return void * * @since 1.0.0 diff --git a/Utils/Barcode/C39.php b/Utils/Barcode/C39.php index 2b49f53c6..d5c776b78 100644 --- a/Utils/Barcode/C39.php +++ b/Utils/Barcode/C39.php @@ -21,7 +21,7 @@ namespace phpOMS\Utils\Barcode; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCasePropertyName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ @@ -65,7 +65,7 @@ class C39 extends C128Abstract * Set content to encrypt * * @param string $content Barcode content - * + * * @return void * * @since 1.0.0 diff --git a/Utils/Barcode/Codebar.php b/Utils/Barcode/Codebar.php index 1ce0a7b04..571eff9e0 100644 --- a/Utils/Barcode/Codebar.php +++ b/Utils/Barcode/Codebar.php @@ -21,7 +21,7 @@ namespace phpOMS\Utils\Barcode; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCasePropertyName) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ @@ -66,7 +66,7 @@ class Codebar extends C128Abstract * Set content to encrypt * * @param string $content Barcode content - * + * * @return void * * @since 1.0.0 diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index 8013ccf89..21218a117 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -53,7 +53,7 @@ class Currency * Reset currency rates. * * Can be used in order to refresh them. Be careful currency rates only get updated once a day from the ECB website. - * + * * @return void * * @since 1.0.0 diff --git a/Utils/Converter/Ip.php b/Utils/Converter/Ip.php index b4fbdc793..0916690ee 100644 --- a/Utils/Converter/Ip.php +++ b/Utils/Converter/Ip.php @@ -38,9 +38,9 @@ class Ip /** * Convert ip to float - * + * * @param string $ip IP - * + * * @return float * * @since 1.0.0 diff --git a/Utils/Converter/Numeric.php b/Utils/Converter/Numeric.php index efd8b43bb..eb359d177 100644 --- a/Utils/Converter/Numeric.php +++ b/Utils/Converter/Numeric.php @@ -32,8 +32,8 @@ class Numeric * @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, + '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 ]; @@ -77,9 +77,9 @@ class Numeric for ($i = 1; $i <= $numberLen; ++$i) { $newOutput = bcadd( - (string) $newOutput, + (string) $newOutput, bcmul( - (string) array_search($number[$i - 1], $fromBase), + (string) array_search($number[$i - 1], $fromBase), bcpow((string) $fromLen, (string) ($numberLen - $i)) ) ); diff --git a/Utils/Encoding/Huffman/Huffman.php b/Utils/Encoding/Huffman/Huffman.php index aeac7aab4..b79f5d7d3 100644 --- a/Utils/Encoding/Huffman/Huffman.php +++ b/Utils/Encoding/Huffman/Huffman.php @@ -48,7 +48,7 @@ final class Huffman * Set dictionary * * @param Dictionary $dictionary Huffman dictionary - * + * * @return void * * @since 1.0.0 diff --git a/Utils/Git/Branch.php b/Utils/Git/Branch.php index 04fba07fb..8abcff4cc 100644 --- a/Utils/Git/Branch.php +++ b/Utils/Git/Branch.php @@ -60,7 +60,7 @@ class Branch * Set branch name * * @param string $name Branch name - * + * * @return void * * @since 1.0.0 diff --git a/Utils/Git/Commit.php b/Utils/Git/Commit.php index ff5e1df4f..758468bec 100644 --- a/Utils/Git/Commit.php +++ b/Utils/Git/Commit.php @@ -152,7 +152,7 @@ class Commit * Set commit message. * * @param string $message Commit message - * + * * @return void * * @since 1.0.0 @@ -210,7 +210,7 @@ class Commit * Set commit author. * * @param Author $author Commit author - * + * * @return void * * @since 1.0.0 @@ -236,7 +236,7 @@ class Commit * Set commit branch. * * @param Branch $branch Commit branch - * + * * @return void * * @since 1.0.0 @@ -262,7 +262,7 @@ class Commit * Set commit tag. * * @param Tag $tag Commit tag - * + * * @return void * * @since 1.0.0 @@ -314,7 +314,7 @@ class Commit * Set commit repository. * * @param Repository $repository Commit repository - * + * * @return void * * @since 1.0.0 @@ -331,7 +331,7 @@ class Commit * @param int $line Line number * @param string $old Old line * @param string $new New line - * + * * @return void * * @throws \Exception diff --git a/Utils/Git/Git.php b/Utils/Git/Git.php index 781fb865e..2c6c5ef6c 100644 --- a/Utils/Git/Git.php +++ b/Utils/Git/Git.php @@ -73,7 +73,7 @@ class Git * Set git binary. * * @param string $path Git path - * + * * @return void * * @throws PathException diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index b5d571b4a..b86abee43 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -76,7 +76,7 @@ class Repository * Set repository path. * * @param string $path Path to repository - * + * * @return void * * @throws PathException @@ -171,13 +171,13 @@ 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 = 'cd ' . escapeshellarg(dirname(Git::getBin())) + . ' && ' . basename(Git::getBin()) + . ' -C ' . escapeshellarg($this->path) . ' ' . $cmd; } else { - $cmd = escapeshellarg(Git::getBin()) - . ' -C ' . escapeshellarg($this->path) . ' ' + $cmd = escapeshellarg(Git::getBin()) + . ' -C ' . escapeshellarg($this->path) . ' ' . $cmd; } @@ -772,9 +772,9 @@ 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') + 'log --author=' . escapeshellarg($author->getName()) + . ' --since="' . $start->format('Y-m-d') + . '" --before="' . $end->format('Y-m-d') . '" --pretty=tformat: --numstat' ); @@ -828,10 +828,10 @@ class Repository } $lines = $this->run( - 'git log --before="' . $end->format('Y-m-d') - . '" --after="' . $start->format('Y-m-d') . '"' + 'git log --before="' . $end->format('Y-m-d') + . '" --after="' . $start->format('Y-m-d') . '"' . $author . ' --reverse --date=short'); - + $count = count($lines); $commits = []; diff --git a/Utils/Git/Tag.php b/Utils/Git/Tag.php index 0e610f368..a8f5817af 100644 --- a/Utils/Git/Tag.php +++ b/Utils/Git/Tag.php @@ -68,7 +68,7 @@ class Tag * Set tag name * * @param string $message Tag message - * + * * @return void * * @since 1.0.0 diff --git a/Utils/IO/Csv/CsvDatabaseMapper.php b/Utils/IO/Csv/CsvDatabaseMapper.php index af2910e3f..d5005ec22 100644 --- a/Utils/IO/Csv/CsvDatabaseMapper.php +++ b/Utils/IO/Csv/CsvDatabaseMapper.php @@ -27,7 +27,7 @@ class CsvDatabaseMapper implements IODatabaseMapper private $delimiter = ';'; private $enclosure = '"'; - + private $lineBuffer = 500; private $autoIdentifyCsvSettings = false; diff --git a/Utils/IO/Zip/Tar.php b/Utils/IO/Zip/Tar.php index 131a67aeb..457701394 100644 --- a/Utils/IO/Zip/Tar.php +++ b/Utils/IO/Zip/Tar.php @@ -47,7 +47,7 @@ class Tar implements ArchiveInterface if (is_dir($source)) { $files = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($source), + new \RecursiveDirectoryIterator($source), \RecursiveIteratorIterator::SELF_FIRST ); diff --git a/Utils/Parser/Markdown/Markdown.php b/Utils/Parser/Markdown/Markdown.php index e93e750b0..4afb400a7 100644 --- a/Utils/Parser/Markdown/Markdown.php +++ b/Utils/Parser/Markdown/Markdown.php @@ -208,7 +208,7 @@ class Markdown /** * Some definition data for elements - * + * * @todo: figure out what it is for * * @var string[] @@ -220,7 +220,7 @@ class Markdown * Parse markdown * * @param string $text Markdown text - * + * * @return string * * @since 1.0.0 @@ -241,7 +241,7 @@ class Markdown * Parse lines * * @param array $lines Markdown lines - * + * * @return string * * @since 1.0.0 @@ -360,7 +360,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -392,7 +392,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -419,7 +419,7 @@ class Markdown * Handle completed code * * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -433,7 +433,7 @@ class Markdown * Handle fenced code * * @param array $lineArray Line information - * + * * @return null|array * * @since 1.0.0 @@ -470,7 +470,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -503,7 +503,7 @@ class Markdown * Handle completed fenced block code * * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -517,7 +517,7 @@ class Markdown * Handle header element * * @param array $lineArray Line information - * + * * @return null|array * * @since 1.0.0 @@ -550,7 +550,7 @@ class Markdown * Handle list * * @param array $lineArray Line information - * + * * @return null|array * * @since 1.0.0 @@ -598,7 +598,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -653,7 +653,7 @@ class Markdown * Handle block quote * * @param array $lineArray Line information - * + * * @return null|array * * @since 1.0.0 @@ -678,7 +678,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -710,7 +710,7 @@ class Markdown * Handle HR element * * @param array $lineArray Line information - * + * * @return null|array * * @since 1.0.0 @@ -733,7 +733,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -757,7 +757,7 @@ class Markdown * Handle content reference * * @param array $lineArray Line information - * + * * @return null|array * * @since 1.0.0 @@ -783,7 +783,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -880,7 +880,7 @@ class Markdown * * @param array $lineArray Line information * @param array $block Block information - * + * * @return null|array * * @since 1.0.0 @@ -929,7 +929,7 @@ class Markdown * Handle paragraph * * @param array $lineArray Line information - * + * * @return array * * @since 1.0.0 @@ -949,7 +949,7 @@ class Markdown * Handle a single line * * @param string $text Line of text - * + * * @return string * * @since 1.0.0 @@ -1000,7 +1000,7 @@ class Markdown * Handle inline code * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1026,7 +1026,7 @@ class Markdown * Handle inline email * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1059,7 +1059,7 @@ class Markdown * Handle inline emphasis * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1096,7 +1096,7 @@ class Markdown * Handle escape of special char * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1117,7 +1117,7 @@ class Markdown * Handle inline image * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1157,7 +1157,7 @@ class Markdown * Handle inline link * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1223,7 +1223,7 @@ class Markdown * Handle special char to html * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1251,7 +1251,7 @@ class Markdown * Handle inline strike through * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1280,7 +1280,7 @@ class Markdown * Handle inline url * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1312,7 +1312,7 @@ class Markdown * Handle inline url * * @param array $excerpt Markdown excerpt - * + * * @return null|array * * @since 1.0.0 @@ -1339,7 +1339,7 @@ class Markdown * Clean up normal text * * @param string $text Normal text - * + * * @return string * * @since 1.0.0 @@ -1356,7 +1356,7 @@ class Markdown * Handle general html element * * @param array $element Html element - * + * * @return string * * @since 1.0.0 @@ -1391,7 +1391,7 @@ class Markdown * Handle an array of elements * * @param array $elements Elements - * + * * @return string * * @since 1.0.0 @@ -1411,11 +1411,11 @@ class Markdown /** * Remove blocks - * + * * @param array $lines Lines - * + * * @return string - * + * * @since 1.0.0 */ protected static function li(array $lines) : string @@ -1435,9 +1435,9 @@ class Markdown /** * Sanitize an element - * + * * @param array $element Element to sanitize - * + * * @return array * * @since 1.0.0 @@ -1468,10 +1468,10 @@ class Markdown /** * Replace unsafe url - * + * * @param array $element Element to sanitize * @param string $attribute Element attribute - * + * * @return array * * @since 1.0.0 @@ -1491,10 +1491,10 @@ class Markdown /** * Escape html elements - * + * * @param string $text Text to escape * @param bool $allowQuotes Are quotes allowed - * + * * @return string * * @since 1.0.0 @@ -1506,10 +1506,10 @@ class Markdown /** * Check if string starts with - * + * * @param string $string Text to check against * @param string $needle Needle to check - * + * * @return bool * * @since 1.0.0 diff --git a/Utils/RnG/Name.php b/Utils/RnG/Name.php index b8db47910..ea48fb868 100644 --- a/Utils/RnG/Name.php +++ b/Utils/RnG/Name.php @@ -469,13 +469,13 @@ 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', + 'Հովհաննիսյան', 'Հարությունյան', 'Սարգսյան', 'Խաչատրյան', 'Գրիգորյան', 'আহমেদ', 'আলী', 'আক্তার', + 'বন্দ্যোপাধ্যায়', 'নিক', 'ব্যাপারী', 'বড়ুয়া', 'বিশ্বাস', 'ভৌমিক', 'বসু', '王', '李', '张', '刘', '陈', '杨', + '黄', '赵', '吴', '周', '徐', '孙', '马', '朱', '胡', '郭', '何', '高', '林', '罗', 'כהן', 'לוי', + 'מזרחי', 'פרץ', 'ביטון', 'דהן', 'אברהם', 'פרידמן', 'מלכה', 'אזולאי', 'כץ', 'יוסף', 'דוד', 'עמר', + 'אוחיון', '김', '리', '박', '최', '정', '강', '조', '윤', '장', '림', '한', '신', '서', '권', '황', + '안', '송', '홍', '고', '문', '손', '량', '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', ], ] diff --git a/Utils/RnG/Phone.php b/Utils/RnG/Phone.php index 4d97bc64e..1b696f784 100644 --- a/Utils/RnG/Phone.php +++ b/Utils/RnG/Phone.php @@ -56,7 +56,7 @@ class Phone 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'), + '$' . $i, StringUtils::generateString($layout['size'][$i - 1][0], $layout['size'][$i - 1][1], '0123456789'), $numberString ); } diff --git a/Utils/RnG/StringUtils.php b/Utils/RnG/StringUtils.php index 1b725e46e..623ff7638 100644 --- a/Utils/RnG/StringUtils.php +++ b/Utils/RnG/StringUtils.php @@ -36,7 +36,7 @@ class StringUtils * * @since 1.0.0 */ - public static function generateString(int $min = 10, int $max = 10, + public static function generateString(int $min = 10, int $max = 10, string $charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ) : string { diff --git a/Utils/StringCompare.php b/Utils/StringCompare.php index c2a479416..6446f3694 100644 --- a/Utils/StringCompare.php +++ b/Utils/StringCompare.php @@ -169,9 +169,9 @@ final class StringCompare * @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, + string $s1, string $s2, + float $phraseWeight = 0.5, float $wordWeight = 1, + float $minWeight = 10, float $maxWeight = 1, float $lengthWeight = -0.3 ) : float { diff --git a/Utils/StringUtils.php b/Utils/StringUtils.php index cedd86b13..8c5628be2 100644 --- a/Utils/StringUtils.php +++ b/Utils/StringUtils.php @@ -23,7 +23,7 @@ namespace phpOMS\Utils; * @license OMS License 1.0 * @link http://website.orange-management.de * @since 1.0.0 - * + * * @SuppressWarnings(PHPMD.CamelCaseMethodName) */ final class StringUtils diff --git a/Utils/TaskSchedule/Interval.php b/Utils/TaskSchedule/Interval.php index 61e037bfc..ef046d2d0 100644 --- a/Utils/TaskSchedule/Interval.php +++ b/Utils/TaskSchedule/Interval.php @@ -109,7 +109,7 @@ class Interval implements \Serializable * Unserialize. * * @param string $serialized String to unserialize - * + * * @return void * * @since 1.0.0 @@ -282,7 +282,7 @@ class Interval implements \Serializable * @param bool $any Any * * @return void - * + * * @throws \Exception * * @since 1.0.0 @@ -345,7 +345,7 @@ class Interval implements \Serializable * @param array $hour Hour * @param int $step Step * @param bool $any Any - * + * * @return void * * @throws \Exception @@ -385,7 +385,7 @@ class Interval implements \Serializable * @param bool $any Any * @param bool $last Last * @param int $nearest Nearest day - * + * * @return void * * @throws \Exception @@ -454,7 +454,7 @@ class Interval implements \Serializable * @param int $step Step * @param bool $any Any * @param bool $last Last - * + * * @return void * * @throws \Exception @@ -518,7 +518,7 @@ class Interval implements \Serializable * @param array $month Month * @param int $step Step * @param bool $any Any - * + * * @return void * * @throws \Exception @@ -556,7 +556,7 @@ class Interval implements \Serializable * @param array $year Year * @param int $step Step * @param bool $any Any - * + * * @return void * * @throws \Exception diff --git a/Utils/TaskSchedule/SchedulerAbstract.php b/Utils/TaskSchedule/SchedulerAbstract.php index be5e12e01..cd7ed7436 100644 --- a/Utils/TaskSchedule/SchedulerAbstract.php +++ b/Utils/TaskSchedule/SchedulerAbstract.php @@ -52,7 +52,7 @@ abstract class SchedulerAbstract * Set git binary. * * @param string $path Git path - * + * * @return void * * @throws PathException diff --git a/Utils/TestUtils.php b/Utils/TestUtils.php index da6d73c9d..6f23b4a72 100644 --- a/Utils/TestUtils.php +++ b/Utils/TestUtils.php @@ -36,7 +36,7 @@ final class TestUtils { } - + /** * Set private object member * diff --git a/Views/View.php b/Views/View.php index 59f9ddd2b..57b663d57 100644 --- a/Views/View.php +++ b/Views/View.php @@ -90,7 +90,7 @@ class View extends ViewAbstract /** * Get data attached to view - * + * * @param string $id Data Id * * @return mixed @@ -104,7 +104,7 @@ class View extends ViewAbstract /** * Set data of view - * + * * @param string $id Data ID * @param mixed $data Data * @@ -139,7 +139,7 @@ class View extends ViewAbstract /** * Add data to view - * + * * @param string $id Data ID * @param mixed $data Data * @@ -219,7 +219,7 @@ class View extends ViewAbstract /** * Get request of view - * + * * @return RequestAbstract|null * * @since 1.0.0 @@ -231,7 +231,7 @@ class View extends ViewAbstract /** * Get response of view - * + * * @return ResponseAbstract|null * * @since 1.0.0 diff --git a/Views/ViewAbstract.php b/Views/ViewAbstract.php index d7715e888..398c7fce5 100644 --- a/Views/ViewAbstract.php +++ b/Views/ViewAbstract.php @@ -18,7 +18,7 @@ use phpOMS\System\File\PathException; /** * View Abstract. - * + * * @package phpOMS\Views * @license OMS License 1.0 * @link http://website.orange-management.de @@ -118,7 +118,7 @@ abstract class ViewAbstract implements \Serializable /** * Returns all views - * + * * @return View[] * * @since 1.0.0 @@ -130,7 +130,7 @@ abstract class ViewAbstract implements \Serializable /** * Returns a specific view - * + * * @param string $id View ID * * @return false|View diff --git a/tests/Account/AccountManagerTest.php b/tests/Account/AccountManagerTest.php index 8803b4ab0..0924839a3 100644 --- a/tests/Account/AccountManagerTest.php +++ b/tests/Account/AccountManagerTest.php @@ -24,7 +24,7 @@ require_once __DIR__ . '/../Autoloader.php'; class AccountManagerTest extends \PHPUnit\Framework\TestCase { - public function testAttributes() + public function testAttributes() { $manager = new AccountManager($GLOBALS['httpSession']); self::assertInstanceOf('\phpOMS\Account\AccountManager', $manager); @@ -33,7 +33,7 @@ class AccountManagerTest extends \PHPUnit\Framework\TestCase self::assertObjectHasAttribute('accounts', $manager); } - public function testDefault() + public function testDefault() { $manager = new AccountManager($GLOBALS['httpSession']); diff --git a/tests/Account/GroupTest.php b/tests/Account/GroupTest.php index 7a0fd7b11..da556fe50 100644 --- a/tests/Account/GroupTest.php +++ b/tests/Account/GroupTest.php @@ -20,7 +20,7 @@ require_once __DIR__ . '/../Autoloader.php'; class GroupTest extends \PHPUnit\Framework\TestCase { - public function testAttributes() + public function testAttributes() { $group = new Group(); self::assertInstanceOf('\phpOMS\Account\Group', $group); @@ -35,7 +35,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase self::assertObjectHasAttribute('status', $group); } - public function testDefault() + public function testDefault() { $group = new Group(); diff --git a/tests/DataStorage/Cache/Connection/FileCacheTest.php b/tests/DataStorage/Cache/Connection/FileCacheTest.php index f9e5784b1..2c5a3356a 100644 --- a/tests/DataStorage/Cache/Connection/FileCacheTest.php +++ b/tests/DataStorage/Cache/Connection/FileCacheTest.php @@ -40,7 +40,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase if (file_exists(__DIR__ . '/Cache')) { rmdir(__DIR__ . '/Cache'); } - + $cache = new FileCache(__DIR__ . '/Cache'); $cache->set('key1', 'testVal'); diff --git a/tests/DataStorage/Database/TestModel/BaseModel.php b/tests/DataStorage/Database/TestModel/BaseModel.php index f2920b7b8..437c19a8a 100644 --- a/tests/DataStorage/Database/TestModel/BaseModel.php +++ b/tests/DataStorage/Database/TestModel/BaseModel.php @@ -61,19 +61,19 @@ class BaseModel $this->belongsToOne = new BelongsToModel(); $this->serializable = new class implements \Serializable { - public function serialize() + public function serialize() { return '123'; } - public function unserialize($data) + public function unserialize($data) { - + } }; $this->jsonSerializable = new class implements \JsonSerializable { - public function jsonSerialize() + public function jsonSerialize() { return [1, 2, 3]; } diff --git a/tests/Log/FileLoggerTest.php b/tests/Log/FileLoggerTest.php index 2cc01b9c9..8ee028563 100644 --- a/tests/Log/FileLoggerTest.php +++ b/tests/Log/FileLoggerTest.php @@ -129,7 +129,7 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase 'message' => 'msg', 'line' => 11, 'file' => FileLoggerTest::class, - ]); + ]); $ob = ob_get_clean(); self::assertEquals(2, $log->countLogs()['info'] ?? 0); self::assertTrue(stripos($ob, 'msg;') !== false); diff --git a/tests/Math/Functions/FunctionsTest.php b/tests/Math/Functions/FunctionsTest.php index 58aa43fc9..99aa0676a 100644 --- a/tests/Math/Functions/FunctionsTest.php +++ b/tests/Math/Functions/FunctionsTest.php @@ -66,12 +66,12 @@ class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, Functions::getRelativeDegree(12, 12, 7)); self::assertEquals(11, Functions::getRelativeDegree(6, 12, 7)); } - + public function testPower() { self::assertEquals([4, 9, 16], Functions::powerInt([2, 3, 4], 2)); self::assertEquals([8, 27, 64], Functions::powerInt([2, 3, 4], 3)); - + self::assertEquals([2.0, 3.0, 4.0], Functions::powerFloat([4, 9, 16], 1 / 2), '', 0.0); self::assertEquals([2.0, 3.0, 4.0], Functions::powerFloat([8, 27, 64], 1 / 3), '', 0.0); } diff --git a/tests/Math/Functions/GammaTest.php b/tests/Math/Functions/GammaTest.php index 08a279625..2bb02fc03 100644 --- a/tests/Math/Functions/GammaTest.php +++ b/tests/Math/Functions/GammaTest.php @@ -29,7 +29,7 @@ class GammaTest extends \PHPUnit\Framework\TestCase 2.15697602, 1.20285073, 0.92213701, 0.83974270, 0.85919025, 0.95950218, 1.14910642, 1.45849038, 1.94540320, 2.70976382, ]; - $spouge = [ + $spouge = [ 2.67893853, 1.35411794, 1.00000000, 0.89297951, 0.90274529, 1.00000000, 1.19063935, 1.50457549, 2.00000000, 2.77815848, ]; diff --git a/tests/Math/Statistic/AverageTest.php b/tests/Math/Statistic/AverageTest.php index 954e2ba83..2f322f2c2 100644 --- a/tests/Math/Statistic/AverageTest.php +++ b/tests/Math/Statistic/AverageTest.php @@ -27,7 +27,7 @@ class AverageTest extends \PHPUnit\Framework\TestCase self::assertEquals(4, Average::arithmeticMean([1, 2, 3, 4, 5, 6, 7]), '', 0.01); self::assertEquals(69 / 20, Average::weightedAverage( - [1, 2, 3, 4, 5, 6, 7], + [1, 2, 3, 4, 5, 6, 7], [0.1, 0.2, 0.3, 0.1, 0.2, 0.05, 0.05] ), '', 0.01); diff --git a/tests/Math/Statistic/BasicTest.php b/tests/Math/Statistic/BasicTest.php index 016c6104f..35d577978 100644 --- a/tests/Math/Statistic/BasicTest.php +++ b/tests/Math/Statistic/BasicTest.php @@ -20,12 +20,12 @@ class BasicTest extends \PHPUnit\Framework\TestCase public function testFrequency() { self::assertEquals( - [1 / 10, 2 / 10, 3 / 10, 4 / 10], + [1 / 10, 2 / 10, 3 / 10, 4 / 10], Basic::frequency([1, 2, 3, 4]) ); - + self::assertEquals( - [1 / 10, 2 / 10, 3 / 10, [1 / 6, 2 / 6, 3 / 6], 4 / 10], + [1 / 10, 2 / 10, 3 / 10, [1 / 6, 2 / 6, 3 / 6], 4 / 10], Basic::frequency([1, 2, 3, [1, 2, 3], 4]) ); } diff --git a/tests/Math/Statistic/Forecast/ErrorTest.php b/tests/Math/Statistic/Forecast/ErrorTest.php index 01649d0c9..2718fbe8f 100644 --- a/tests/Math/Statistic/Forecast/ErrorTest.php +++ b/tests/Math/Statistic/Forecast/ErrorTest.php @@ -33,7 +33,7 @@ class ErrorTest extends \PHPUnit\Framework\TestCase ) ); } - + public function testErrorPercentage() { self::assertEquals(300 / 1000, Error::getPercentageError(300, 1000), '', 0.01); @@ -53,7 +53,7 @@ class ErrorTest extends \PHPUnit\Framework\TestCase ) ); } - + public function testMeanError() { $errors = [ @@ -62,7 +62,7 @@ class ErrorTest extends \PHPUnit\Framework\TestCase 200 - 200, 500 - -300 ]; - + self::assertEquals(300, Error::getMeanAbsoulteError($errors), '', 0.01); self::assertEquals(125000, Error::getMeanSquaredError($errors), '', 0.01); self::assertEquals(406.2019, Error::getRootMeanSquaredError($errors), '', 0.01); diff --git a/tests/Math/Statistic/MeasureOfDispersionTest.php b/tests/Math/Statistic/MeasureOfDispersionTest.php index 26b68e074..5c2cd03fe 100644 --- a/tests/Math/Statistic/MeasureOfDispersionTest.php +++ b/tests/Math/Statistic/MeasureOfDispersionTest.php @@ -30,7 +30,7 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase public function testEmpiricalCovariance() { self::assertEquals( - 4.667, + 4.667, MeasureOfDispersion::empiricalCovariance( [1, 2, 3, 4, 5, 6, 7], [3, 4, 5, 9, 7, 8, 9] diff --git a/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php b/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php index 4fadff45c..79d010e88 100644 --- a/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php @@ -27,7 +27,7 @@ class CauchyDistributionTest extends \PHPUnit\Framework\TestCase { $x = 1; $x0 = 0.5; - $gamma = 2; + $gamma = 2; self::assertEquals(0.14979, CauchyDistribution::getPdf($x, $x0, $gamma), '', 0.01); } @@ -36,15 +36,15 @@ class CauchyDistributionTest extends \PHPUnit\Framework\TestCase { $x = 1; $x0 = 0.5; - $gamma = 2; + $gamma = 2; self::assertEquals(0.57798, CauchyDistribution::getCdf($x, $x0, $gamma), '', 0.01); } - + public function testEntropy() { $gamma = 1.5; - + self::assertEquals(log(4 * M_PI * $gamma), CauchyDistribution::getEntropy($gamma), '', 0.01); } } diff --git a/tests/Model/Html/MetaTest.php b/tests/Model/Html/MetaTest.php index f6d28181d..863b75a12 100644 --- a/tests/Model/Html/MetaTest.php +++ b/tests/Model/Html/MetaTest.php @@ -36,7 +36,7 @@ class MetaTest extends \PHPUnit\Framework\TestCase $meta->setAuthor('oms'); self::assertEquals('oms', $meta->getAuthor()); - + $meta->setCharset('utf-8'); self::assertEquals('utf-8', $meta->getCharset()); diff --git a/tests/Module/InfoManagerTest.php b/tests/Module/InfoManagerTest.php index 501811fa0..39c35cf77 100644 --- a/tests/Module/InfoManagerTest.php +++ b/tests/Module/InfoManagerTest.php @@ -75,12 +75,12 @@ class InfoManagerTest extends \PHPUnit\Framework\TestCase $info = new InfoManager(__DIR__ . '/info-test.json'); $info->load(); - $testObj = new class { - public $test = 1; - - public function test() - { - echo $this->test; + $testObj = new class { + public $test = 1; + + public function test() + { + echo $this->test; } }; diff --git a/tests/Stdlib/Map/MultiMapTest.php b/tests/Stdlib/Map/MultiMapTest.php index 1bc4397ae..923698943 100644 --- a/tests/Stdlib/Map/MultiMapTest.php +++ b/tests/Stdlib/Map/MultiMapTest.php @@ -183,7 +183,7 @@ class MultiMapTest extends \PHPUnit\Framework\TestCase $inserted = $map->add(['a', 'b'], 'val2'); $inserted = $map->add(['a', 'c'], 'val3', false); - + $set = $map->set('d', 'val4'); $set = $map->set('b', 'val4'); diff --git a/tests/Utils/TaskSchedule/TaskAbstractTest.php b/tests/Utils/TaskSchedule/TaskAbstractTest.php index dcda669cb..41f4ebcd2 100644 --- a/tests/Utils/TaskSchedule/TaskAbstractTest.php +++ b/tests/Utils/TaskSchedule/TaskAbstractTest.php @@ -22,7 +22,7 @@ class TaskAbstractTest extends \PHPUnit\Framework\TestCase protected function setUp() { $this->class = new class('') extends TaskAbstract { - public static function createWith(array $jobData) : TaskAbstract + public static function createWith(array $jobData) : TaskAbstract { }