diff --git a/Account/Account.php b/Account/Account.php index ab476b2a4..32c6174af 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -20,15 +18,13 @@ namespace phpOMS\Account; use phpOMS\Contract\ArrayableInterface; use phpOMS\Localization\Localization; use phpOMS\Localization\NullLocalization; -use phpOMS\Validation\Base\Email; +use phpOMS\Validation\Network\Email; /** * Account manager class. * * @category Framework * @package phpOMS\Account - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -164,7 +160,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @param int $id Account id * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(int $id = 0) { @@ -180,7 +175,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return int Account id * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getId() : int { @@ -193,7 +187,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return Localization * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getL11n() : Localization { @@ -208,7 +201,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setL11n(Localization $l11n) /* : void */ { @@ -221,7 +213,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -234,7 +225,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName1() : string { @@ -247,7 +237,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName2() : string { @@ -260,7 +249,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName3() : string { @@ -273,7 +261,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEmail() : string { @@ -288,7 +275,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStatus() : int { @@ -303,7 +289,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getType() : int { @@ -316,7 +301,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLastActive() : \DateTime { @@ -329,7 +313,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCreatedAt() : \DateTime { @@ -344,7 +327,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function generatePassword(string $password) /* : void */ { @@ -359,7 +341,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName(string $name) /* : void */ { @@ -374,7 +355,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName1(string $name) /* : void */ { @@ -389,7 +369,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName2(string $name) /* : void */ { @@ -404,7 +383,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName3(string $name) /* : void */ { @@ -419,7 +397,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setEmail(string $email) /* : void */ { @@ -438,7 +415,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStatus(int $status) /* : void */ { @@ -457,7 +433,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setType(int $type) /* : void */ { @@ -474,9 +449,8 @@ class Account implements ArrayableInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function updateLastActive() + public function updateLastActive() /* : void */ { $this->lastActive = new \DateTime('NOW'); } @@ -508,7 +482,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __toString() { @@ -521,7 +494,6 @@ class Account implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function jsonSerialize() { diff --git a/Account/AccountManager.php b/Account/AccountManager.php index af1eae98b..c8bfed69b 100644 --- a/Account/AccountManager.php +++ b/Account/AccountManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\DataStorage\Session\SessionInterface; * * @category Framework * @package phpOMS\Account - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -74,7 +70,6 @@ class AccountManager implements \Countable * @param SessionInterface $session Session * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(ConnectionAbstract $connection, SessionInterface $session) { @@ -91,7 +86,6 @@ class AccountManager implements \Countable * @return Account * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(int $id = 0) : Account { @@ -116,7 +110,6 @@ class AccountManager implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(Account $account) : bool { @@ -137,7 +130,6 @@ class AccountManager implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(int $id) : bool { @@ -156,7 +148,6 @@ class AccountManager implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Account/AccountStatus.php b/Account/AccountStatus.php index cc6f7fe5b..c7aa95269 100644 --- a/Account/AccountStatus.php +++ b/Account/AccountStatus.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Account; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Account status enum. * * @category Framework * @package phpOMS\Account - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Account/AccountType.php b/Account/AccountType.php index bcf2aa6c2..92369d6c9 100644 --- a/Account/AccountType.php +++ b/Account/AccountType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Account; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Account type enum. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Account/Group.php b/Account/Group.php index d5b9f07c1..fde961c6a 100644 --- a/Account/Group.php +++ b/Account/Group.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Contract\ArrayableInterface; * * @category Framework * @package phpOMS\Account - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -89,31 +85,13 @@ class Group implements ArrayableInterface, \JsonSerializable */ protected $permissions = []; - /** - * Created at. - * - * @var \DateTime - * @since 1.0.0 - */ - protected $createdAt = null; - - /** - * Created by. - * - * @var int - * @since 1.0.0 - */ - protected $createdBy = 0; - /** * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { - $this->createdAt = new \DateTime('now'); } /** @@ -122,7 +100,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getId() : int { @@ -135,7 +112,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -148,7 +124,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @param string $name Group name * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName(string $name) /* : void */ { @@ -161,7 +136,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDescription() : string { @@ -174,7 +148,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @param string $description Group description * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDescription(string $description) /* : void */ { @@ -187,7 +160,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @return int Group status * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStatus() : int { @@ -200,7 +172,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @param int $status Group status * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStatus(int $status) /* : void */ { @@ -214,7 +185,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __toString() { @@ -227,7 +197,6 @@ class Group implements ArrayableInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function jsonSerialize() { @@ -243,8 +212,6 @@ class Group implements ArrayableInterface, \JsonSerializable 'id' => $this->id, 'name' => $this->name, 'description' => $this->description, - 'createdBy' => $this->createdBy, - 'createdAt' => $this->createdAt->format('Y-m-d H:i:s'), 'permissions' => $this->permissions, 'members' => $this->members, ]; diff --git a/Account/GroupStatus.php b/Account/GroupStatus.php index 43656db4d..14916b4ef 100644 --- a/Account/GroupStatus.php +++ b/Account/GroupStatus.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Account; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Accept status enum. * * @category Calendar * @package Modules - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Account/NullAccount.php b/Account/NullAccount.php index 8ea0f6552..20d49d87e 100644 --- a/Account/NullAccount.php +++ b/Account/NullAccount.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Account; * * @category Framework * @package phpOMS\Account - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Algorithm/AlgorithmType.php b/Algorithm/AlgorithmType.php index 21db3e5ae..ee1d0841d 100644 --- a/Algorithm/AlgorithmType.php +++ b/Algorithm/AlgorithmType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Algorithm; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Task status enum. * * @category Tasks * @package Modules - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Algorithm/Knappsack/Backpack.php b/Algorithm/Knappsack/Backpack.php index 76d69fc27..ddd220cbc 100644 --- a/Algorithm/Knappsack/Backpack.php +++ b/Algorithm/Knappsack/Backpack.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMS\Algorithm\AlgorithmType; * * @category Framework * @package phpOMS\Auth - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Algorithm/Knappsack/ItemInterface.php b/Algorithm/Knappsack/ItemInterface.php index 3f4ebc880..0966fc09b 100644 --- a/Algorithm/Knappsack/ItemInterface.php +++ b/Algorithm/Knappsack/ItemInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Algorithm\Knappsack; * * @category Framework * @package phpOMS\Math - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/ApplicationAbstract.php b/ApplicationAbstract.php index fe809b50c..8d47bfbb7 100644 --- a/ApplicationAbstract.php +++ b/ApplicationAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS; * * @category Framework * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,7 @@ class ApplicationAbstract * @var string * @since 1.0.0 */ - public $appName = ''; + protected $appName = ''; /** * Config. @@ -45,7 +41,7 @@ class ApplicationAbstract * @var array * @since 1.0.0 */ - private $config = []; + protected $config = []; /** * Database object. @@ -53,7 +49,7 @@ class ApplicationAbstract * @var \phpOMS\DataStorage\Database\DatabasePool * @since 1.0.0 */ - public $dbPool = null; + protected $dbPool = null; /** * Application settings object. @@ -61,7 +57,7 @@ class ApplicationAbstract * @var \Model\CoreSettings * @since 1.0.0 */ - public $appSettings = null; + protected $appSettings = null; /** * Account manager instance. @@ -69,7 +65,7 @@ class ApplicationAbstract * @var \phpOMS\Account\AccountManager * @since 1.0.0 */ - public $accountManager = null; + protected $accountManager = null; /** * Cache instance. @@ -77,7 +73,7 @@ class ApplicationAbstract * @var \phpOMS\DataStorage\Cache\CachePool * @since 1.0.0 */ - public $cachePool = null; + protected $cachePool = null; /** * ModuleManager instance. @@ -85,7 +81,7 @@ class ApplicationAbstract * @var \phpOMS\Module\ModuleManager * @since 1.0.0 */ - public $moduleManager = null; + protected $moduleManager = null; /** * Router instance. @@ -93,7 +89,7 @@ class ApplicationAbstract * @var \phpOMS\Router\Router * @since 1.0.0 */ - public $router = null; + protected $router = null; /** * Dispatcher instance. @@ -101,7 +97,7 @@ class ApplicationAbstract * @var \phpOMS\Dispatcher\Dispatcher * @since 1.0.0 */ - public $dispatcher = null; + protected $dispatcher = null; /** * Session instance. @@ -109,7 +105,7 @@ class ApplicationAbstract * @var \phpOMS\DataStorage\Session\SessionInterface * @since 1.0.0 */ - public $sessionManager = null; + protected $sessionManager = null; /** * Server localization. @@ -117,7 +113,7 @@ class ApplicationAbstract * @var \phpOMS\Localization\Localization * @since 1.0.0 */ - public $l11nServer = null; + protected $l11nServer = null; /** * Server localization. @@ -125,7 +121,7 @@ class ApplicationAbstract * @var \phpOMS\Log\FileLogger * @since 1.0.0 */ - public $logger = null; + protected $logger = null; /** * L11n manager. @@ -133,7 +129,7 @@ class ApplicationAbstract * @var \phpOMS\Localization\L11nManager * @since 1.0.0 */ - public $l11nManager = null; + protected $l11nManager = null; /** * Event manager. @@ -141,5 +137,46 @@ class ApplicationAbstract * @var \phpOMS\Event\EventManager * @since 1.0.0 */ - public $eventManager = null; + protected $eventManager = null; + + /** + * Set values + * + * @param string $name Variable name + * @param string $value Variable value + * + * @return void + * + * @todo replace with proper setter (faster) + * + * @since 1.0.0 + */ + public function __set($name, $value) + { + if(!empty($this->$name) || $name === 'config') { + return; + } + + $this->$name = $value; + } + + /** + * Get values + * + * @param string $name Variable name + * + * @return mixed + * + * @todo replace with proper getter (faster) + * + * @since 1.0.0 + */ + public function __get($name) + { + if($name === 'config') { + return []; + } + + return $this->$name; + } } diff --git a/Asset/AssetManager.php b/Asset/AssetManager.php index b10ee1ae4..f6bb7ef07 100644 --- a/Asset/AssetManager.php +++ b/Asset/AssetManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Asset; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ class AssetManager implements \Countable * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -59,7 +54,6 @@ class AssetManager implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(string $id, string $asset, bool $overwrite = true) : bool { @@ -80,7 +74,6 @@ class AssetManager implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(string $id) : bool { @@ -101,7 +94,6 @@ class AssetManager implements \Countable * @return mixed Asset * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(string $id) /* : ?string */ { @@ -118,7 +110,6 @@ class AssetManager implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Asset/AssetType.php b/Asset/AssetType.php index c60cd0daf..7f710555f 100644 --- a/Asset/AssetType.php +++ b/Asset/AssetType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Asset; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Asset types enum. * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Auth/Auth.php b/Auth/Auth.php index 4ac978b57..38a80b112 100644 --- a/Auth/Auth.php +++ b/Auth/Auth.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -28,8 +26,6 @@ use phpOMS\DataStorage\Session\SessionInterface; * * @category Framework * @package phpOMS\Auth - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -59,7 +55,6 @@ class Auth * @param SessionInterface $session Session * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(ConnectionAbstract $connection, SessionInterface $session) { @@ -73,7 +68,6 @@ class Auth * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function authenticate() : int { @@ -94,7 +88,6 @@ class Auth * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function logout(int $uid = null) /* : void */ { diff --git a/Auth/LoginReturnType.php b/Auth/LoginReturnType.php index 345303e36..8ce0352ae 100644 --- a/Auth/LoginReturnType.php +++ b/Auth/LoginReturnType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Auth; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Login return types enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\Auth - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/AutoloadException.php b/AutoloadException.php index b32db22a2..e7ff43e8c 100644 --- a/AutoloadException.php +++ b/AutoloadException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class AutoloadException extends \RuntimeException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { diff --git a/Autoloader.php b/Autoloader.php index 06112f46d..8a67bc84d 100644 --- a/Autoloader.php +++ b/Autoloader.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ spl_autoload_register('\phpOMS\Autoloader::default_autoloader'); * * @category Framework * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,7 +41,6 @@ class Autoloader * @throws AutoloadException Throws this exception if the class to autoload doesn't exist. This could also be related to a wrong namespace/file path correlation. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function default_autoloader(string $class) /* : void */ { @@ -70,7 +65,6 @@ class Autoloader * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function exists(string $class) : bool { diff --git a/Math/Finance/Depreciation.php b/Business/Finance/Depreciation.php similarity index 67% rename from Math/Finance/Depreciation.php rename to Business/Finance/Depreciation.php index 03c4c6afc..cc0fd25b3 100644 --- a/Math/Finance/Depreciation.php +++ b/Business/Finance/Depreciation.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance; +namespace phpOMS\Business\Finance; class Depreciation { diff --git a/Math/Finance/FinanceFormulas.php b/Business/Finance/FinanceFormulas.php similarity index 91% rename from Math/Finance/FinanceFormulas.php rename to Business/Finance/FinanceFormulas.php index e7c78db75..dfca67533 100644 --- a/Math/Finance/FinanceFormulas.php +++ b/Business/Finance/FinanceFormulas.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,16 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance; +namespace phpOMS\Business\Finance; use phpOMS\Math\Statistic\Average; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; /** * Finance class. * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +41,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAnnualPercentageYield(float $r, int $n) : float { @@ -62,7 +58,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getStateAnnualInterestRateOfAPY(float $apy, int $n) : float { @@ -79,7 +74,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFutureValueOfAnnuity(float $P, float $r, int $n) : float { @@ -96,7 +90,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNumberOfPeriodsOfFVA(float $fva, float $P, float $r) : int { @@ -113,7 +106,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodicPaymentOfFVA(float $fva, float $r, int $n) : float { @@ -131,7 +123,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFutureValueOfAnnuityConinuousCompounding(float $cf, float $r, int $t) : float { @@ -148,7 +139,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCashFlowOfFVACC(float $fvacc, float $r, int $t) : float { @@ -165,7 +155,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getTimeOfFVACC(float $fvacc, float $cf, float $r) : int { @@ -182,7 +171,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAnnuityPaymentPV(float $pv, float $r, int $n) : float { @@ -199,7 +187,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNumberOfAPPV(float $p, float $pv, float $r) : int { @@ -216,7 +203,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueOfAPPV(float $p, float $r, int $n) : float { @@ -233,7 +219,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAnnuityPaymentFV(float $fv, float $r, int $n) : float { @@ -250,7 +235,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNumberOfAPFV(float $p, float $fv, float $r) : int { @@ -267,7 +251,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFutureValueOfAPFV(float $p, float $r, int $n) : float { @@ -283,7 +266,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAnnutiyPaymentFactorPV(float $r, int $n) : float { @@ -299,7 +281,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNumberOfAPFPV(float $p, float $r) : int { @@ -316,7 +297,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueOfAnnuity(float $P, float $r, int $n) : float { @@ -333,7 +313,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNumberOfPeriodsOfPVA(float $pva, float $P, float $r) : int { @@ -350,7 +329,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodicPaymentOfPVA(float $pva, float $r, int $n) : float { @@ -366,7 +344,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueAnnuityFactor(float $r, int $n) : float { @@ -382,7 +359,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodsOfPVAF(float $p, float $r) : int { @@ -399,7 +375,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueOfAnnuityDue(float $P, float $r, int $n) : float { @@ -418,7 +393,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodicPaymentOfPVAD(float $PV, float $r, int $n) : float { @@ -435,7 +409,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodsOfPVAD(float $PV, float $P, float $r) : int { @@ -452,7 +425,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFutureValueOfAnnuityDue(float $P, float $r, int $n) : float { @@ -469,7 +441,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodicPaymentOfFVAD(float $FV, float $r, int $n) : float { @@ -486,7 +457,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodsOfFVAD(float $FV, float $P, float $r) : int { @@ -502,7 +472,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAssetToSalesRatio(float $assets, float $revenue) : float { @@ -518,7 +487,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAssetTurnoverRatio(float $assets, float $revenue) : float { @@ -534,7 +502,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAverageCollectionPeriod(float $receivables, int $period = 365) : float { @@ -550,7 +517,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getReceivablesTurnover(float $sales, float $receivables) : float { @@ -567,7 +533,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCompoundInterest(float $P, float $r, int $n) : float { @@ -584,7 +549,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPrincipalOfCompundInterest(float $C, float $r, int $n) : float { @@ -601,7 +565,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodsOfCompundInterest(float $P, float $C, float $r) : float { @@ -618,7 +581,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getContinuousCompounding(float $P, float $r, int $t) : float { @@ -635,7 +597,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPrincipalOfContinuousCompounding(float $C, float $r, int $t) : float { @@ -652,7 +613,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodsOfContinuousCompounding(float $P, float $C, float $r) : float { @@ -669,7 +629,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRateOfContinuousCompounding(float $P, float $C, float $t) : float { @@ -685,9 +644,8 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function getCurrentRaio(float $assets, float $liabilities) : float + public static function getCurrentRatio(float $assets, float $liabilities) : float { return $assets / $liabilities; } @@ -700,7 +658,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDaysInInventory(float $inventory) : float { @@ -716,7 +673,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDebtCoverageRatio(float $income, float $service) : float { @@ -732,7 +688,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDebtRatio(float $liabilities, float $assets) : float { @@ -748,7 +703,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDebtToEquityRatio(float $liabilities, float $equity) : float { @@ -764,7 +718,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDebtToIncomeRatio(float $payments, float $income) : float { @@ -781,7 +734,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDiscountedPaybackPeriod(float $CF, float $O1, float $r) : float { @@ -796,7 +748,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDoublingTime(float $r) : float { @@ -811,7 +762,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDoublingTimeContinuousCompounding(float $r) : float { @@ -828,7 +778,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getEquivalentAnnualAnnuity(float $NPV, float $r, int $n) : float { @@ -845,7 +794,6 @@ class FinanceFormulas * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPeriodsOfEAA(float $C, float $NPV, float $r) : int { @@ -862,7 +810,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNetPresentValueOfEAA(float $C, float $r, int $n) : float { @@ -881,7 +828,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFreeCashFlowToEquity(float $income, float $depamo, float $capital, float $wc, float $borrowing) : float { @@ -900,7 +846,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFreeCashFlowToFirm(float $ebit, float $t, float $depamo, float $capital, float $wc) : float { @@ -917,7 +862,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFutureValue(float $C, float $r, int $n) : float { @@ -934,7 +878,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFutureValueContinuousCompounding(float $PV, float $r, int $t) : float { @@ -950,7 +893,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFutureValueFactor(float $r, int $n) : float { @@ -965,7 +907,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getGeometricMeanReturn(array $r) : float { @@ -983,7 +924,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getGrowingAnnuityFV(float $P, float $r, float $g, int $n) : float { @@ -1001,7 +941,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getGrowingAnnuityPaymentPV(float $PV, float $r, float $g, int $n) : float { @@ -1019,7 +958,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getGrowingAnnuityPaymentFV(float $FV, float $r, float $g, int $n) : float { @@ -1037,7 +975,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getGrowingAnnuityPV(float $P, float $r, float $g, int $n) : float { @@ -1054,7 +991,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getGrowingPerpetuityPV(float $D, float $r, float $g) : float { @@ -1070,7 +1006,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getInterestCoverageRatio(float $ebit, float $expense) : float { @@ -1086,7 +1021,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getInventoryTurnoverRatio(float $sales, float $inventory) : float { @@ -1101,17 +1035,16 @@ class FinanceFormulas * * @return float * - * @throws \Exception + * @throws InvalidDimensionException Throws this exception if the length of the array is 0 * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNetPresentValue(array $C, float $r) : float { $count = count($C); if ($count === 0) { - throw new \Exception('Dimension'); + throw new InvalidDimensionException($count); } $npv = -$C[0]; @@ -1132,7 +1065,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNetProfitMargin(float $income, float $sales) : float { @@ -1148,7 +1080,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNetWorkingCapital(float $assets, float $liabilities) : float { @@ -1165,7 +1096,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNumberOfPeriodsPVFV(float $FV, float $PV, float $r) : float { @@ -1181,7 +1111,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPaybackPeriod(float $investment, float $cash) : float { @@ -1197,7 +1126,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueOfPerpetuity(float $D, float $r) : float { @@ -1214,7 +1142,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValue(float $C, float $r, int $n) : float { @@ -1231,7 +1158,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueContinuousCompounding(float $C, float $r, int $t) : float { @@ -1247,7 +1173,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueFactor(float $r, int $n) : float { @@ -1263,7 +1188,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getQuickRatio(float $assets, float $liabilities) : float { @@ -1279,7 +1203,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRateOfOnflation(float $oldCPI, float $newCPI) : float { @@ -1295,7 +1218,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRealRateOfReturn(float $nominal, float $inflation) : float { @@ -1311,7 +1233,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getReceivablesTurnoverRatio(float $sales, float $receivable) : float { @@ -1327,7 +1248,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRetentionRatio(float $income, float $dividends) : float { @@ -1343,7 +1263,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getReturnOnAssets(float $income, float $assets) : float { @@ -1359,7 +1278,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getReturnOnEquity(float $income, float $equity) : float { @@ -1375,7 +1293,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getReturnOnInvestment(float $earnings, float $investment) : float { @@ -1392,7 +1309,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSimpleInterest(float $P, float $r, int $t) : float { @@ -1408,7 +1324,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRelativeMarketShareByShare(float $ownShare, float $competitorShare) : float { @@ -1424,7 +1339,6 @@ class FinanceFormulas * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRelativeMarketShareBySales(float $ownSales, float $competitorSales) : float { diff --git a/Math/Finance/Forecasting/AR.php b/Business/Finance/Forecasting/AR.php similarity index 64% rename from Math/Finance/Forecasting/AR.php rename to Business/Finance/Forecasting/AR.php index 8cb30e691..33a693b69 100644 --- a/Math/Finance/Forecasting/AR.php +++ b/Business/Finance/Forecasting/AR.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class AR { diff --git a/Math/Finance/Forecasting/ARCH.php b/Business/Finance/Forecasting/ARCH.php similarity index 64% rename from Math/Finance/Forecasting/ARCH.php rename to Business/Finance/Forecasting/ARCH.php index 82410b2d4..4c9edf6f6 100644 --- a/Math/Finance/Forecasting/ARCH.php +++ b/Business/Finance/Forecasting/ARCH.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class ARCH { diff --git a/Math/Finance/Forecasting/ARFIMA.php b/Business/Finance/Forecasting/ARFIMA.php similarity index 64% rename from Math/Finance/Forecasting/ARFIMA.php rename to Business/Finance/Forecasting/ARFIMA.php index 37388a478..0b674419e 100644 --- a/Math/Finance/Forecasting/ARFIMA.php +++ b/Business/Finance/Forecasting/ARFIMA.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class ARFIMA { diff --git a/Math/Finance/Forecasting/ARIMA.php b/Business/Finance/Forecasting/ARIMA.php similarity index 97% rename from Math/Finance/Forecasting/ARIMA.php rename to Business/Finance/Forecasting/ARIMA.php index 463e271de..06155e65e 100644 --- a/Math/Finance/Forecasting/ARIMA.php +++ b/Business/Finance/Forecasting/ARIMA.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; use phpOMS\Math\Statistic\Average; diff --git a/Math/Finance/Forecasting/ARMA.php b/Business/Finance/Forecasting/ARMA.php similarity index 64% rename from Math/Finance/Forecasting/ARMA.php rename to Business/Finance/Forecasting/ARMA.php index bf2fe0d34..69c6d0b5b 100644 --- a/Math/Finance/Forecasting/ARMA.php +++ b/Business/Finance/Forecasting/ARMA.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class ARMA { diff --git a/Math/Finance/Forecasting/ClassicalDecomposition.php b/Business/Finance/Forecasting/ClassicalDecomposition.php similarity index 91% rename from Math/Finance/Forecasting/ClassicalDecomposition.php rename to Business/Finance/Forecasting/ClassicalDecomposition.php index a6cfd8d5e..b45aaa8c9 100644 --- a/Math/Finance/Forecasting/ClassicalDecomposition.php +++ b/Business/Finance/Forecasting/ClassicalDecomposition.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance\Forecasting; +namespace phpOMS\Business\Finance\Forecasting; use phpOMS\Math\Statistic\Average; @@ -26,8 +24,6 @@ use phpOMS\Math\Statistic\Average; * * @category Framework * @package phpOMS\Math\Finance\Forecasting - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @see https://www.otexts.org/fpp/6/1 @@ -91,7 +87,6 @@ class ClassicalDecomposition * @param int $mode Decomposition mode * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(array $data, int $order, int $mode = self::ADDITIVE) { @@ -108,7 +103,6 @@ class ClassicalDecomposition * @return array Returns an array containing the trend cycle component, detrended series, seasonal component and remainder component. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDecomposition() : array { @@ -134,7 +128,6 @@ class ClassicalDecomposition * @return array Total moving average 2 x m-MA * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function computeTrendCycle(array $data, int $order) : array { @@ -153,7 +146,6 @@ class ClassicalDecomposition * @return array Detrended series / seasonal normalized data * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function computeDetrendedSeries(array $data, array $trendCycleComponent, int $mode) : array { @@ -179,7 +171,6 @@ class ClassicalDecomposition * @return int New data start index * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getStartOfDecomposition(int $dataSize, int $trendCycleComponents) : int { @@ -197,7 +188,6 @@ class ClassicalDecomposition * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function computeSeasonalComponent(array $detrendedSeries, int $order) : array { @@ -228,7 +218,6 @@ class ClassicalDecomposition * @return array All remainders or absolute errors * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function computeRemainderComponent(array $data, array $trendCycleComponent, array $seasonalComponent, int $mode = self::ADDITIVE) : array { diff --git a/Business/Finance/Forecasting/ExponentialSmoothing/ExponentialSmoothing.php b/Business/Finance/Forecasting/ExponentialSmoothing/ExponentialSmoothing.php new file mode 100644 index 000000000..e44c60955 --- /dev/null +++ b/Business/Finance/Forecasting/ExponentialSmoothing/ExponentialSmoothing.php @@ -0,0 +1,622 @@ +data = $data; + } + + public function getRMSE() : float + { + return $this->rmse; + } + + public function getMSE() : float + { + return $this->mse; + } + + public function getMAE() : float + { + return $this->mae; + } + + public function getSSE() : float + { + return $this->sse; + } + + public function getErrors() : array + { + return $this->errors; + } + + public function getForecast(int $future, int $trendType = TrendType::NONE, int $seasonalType = SeasonalType::NONE, int $cycle = 12, float $damping = 1) : array + { + $this->rmse = PHP_INT_MAX; + + if($trendType === TrendType::ALL || $seasonalType === SeasonalType::ALL) { + $trends = [$trendType]; + if($trendType === TrendType::ALL) { + $trends = [TrendType::NONE, TrendType::ADDITIVE, TrendType::MULTIPLICATIVE]; + } + + $seasonals = [$seasonalType]; + if($seasonalType === SeasonalType::ALL) { + $seasonals = [SeasonalType::NONE, SeasonalType::ADDITIVE, SeasonalType::MULTIPLICATIVE]; + } + + $forecast = []; + $bestError = PHP_INT_MAX; + foreach($trends as $trend) { + foreach($seasonals as $seasonal) { + $tempForecast = $this->getForecast($future, $trend, $seasonal, $cycle, $damping); + + if ($this->rmse < $bestError) { + $bestError = $this->rmse; + $forecast = $tempForecast; + } + } + } + + return $forecast; + } elseif($trendType === TrendType::NONE && $seasonalType === SeasonalType::NONE) { + return $this->getNoneNone($future); + } elseif($trendType === TrendType::NONE && $seasonalType === SeasonalType::ADDITIVE) { + return $this->getNoneAdditive($future, $cycle); + } elseif($trendType === TrendType::NONE && $seasonalType === SeasonalType::MULTIPLICATIVE) { + return $this->getNoneMultiplicative($future, $cycle); + } elseif($trendType === TrendType::ADDITIVE && $seasonalType === SeasonalType::NONE) { + return $this->getAdditiveNone($future, $damping); + } elseif($trendType === TrendType::ADDITIVE && $seasonalType === SeasonalType::ADDITIVE) { + return $this->getAdditiveAdditive($future, $cycle, $damping); + } elseif($trendType === TrendType::ADDITIVE && $seasonalType === SeasonalType::MULTIPLICATIVE) { + return $this->getAdditiveMultiplicative($future, $cycle, $damping); + } elseif($trendType === TrendType::MULTIPLICATIVE && $seasonalType === SeasonalType::NONE) { + return $this->getMultiplicativeNone($future, $damping); + } elseif($trendType === TrendType::MULTIPLICATIVE && $seasonalType === SeasonalType::ADDITIVE) { + return $this->getMultiplicativeAdditive($future, $cycle, $damping); + } elseif($trendType === TrendType::MULTIPLICATIVE && $seasonalType === SeasonalType::MULTIPLICATIVE) { + return $this->getMultiplicativeMultiplicative($future, $cycle, $damping); + } + + throw new \Exception(); + } + + private function dampingSum(float $damping, int $length) : float + { + if(abs($damping - 1) < 0.001) { + return $length; + } + + $sum = 0; + for($i = 0; $i < $length; $i++) { + $sum += pow($damping, $i); + } + + return $sum; + } + + public function getNoneNone(int $future) : array + { + $level = [$this->data[0]]; + $dataLength = count($this->data) + $future; + $forecast = []; + + $alpha = 0.00; + while ($alpha < 1) { + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * $level[$i-1]; + + $tempForecast[$i] = $level[$i]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getNoneAdditive(int $future, int $cycle) : array + { + $level = [$this->data[0]]; + $dataLength = count($this->data) + $future; + $forecast = []; + $seasonal = []; + + for($i = 1; $i < $cycle+1; $i++) { + $seasonal[$i] = $this->data[$i-1] - $level[0]; + } + + $alpha = 0.00; + while ($alpha < 1) { + $gamma = 0.00; + + while($gamma < 1) { + $gamma_ = $gamma * (1 - $alpha); + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $hm = (int) floor(($i-1) % $cycle) + 1; + + $level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * $level[$i-1]; + $seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $level[$i-1]) + (1 - $gamma_) * $seasonal[$i]; + + $tempForecast[$i] = $level[$i] + $seasonal[$i+$hm]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $gamma += 0.01; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getNoneMultiplicative(int $future, int $cycle) : array + { + $level = [$this->data[0]]; + $dataLength = count($this->data) + $future; + $forecast = []; + $seasonal = []; + + for($i = 1; $i < $cycle+1; $i++) { + $seasonal[$i] = $this->data[$i] / $level[0]; + } + + $alpha = 0.00; + while ($alpha < 1) { + $gamma = 0.00; + + while($gamma < 1) { + $gamma_ = $gamma * (1 - $alpha); + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $hm = (int) floor(($i-1) % $cycle) + 1; + + $level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * $level[$i-1]; + $seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $level[$i-1]) + (1 - $gamma_) * $seasonal[$i]; + + $tempForecast[$i] = $level[$i] + $seasonal[$i+$hm]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $gamma += 0.01; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getAdditiveNone(int $future, float $damping) : array + { + $level = [$this->data[0]]; + $trend = [$this->data[1] - $this->data[0]]; + $dataLength = count($this->data) + $future; + $forecast = []; + + $alpha = 0.00; + while ($alpha < 1) { + $beta = 0.00; + + while($beta < 1) { + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]); + $trend[$i] = $beta * ($level[$i] - $level[$i-1]) + (1 - $beta) * $damping * $trend[$i-1]; + + $tempForecast[$i] = $level[$i] + $this->dampingSum($damping, $i) * $trend[$i]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $beta += 0.01; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getAdditiveAdditive(int $future, int $cycle, float $damping) : array + { + $level = [1 / $cycle * array_sum(array_slice($this->data, 0, $cycle))]; + $trend = [1 / $cycle]; + $dataLength = count($this->data) + $future; + $forecast = []; + $seasonal = []; + + $sum = 0; + for($i = 1; $i < $cycle+1; $i++) { + $sum += ($this->data[$cycle] - $this->data[$i]) / $cycle; + } + + $trend[0] *= $sum; + + for($i = 1; $i < $cycle+1; $i++) { + $seasonal[$i] = $this->data[$i-1] - $level[0]; + } + + $alpha = 0.00; + while ($alpha < 1) { + $beta = 0.00; + + while($beta < 1) { + $gamma = 0.00; + + while($gamma < 1) { + $gamma_ = $gamma * (1 - $alpha); + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $hm = (int) floor(($i-1) % $cycle) + 1; + + $level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]); + $trend[$i] = $beta * ($level[$i] - $level[$i-1]) + (1 - $beta) * $damping * $trend[$i-1]; + $seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $level[$i-1]) + (1 - $gamma_) * $seasonal[$i]; + + $tempForecast[$i] = $level[$i] + $this->dampingSum($damping, $i) * $trend[$i] + $seasonal[$i+$hm]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $gamma += 0.01; + } + + $beta += 0.01; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getAdditiveMultiplicative(int $future, int $cycle, float $damping) : array + { + $level = [1 / $cycle * array_sum(array_slice($this->data, 0, $cycle))]; + $trend = [1 / $cycle]; + $dataLength = count($this->data) + $future; + $forecast = []; + $seasonal = []; + $gamma_ = $gamma * (1 - $alpha); + + $sum = 0; + for($i = 1; $i < $cycle+1; $i++) { + $sum += ($this->data[$cycle] - $this->data[$i]) / $cycle; + } + + $trend[0] *= $sum; + + for($i = 1; $i < $cycle+1; $i++) { + $seasonal[$i] = $this->data[$i] / $level[0]; + } + + $alpha = 0.00; + while ($alpha < 1) { + $beta = 0.00; + + while($beta < 1) { + $gamma = 0.00; + + while($gamma < 1) { + $gamma_ = $gamma * (1 - $alpha); + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $hm = (int) floor(($i-1) % $cycle) + 1; + + $level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]); + $trend[$i] = $beta * ($level[$i] - $level[$i-1]) + (1 - $beta) * $damping * $trend[$i-1]; + $seasonal[$i+$cycle] = $gamma_*($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / ($level[$i-1] + $damping * $trend[$i-1]) + (1 - $gamma_) * $seasonal[$i]; + + $tempForecast[] = ($level[$i] + $this->dampingSum($damping, $i) * $trend[$i-1]) * $seasonal[$i+$hm]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $gamma += 0.01; + } + + $beta += 0.01; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getMultiplicativeNone(int $future, float $damping) : array + { + $level = [$this->data[0]]; + $trend = [$this->data[1] / $this->data[0]]; + $dataLength = count($this->data) + $future; + $forecast = []; + + $alpha = 0.00; + while ($alpha < 1) { + $beta = 0.00; + + while($beta < 1) { + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping); + $trend[$i] = $beta * ($level[$i] / $level[$i-1]) + (1 - $beta) * pow($trend[$i-1], $damping); + + $tempForecast[$i] = $level[$i] * pow($trend[$i], $this->dampingSum($damping, $i)); + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $beta += 0.01; + } + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getMultiplicativeAdditive(int $future, int $cycle, float $damping) : array + { + $level = [$this->data[0]]; + $trend = [1 / $cycle]; + $dataLength = count($this->data) + $future; + $forecast = []; + $seasonal = []; + + $sum = 0; + for($i = 1; $i < $cycle+1; $i++) { + $sum += ($this->data[$cycle] - $this->data[$i]) / $cycle; + } + + $trend[0] *= $sum; + + for($i = 1; $i < $cycle+1; $i++) { + $seasonal[$i] = $this->data[$i-1] - $level[0]; + } + + $alpha = 0.00; + while ($alpha < 1) { + $beta = 0.00; + + while($beta < 1) { + $gamma = 0.00; + + while($gamma < 1) { + $gamma_ = $gamma * (1 - $alpha); + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $hm = (int) floor(($i-1) % $cycle) + 1; + + $level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping); + $trend[$i] = $beta * ($level[$i] / $level[$i-1]) + (1 - $beta) * pow($trend[$i-1], $damping); + $seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $level[$i-1] * pow($trend[$i-1], $damping)) + (1 - $gamma_) * $seasonal[$i]; + + $tempForecast[$i] = $level[$i] * pow($trend[$i], $this->dampingSum($damping, $i)) + $seasonal[$i+$hm]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $gamma += 0.01; + } + + $beta += 0.01; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + + public function getMultiplicativeMultiplicative(int $future, int $cycle, float $damping) : array + { + $level = [$this->data[0]]; + $trend = [1 / $cycle]; + $dataLength = count($this->data) + $future; + $forecast = []; + $seasonal = []; + + $sum = 0; + for($i = 1; $i < $cycle+1; $i++) { + $sum += ($this->data[$cycle] - $this->data[$i]) / $cycle; + } + + $trend[0] *= $sum; + + for($i = 1; $i < $cycle+1; $i++) { + $seasonal[$i] = $this->data[$i] / $level[0]; + } + + $alpha = 0.00; + while ($alpha < 1) { + $beta = 0.00; + + while($beta < 1) { + $gamma = 0.00; + + while($gamma < 1) { + $gamma_ = $gamma * (1 - $alpha); + $error = []; + $tempForecast = []; + + for($i = 1; $i < $dataLength; $i++) { + $hm = (int) floor(($i-1) % $cycle) + 1; + + $level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping); + $trend[$i] = $beta * ($level[$i] / $level[$i-1]) + (1 - $beta) * pow($trend[$i-1], $damping); + $seasonal[$i+$cycle] = $gamma_*($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / ($level[$i-1] * pow($trend[$i-1], $damping)) + (1 - $gamma_) * $seasonal[$i]; + + $tempForecast[$i] = $level[$i] * pow($trend[$i], $this->dampingSum($damping, $i)) * $seasonal[$i+$hm]; + $error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0; + } + + $tempRMSE = Error::getRootMeanSquaredError($error); + + if ($tempRMSE < $this->rmse) { + $this->rmse = $tempRMSE; + $forecast = $tempForecast; + } + + $gamma += 0.01; + } + + $beta += 0.01; + } + + $alpha += 0.01; + } + + $this->errors = $error; + $this->mse = Error::getMeanSquaredError($error); + $this->mae = Error::getMeanAbsoulteError($error); + $this->sse = Error::getSumSquaredError($error); + + return $forecast; + } + +} \ No newline at end of file diff --git a/Math/Finance/Forecasting/ExponentialSmoothing/SeasonalType.php b/Business/Finance/Forecasting/ExponentialSmoothing/SeasonalType.php similarity index 67% rename from Math/Finance/Forecasting/ExponentialSmoothing/SeasonalType.php rename to Business/Finance/Forecasting/ExponentialSmoothing/SeasonalType.php index 2df7c5f98..22c8bd549 100644 --- a/Math/Finance/Forecasting/ExponentialSmoothing/SeasonalType.php +++ b/Business/Finance/Forecasting/ExponentialSmoothing/SeasonalType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance\Forecasting\ExponentialSmoothing; +namespace phpOMS\Business\Finance\Forecasting\ExponentialSmoothing; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Smoothing enum. * * @category Framework * @package phpOMS\Html - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Finance/Forecasting/ExponentialSmoothing/TrendType.php b/Business/Finance/Forecasting/ExponentialSmoothing/TrendType.php similarity index 67% rename from Math/Finance/Forecasting/ExponentialSmoothing/TrendType.php rename to Business/Finance/Forecasting/ExponentialSmoothing/TrendType.php index 37fa2a1de..72413e498 100644 --- a/Math/Finance/Forecasting/ExponentialSmoothing/TrendType.php +++ b/Business/Finance/Forecasting/ExponentialSmoothing/TrendType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance\Forecasting\ExponentialSmoothing; +namespace phpOMS\Business\Finance\Forecasting\ExponentialSmoothing; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Smoothing enum. * * @category Framework * @package phpOMS\Html - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Finance/Forecasting/GARCH.php b/Business/Finance/Forecasting/GARCH.php similarity index 64% rename from Math/Finance/Forecasting/GARCH.php rename to Business/Finance/Forecasting/GARCH.php index 0326e1f45..07a3654b0 100644 --- a/Math/Finance/Forecasting/GARCH.php +++ b/Business/Finance/Forecasting/GARCH.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class GARCH { diff --git a/Math/Finance/Forecasting/MA.php b/Business/Finance/Forecasting/MA.php similarity index 64% rename from Math/Finance/Forecasting/MA.php rename to Business/Finance/Forecasting/MA.php index 5ef2850dd..4ec6a3103 100644 --- a/Math/Finance/Forecasting/MA.php +++ b/Business/Finance/Forecasting/MA.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class MA { diff --git a/Math/Finance/Forecasting/NAR.php b/Business/Finance/Forecasting/NAR.php similarity index 64% rename from Math/Finance/Forecasting/NAR.php rename to Business/Finance/Forecasting/NAR.php index 125215468..7f499cfa7 100644 --- a/Math/Finance/Forecasting/NAR.php +++ b/Business/Finance/Forecasting/NAR.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class NAR { diff --git a/Math/Finance/Forecasting/NMA.php b/Business/Finance/Forecasting/NMA.php similarity index 64% rename from Math/Finance/Forecasting/NMA.php rename to Business/Finance/Forecasting/NMA.php index 0334228fe..c8a67b716 100644 --- a/Math/Finance/Forecasting/NMA.php +++ b/Business/Finance/Forecasting/NMA.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class NMA { diff --git a/Math/Finance/Forecasting/SARIMA.php b/Business/Finance/Forecasting/SARIMA.php similarity index 64% rename from Math/Finance/Forecasting/SARIMA.php rename to Business/Finance/Forecasting/SARIMA.php index d14e57d54..53573e3c3 100644 --- a/Math/Finance/Forecasting/SARIMA.php +++ b/Business/Finance/Forecasting/SARIMA.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Finance\Forecasting; + namespace phpOMS\Business\Finance\Forecasting; class SARIMA { diff --git a/Math/Finance/Forecasting/SmoothingType.php b/Business/Finance/Forecasting/SmoothingType.php similarity index 65% rename from Math/Finance/Forecasting/SmoothingType.php rename to Business/Finance/Forecasting/SmoothingType.php index e4ab70cc7..d14f75f2d 100644 --- a/Math/Finance/Forecasting/SmoothingType.php +++ b/Business/Finance/Forecasting/SmoothingType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance\Forecasting; +namespace phpOMS\Business\Finance\Forecasting; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Smoothing enum. * * @category Framework * @package phpOMS\Html - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Finance/Loan.php b/Business/Finance/Loan.php similarity index 87% rename from Math/Finance/Loan.php rename to Business/Finance/Loan.php index b6953dfdf..2938a44c5 100644 --- a/Math/Finance/Loan.php +++ b/Business/Finance/Loan.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance; +namespace phpOMS\Business\Finance; /** * Finance class. * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class Loan * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPaymentsOnBalloonLoan(float $PV, float $r, int $n, float $balloon = 0) : float { @@ -59,7 +54,6 @@ class Loan * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getBalloonBalanceOfLoan(float $PV, float $P, float $r, int $n) : float { @@ -76,7 +70,6 @@ class Loan * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getLoanPayment(float $PV, float $r, int $n) : float { @@ -94,7 +87,6 @@ class Loan * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRemainingBalanceLoan(float $PV, float $P, float $r, int $n) : float { @@ -110,7 +102,6 @@ class Loan * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getLoanToDepositRatio(float $loans, float $deposits) : float { @@ -126,7 +117,6 @@ class Loan * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getLoanToValueRatio(float $loan, float $collateral) : float { diff --git a/Math/Finance/Lorenzkurve.php b/Business/Finance/Lorenzkurve.php similarity index 63% rename from Math/Finance/Lorenzkurve.php rename to Business/Finance/Lorenzkurve.php index 7684c0001..fb1b15a56 100644 --- a/Math/Finance/Lorenzkurve.php +++ b/Business/Finance/Lorenzkurve.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,22 +13,29 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance; +namespace phpOMS\Business\Finance; /** * Finance class. * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ class Lorenzkurve { - public static function getGiniCoefficient(array $data) + /** + * Calculate Gini coefficient + * + * @param array $data Datapoints (can be unsorted) + * + * @return float + * + * @since 1.0.0 + */ + public static function getGiniCoefficient(array $data) : float { $sum1 = 0; $sum2 = 0; @@ -40,9 +45,9 @@ class Lorenzkurve sort($data); foreach ($data as $key => $value) { - $sum1 += $i * $value; - $sum2 += $value; - $i++; + $sum1 += $i * $value; + $sum2 += $value; + $i++; } return 2 * $sum1 / ($n * $sum2) - ($n + 1) / $n; diff --git a/Math/Finance/StockBonds.php b/Business/Finance/StockBonds.php similarity index 90% rename from Math/Finance/StockBonds.php rename to Business/Finance/StockBonds.php index a854cf206..cae66824c 100644 --- a/Math/Finance/StockBonds.php +++ b/Business/Finance/StockBonds.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance; +namespace phpOMS\Business\Finance; /** * Finance class. * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getBondEquivalentYield(float $fv, float $price, int $days) : float { @@ -56,7 +51,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getBookValuePerShare(float $total, int $common) : float { @@ -73,7 +67,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExpectedReturnCAPM(float $rf, float $beta, float $r) : float { @@ -89,7 +82,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCapitalGainsYield(float $P0, float $P1) : float { @@ -105,7 +97,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCurrentYield(float $coupons, float $price) : float { @@ -122,7 +113,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDilutedEarningsPerShare(float $income, float $avg, float $other) : float { @@ -138,7 +128,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDividendPayoutRatio(float $dividends, float $income) : float { @@ -154,7 +143,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDividendYield(float $dividends, float $price) : float { @@ -170,7 +158,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDividendsPerShare(float $dividends, int $shares) : float { @@ -186,7 +173,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getEarningsPerShare(float $income, float $shares) : float { @@ -202,7 +188,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getEquityMultiplier(float $assets, float $equity) : float { @@ -217,7 +202,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getHoldingPeriodReturn(array $r) : float { @@ -240,7 +224,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNetAssetValue(float $assets, float $liabilities, int $shares) : float { @@ -256,7 +239,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPriceToBookValue(float $market, float $book) : float { @@ -272,7 +254,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPriceEarningsRatio(float $price, float $earnings) : float { @@ -288,7 +269,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPriceToSalesRatio(float $price, float $sales) : float { @@ -305,7 +285,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPresentValueOfStockConstantGrowth(float $dividend, float $r, float $g = 0.0) : float { @@ -321,7 +300,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getTaxEquivalentYield(float $free, float $tax) : float { @@ -338,7 +316,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getTotalStockReturn(float $P0, float $P1, float $D) : float { @@ -356,7 +333,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getYieldToMaturity(float $C, float $F, float $P, int $n) : float { @@ -373,7 +349,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getZeroCouponBondValue(float $F, float $r, int $t) : float { @@ -390,7 +365,6 @@ class StockBonds * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getZeroCouponBondEffectiveYield(float $F, float $PV, int $n) : float { diff --git a/Business/Marketing/Metrics.php b/Business/Marketing/Metrics.php new file mode 100644 index 000000000..41f7872ae --- /dev/null +++ b/Business/Marketing/Metrics.php @@ -0,0 +1,43 @@ + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Business\Marketing; * * @category Framework * @package phpOMS\Business - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class NetPromoterScore { * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -55,7 +50,6 @@ class NetPromoterScore { * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(int $score) /* : void */ { @@ -68,7 +62,6 @@ class NetPromoterScore { * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getScore() : int { @@ -91,6 +84,15 @@ class NetPromoterScore { return $total === 0 ? 0 : ((int) ($promoters * 100 / $total)) - ((int) ($detractors * 100 / $total)); } + /** + * Count detractors + * + * Detractors are all ratings below 7. + * + * @return int + * + * @since 1.0.0 + */ public function countDetractors() : int { $count = 0; @@ -103,6 +105,15 @@ class NetPromoterScore { return $count; } + /** + * Count passives + * + * Passives are all ratings between 7 and 8 (inclusive) + * + * @return int + * + * @since 1.0.0 + */ public function countPassives() : int { $count = 0; @@ -115,6 +126,15 @@ class NetPromoterScore { return $count; } + /** + * Count promoters + * + * Promotoers are all ratings larger 8 + * + * @return int + * + * @since 1.0.0 + */ public function countPromoters() : int { $count = 0; diff --git a/Business/Programming/Metrics.php b/Business/Programming/Metrics.php new file mode 100644 index 000000000..fd461d7b4 --- /dev/null +++ b/Business/Programming/Metrics.php @@ -0,0 +1,43 @@ + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Config; * * @category Framework * @package phpOMS\Config - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ interface OptionsInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function exists($key); @@ -53,7 +48,6 @@ interface OptionsInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setOption($key, $value, bool $overwrite = true) : bool; @@ -66,7 +60,6 @@ interface OptionsInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setOptions(array $pair, bool $overwrite = true) : bool; @@ -78,7 +71,6 @@ interface OptionsInterface * @return mixed Option value * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getOption($key); diff --git a/Config/OptionsTrait.php b/Config/OptionsTrait.php index f998e6a40..1bf3b2d5c 100644 --- a/Config/OptionsTrait.php +++ b/Config/OptionsTrait.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Config/SettingsAbstract.php b/Config/SettingsAbstract.php index c3d238f8a..aa65eb9ca 100644 --- a/Config/SettingsAbstract.php +++ b/Config/SettingsAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -28,8 +26,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\Config - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -88,7 +84,6 @@ abstract class SettingsAbstract implements OptionsInterface * @return mixed Option value * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get($columns) { @@ -117,8 +112,10 @@ abstract class SettingsAbstract implements OptionsInterface return $options; } catch (\PDOException $e) { - // todo does it mean that the recognition isn't here but at the place where the new happens? - throw DatabaseExceptionFactory::create($e); + $exception = DatabaseExceptionFactory::createException($e); + $message = DatabaseExceptionFactory::createExceptionMessage($e); + + throw new $exception($message); } } @@ -131,7 +128,6 @@ abstract class SettingsAbstract implements OptionsInterface * @return mixed Option value * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(array $options, bool $store = false) /* : void */ { diff --git a/Console/CommandManager.php b/Console/CommandManager.php index f943e5d0e..f15e8d25f 100644 --- a/Console/CommandManager.php +++ b/Console/CommandManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -49,7 +47,6 @@ class CommandManager implements \Countable * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -66,7 +63,6 @@ class CommandManager implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function attach(string $cmd, $callback, $source, bool $overwrite = true) : bool { @@ -89,7 +85,6 @@ class CommandManager implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function detach(string $cmd, $source) : bool { @@ -112,7 +107,6 @@ class CommandManager implements \Countable * @return mixed|bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function trigger(string $cmd, $para) { @@ -129,7 +123,6 @@ class CommandManager implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Contract/ArrayableInterface.php b/Contract/ArrayableInterface.php index 81019b9bd..cd978587d 100644 --- a/Contract/ArrayableInterface.php +++ b/Contract/ArrayableInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Contract; * * @category Framework * @package phpOMS\Contract - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ interface ArrayableInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function toArray() : array; diff --git a/Contract/RenderableInterface.php b/Contract/RenderableInterface.php index 27c78e012..dcb9917e6 100644 --- a/Contract/RenderableInterface.php +++ b/Contract/RenderableInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ namespace phpOMS\Contract; * * @category Framework * @package phpOMS\Contract - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ interface RenderableInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function render() : string; diff --git a/DataStorage/Cache/CacheFactory.php b/DataStorage/Cache/CacheFactory.php index 79b8370ef..daa5ef4c4 100644 --- a/DataStorage/Cache/CacheFactory.php +++ b/DataStorage/Cache/CacheFactory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\DataStorage\Cache\FileCache; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class CacheFactory * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -57,7 +52,6 @@ class CacheFactory * @throws \InvalidArgumentException Throws this exception if the database is not supported. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function create(array $cacheData) : CacheInterface { diff --git a/DataStorage/Cache/CacheInterface.php b/DataStorage/Cache/CacheInterface.php index 2e8f3ada7..015c56123 100644 --- a/DataStorage/Cache/CacheInterface.php +++ b/DataStorage/Cache/CacheInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -16,15 +14,13 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Cache; -use phpOMS\Datatypes\Exception\InvalidEnumValue; +use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; /** * Cache interface. * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,7 +38,6 @@ interface CacheInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set($key, $value, int $expire = -1) /* : void */; @@ -56,7 +51,6 @@ interface CacheInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add($key, $value, int $expire = -1) : bool; @@ -69,7 +63,6 @@ interface CacheInterface * @return mixed Cache value * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get($key, int $expire = -1); @@ -82,7 +75,6 @@ interface CacheInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function delete($key, int $expire = -1) : bool; @@ -94,7 +86,6 @@ interface CacheInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function flush(int $expire = 0) : bool; @@ -104,7 +95,6 @@ interface CacheInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function flushAll() : bool; @@ -118,7 +108,6 @@ interface CacheInterface * @throws InvalidEnumValue * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStatus(int $status) /* : void */; @@ -132,7 +121,6 @@ interface CacheInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function replace($key, $value, int $expire = -1) : bool; @@ -142,7 +130,6 @@ interface CacheInterface * @return mixed[] Stats array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function stats() : array; @@ -152,7 +139,6 @@ interface CacheInterface * @return int Storage threshold * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getThreshold() : int; diff --git a/DataStorage/Cache/CachePool.php b/DataStorage/Cache/CachePool.php index 697c39a1f..8f5de89d0 100644 --- a/DataStorage/Cache/CachePool.php +++ b/DataStorage/Cache/CachePool.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -30,8 +28,6 @@ use phpOMS\DataStorage\Cache\CacheFactory; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -53,7 +49,6 @@ class CachePool implements OptionsInterface * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -68,7 +63,6 @@ class CachePool implements OptionsInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(string $key = 'core', CacheInterface $cache) : bool { @@ -89,7 +83,6 @@ class CachePool implements OptionsInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(string $key) : bool { @@ -110,7 +103,6 @@ class CachePool implements OptionsInterface * @return \phpOMS\DataStorage\Cache\CacheInterface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(string $key) /* : ?CacheInterface */ { @@ -130,7 +122,6 @@ class CachePool implements OptionsInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function create(string $key, array $config) : bool { diff --git a/DataStorage/Cache/CacheStatus.php b/DataStorage/Cache/CacheStatus.php index 77831d580..ffb58806c 100644 --- a/DataStorage/Cache/CacheStatus.php +++ b/DataStorage/Cache/CacheStatus.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Cache; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Cache status enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Cache/CacheType.php b/DataStorage/Cache/CacheType.php index 9b9b0b108..35b12ac41 100644 --- a/DataStorage/Cache/CacheType.php +++ b/DataStorage/Cache/CacheType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Cache; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Cache type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Cache/FileCache.php b/DataStorage/Cache/FileCache.php index cd5327ccf..ef9906889 100644 --- a/DataStorage/Cache/FileCache.php +++ b/DataStorage/Cache/FileCache.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Cache; -use phpOMS\Datatypes\Exception\InvalidEnumValue; +use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; use phpOMS\System\File\Local\Directory; use phpOMS\System\File\Local\File; @@ -28,8 +26,6 @@ use phpOMS\System\File\Local\File; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -83,7 +79,6 @@ class FileCache implements CacheInterface * @param string $path Cache path * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $path) { @@ -189,7 +184,6 @@ class FileCache implements CacheInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function build($value, int $expire) : string { @@ -207,7 +201,6 @@ class FileCache implements CacheInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ private function dataType($value) : int { @@ -241,7 +234,6 @@ class FileCache implements CacheInterface * @throws InvalidEnumValue * * @since 1.0.0 - * @author Dennis Eichhorn */ private function stringify($value, int $type) : string { @@ -266,7 +258,6 @@ class FileCache implements CacheInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ private function getExpire(string $raw) : int { diff --git a/DataStorage/Cache/MemCache.php b/DataStorage/Cache/MemCache.php index e2711505e..4314263af 100644 --- a/DataStorage/Cache/MemCache.php +++ b/DataStorage/Cache/MemCache.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Cache; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -51,7 +47,6 @@ class MemCache implements CacheInterface * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -66,7 +61,6 @@ class MemCache implements CacheInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addServer($data) { @@ -162,7 +156,6 @@ class MemCache implements CacheInterface * Destructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __destruct() { @@ -173,7 +166,6 @@ class MemCache implements CacheInterface * Closing cache. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function close() { diff --git a/DataStorage/Cache/NullCache.php b/DataStorage/Cache/NullCache.php index 816738c2f..95b3a07e6 100644 --- a/DataStorage/Cache/NullCache.php +++ b/DataStorage/Cache/NullCache.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Cache; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Cache/RedisCache.php b/DataStorage/Cache/RedisCache.php index 5f65376f5..586ec294e 100644 --- a/DataStorage/Cache/RedisCache.php +++ b/DataStorage/Cache/RedisCache.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\DataStorage\Cache; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Cache/WinCache.php b/DataStorage/Cache/WinCache.php index 010710b7e..cab734a1c 100644 --- a/DataStorage/Cache/WinCache.php +++ b/DataStorage/Cache/WinCache.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\DataStorage\Cache; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Cookie/CookieJar.php b/DataStorage/Cookie/CookieJar.php index ca2b170f9..4ee0e663b 100644 --- a/DataStorage/Cookie/CookieJar.php +++ b/DataStorage/Cookie/CookieJar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\DataStorage\LockException; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -51,7 +47,6 @@ class CookieJar * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -62,7 +57,6 @@ class CookieJar * Lock * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function lock() /* : void */ { @@ -75,7 +69,6 @@ class CookieJar * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isLocked() : bool { @@ -97,7 +90,6 @@ class CookieJar * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(string $id, $value, int $expire = 86400, string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, bool $overwrite = true) : bool { @@ -127,7 +119,6 @@ class CookieJar * @throws LockException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function delete(string $id) : bool { @@ -152,7 +143,6 @@ class CookieJar * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(string $id) : bool { @@ -173,7 +163,6 @@ class CookieJar * @throws LockException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function save() /* : void */ { diff --git a/DataStorage/DataMapperInterface.php b/DataStorage/DataMapperInterface.php index 21d9b2ec4..48aaf4925 100644 --- a/DataStorage/DataMapperInterface.php +++ b/DataStorage/DataMapperInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ interface DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function create($obj); @@ -55,7 +50,6 @@ interface DataMapperInterface * @return int Status * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function update($obj) : int; @@ -67,7 +61,6 @@ interface DataMapperInterface * @return int Status * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function delete($obj); @@ -79,7 +72,6 @@ interface DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function find(string $search) : array; @@ -91,7 +83,6 @@ interface DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function listResults(Builder $query); @@ -103,7 +94,6 @@ interface DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populate(array $result); @@ -115,7 +105,6 @@ interface DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populateIterable(array $result) : array; @@ -127,7 +116,6 @@ interface DataMapperInterface * @return $this * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function with(...$objects); @@ -139,7 +127,6 @@ interface DataMapperInterface * @return self * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function get($primaryKey); diff --git a/DataStorage/Database/BuilderAbstract.php b/DataStorage/Database/BuilderAbstract.php index 0647eeea2..87a8702bb 100644 --- a/DataStorage/Database/BuilderAbstract.php +++ b/DataStorage/Database/BuilderAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\Connection\ConnectionAbstract; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -72,7 +68,6 @@ abstract class BuilderAbstract * @return BuilderAbstract * * @since 1.0.0 - * @author Dennis Eichhorn */ public function prefix(string $prefix) : BuilderAbstract { @@ -87,7 +82,6 @@ abstract class BuilderAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPrefix() : string { @@ -100,7 +94,6 @@ abstract class BuilderAbstract * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getType() : int { diff --git a/DataStorage/Database/Connection/ConnectionAbstract.php b/DataStorage/Database/Connection/ConnectionAbstract.php index be7dc2f82..1a97a9a1d 100644 --- a/DataStorage/Database/Connection/ConnectionAbstract.php +++ b/DataStorage/Database/Connection/ConnectionAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -29,8 +27,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\Grammar as SchemaGrammar; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -120,7 +116,6 @@ abstract class ConnectionAbstract implements ConnectionInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPrefix() : string { @@ -157,7 +152,6 @@ abstract class ConnectionAbstract implements ConnectionInterface * Sets the database connection to null * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __destruct() { diff --git a/DataStorage/Database/Connection/ConnectionException.php b/DataStorage/Database/Connection/ConnectionException.php deleted file mode 100644 index 7a782a64b..000000000 --- a/DataStorage/Database/Connection/ConnectionException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - -namespace phpOMS\DataStorage\Database\Connection; - -abstract class ConnectionException extends \Exception -{ - -} \ No newline at end of file diff --git a/DataStorage/Database/Connection/ConnectionFactory.php b/DataStorage/Database/Connection/ConnectionFactory.php index b4698cd01..ffe361716 100644 --- a/DataStorage/Database/Connection/ConnectionFactory.php +++ b/DataStorage/Database/Connection/ConnectionFactory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\DatabaseType; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ class ConnectionFactory * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -55,7 +50,6 @@ class ConnectionFactory * @throws \InvalidArgumentException Throws this exception if the database is not supported. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function create(array $dbdata) : ConnectionInterface { diff --git a/DataStorage/Database/Connection/ConnectionInterface.php b/DataStorage/Database/Connection/ConnectionInterface.php index a6964f1a7..cd320bf30 100644 --- a/DataStorage/Database/Connection/ConnectionInterface.php +++ b/DataStorage/Database/Connection/ConnectionInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\Grammar as SchemaGrammar; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ interface ConnectionInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function connect(array $dbdata) /* : void */; @@ -54,7 +49,6 @@ interface ConnectionInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getType() : string; @@ -64,7 +58,6 @@ interface ConnectionInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStatus() : int; @@ -74,7 +67,6 @@ interface ConnectionInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function close() /* : void */; @@ -84,7 +76,6 @@ interface ConnectionInterface * @return Grammar * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getGrammar() : Grammar; @@ -94,7 +85,6 @@ interface ConnectionInterface * @return SchemaGrammar * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSchemaGrammar() : SchemaGrammar; diff --git a/DataStorage/Database/Connection/MysqlConnection.php b/DataStorage/Database/Connection/MysqlConnection.php index f91021701..ad739724b 100644 --- a/DataStorage/Database/Connection/MysqlConnection.php +++ b/DataStorage/Database/Connection/MysqlConnection.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -21,6 +19,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus; use phpOMS\DataStorage\Database\DatabaseType; use phpOMS\DataStorage\Database\Query\Grammar\MysqlGrammar; use phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar as MysqlSchemaGrammar; +use phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException; /** * Database handler. @@ -30,8 +29,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar as MysqlSchemaGramma * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -47,7 +44,6 @@ class MysqlConnection extends ConnectionAbstract * @param string[] $dbdata the basic database information for establishing a connection * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(array $dbdata) { @@ -65,27 +61,27 @@ class MysqlConnection extends ConnectionAbstract $this->dbdata = isset($dbdata) ? $dbdata : $this->dbdata; if(!isset($this->dbdata['db'])) { - throw new \Exception('db'); + throw new InvalidConnectionConfigException('db'); } if(!isset($this->dbdata['host'])) { - throw new \Exception('host'); + throw new InvalidConnectionConfigException('host'); } if(!isset($this->dbdata['port'])) { - throw new \Exception('port'); + throw new InvalidConnectionConfigException('port'); } if(!isset($this->dbdata['database'])) { - throw new \Exception('database'); + throw new InvalidConnectionConfigException('database'); } if(!isset($this->dbdata['login'])) { - throw new \Exception('login'); + throw new InvalidConnectionConfigException('login'); } if(!isset($this->dbdata['password'])) { - throw new \Exception('password'); + throw new InvalidConnectionConfigException('password'); } $this->close(); diff --git a/DataStorage/Database/Connection/PostgresConnection.php b/DataStorage/Database/Connection/PostgresConnection.php index ab0f4e97b..60545b66f 100644 --- a/DataStorage/Database/Connection/PostgresConnection.php +++ b/DataStorage/Database/Connection/PostgresConnection.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/DataStorage/Database/Connection/SQLiteConnection.php b/DataStorage/Database/Connection/SQLiteConnection.php index d82566931..007ef2b6d 100644 --- a/DataStorage/Database/Connection/SQLiteConnection.php +++ b/DataStorage/Database/Connection/SQLiteConnection.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -29,8 +27,6 @@ use phpOMS\DataStorage\Database\Query\Grammar\SqliteGrammar; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class SqliteConnection extends ConnectionAbstract * @param string[] $dbdata the basic database information for establishing a connection * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(array $dbdata) { diff --git a/DataStorage/Database/Connection/SqlServerConnection.php b/DataStorage/Database/Connection/SqlServerConnection.php index 344a9fbe5..00bd23b30 100644 --- a/DataStorage/Database/Connection/SqlServerConnection.php +++ b/DataStorage/Database/Connection/SqlServerConnection.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -30,8 +28,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar as MysqlSchemaGramma * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class SqlServerConnection extends ConnectionAbstract * @param string[] $dbdata the basic database information for establishing a connection * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(array $dbdata) { diff --git a/DataStorage/Database/Connector/MysqlConnector.php b/DataStorage/Database/Connector/MysqlConnector.php deleted file mode 100644 index f04f0472c..000000000 --- a/DataStorage/Database/Connector/MysqlConnector.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - -namespace phpOMS\DataStorage\Database\Connector; - -abstract class MysqlConnector extends \Exception -{ - -} \ No newline at end of file diff --git a/DataStorage/Database/Connector/PostgresConnector.php b/DataStorage/Database/Connector/PostgresConnector.php deleted file mode 100644 index 1368ea641..000000000 --- a/DataStorage/Database/Connector/PostgresConnector.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - -namespace phpOMS\DataStorage\Database\Connector; - -abstract class PostgresConnector extends \Exception -{ - -} \ No newline at end of file diff --git a/DataStorage/Database/Connector/SQLiteConnector.php b/DataStorage/Database/Connector/SQLiteConnector.php deleted file mode 100644 index 9ed1ffef9..000000000 --- a/DataStorage/Database/Connector/SQLiteConnector.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - -namespace phpOMS\DataStorage\Database\Connector; - -abstract class SqliteConnector extends \Exception -{ - -} \ No newline at end of file diff --git a/DataStorage/Database/Connector/SqlServerConnector.php b/DataStorage/Database/Connector/SqlServerConnector.php deleted file mode 100644 index 87f19c73d..000000000 --- a/DataStorage/Database/Connector/SqlServerConnector.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - -namespace phpOMS\DataStorage\Database\Connector; - -abstract class SqlServerConnector extends \Exception -{ - -} \ No newline at end of file diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index 6f7662e84..d117baba4 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -21,6 +19,7 @@ use phpOMS\DataStorage\Database\Connection\ConnectionAbstract; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\DataMapperInterface; use phpOMS\Message\RequestAbstract; +use phpOMS\DataStorage\Database\Exception\InvalidMapperException; /** * Datamapper for databases. @@ -29,8 +28,6 @@ use phpOMS\Message\RequestAbstract; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -141,7 +138,20 @@ class DataMapperAbstract implements DataMapperInterface */ protected static $fields = []; + /** + * Initialized objects for cross reference to reduce initialization costs + * + * @var array[] + * @since 1.0.0 + */ protected static $initObjects = []; + + /** + * Highest mapper to know when to clear initialized objects + * + * @var DataMapperAbstract + * @since 1.0.0 + */ protected static $parentMapper = null; /** @@ -164,7 +174,6 @@ class DataMapperAbstract implements DataMapperInterface * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -172,9 +181,10 @@ class DataMapperAbstract implements DataMapperInterface /** * Clone. + * + * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __clone() { @@ -184,9 +194,10 @@ class DataMapperAbstract implements DataMapperInterface * Set database connection. * * @param ConnectionAbstract $con Database connection + * + * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function setConnection(ConnectionAbstract $con) /* : void */ { @@ -199,7 +210,6 @@ class DataMapperAbstract implements DataMapperInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPrimaryField() : string { @@ -212,7 +222,6 @@ class DataMapperAbstract implements DataMapperInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getTable() : string { @@ -227,7 +236,6 @@ class DataMapperAbstract implements DataMapperInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function extend($class) /* : void */ { @@ -250,10 +258,9 @@ class DataMapperAbstract implements DataMapperInterface * * @param array $objects Objects to load * - * @return null + * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function with(...$objects) /* : void */ { @@ -272,7 +279,6 @@ class DataMapperAbstract implements DataMapperInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function clear() /* : void */ { @@ -307,10 +313,9 @@ class DataMapperAbstract implements DataMapperInterface * * @param string $search Search for * - * @return Builder + * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function find(string $search) : array { @@ -336,7 +341,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function create($obj, int $relations = RelationType::ALL) { @@ -368,7 +372,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function createModel($obj, \ReflectionClass $reflectionClass) { @@ -419,6 +422,16 @@ class DataMapperAbstract implements DataMapperInterface return self::$db->con->lastInsertId(); } + /** + * Get id of object + * + * @param Object $obj Model to create + * @param \ReflectionClass $reflectionClass Reflection class + * + * @return mixed + * + * @since 1.0.0 + */ private static function getObjectId($obj, \ReflectionClass $reflectionClass = null) { $reflectionClass = $reflectionClass ?? new \ReflectionClass(get_class($obj)); @@ -447,7 +460,6 @@ class DataMapperAbstract implements DataMapperInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function setObjectId(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */ { @@ -474,10 +486,9 @@ class DataMapperAbstract implements DataMapperInterface * * @return void * - * @throws \Exception + * @throws InvalidMapperException * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function createHasMany(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */ { @@ -495,7 +506,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(static::$hasMany[$propertyName]['mapper'])) { - throw new \Exception('No mapper set for relation object.'); + throw new InvalidMapperException(); } /** @var DataMapperAbstract $mapper */ @@ -568,7 +579,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function createOwnsOne(string $propertyName, $obj) { @@ -597,7 +607,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function createBelongsTo(string $propertyName, $obj) { @@ -628,7 +637,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function createRelationTable(string $propertyName, array $objsIds, $objId) { @@ -660,7 +668,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function parseValue(string $type, $value) { @@ -698,10 +705,9 @@ class DataMapperAbstract implements DataMapperInterface * * @return void * - * @throws \Exception + * @throws InvalidMapperException * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function updateHasMany(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */ { @@ -719,7 +725,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(static::$hasMany[$propertyName]['mapper'])) { - throw new \Exception('No mapper set for relation object.'); + throw new InvalidMapperException(); } /** @var DataMapperAbstract $mapper */ @@ -786,7 +792,6 @@ class DataMapperAbstract implements DataMapperInterface * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function updateRelationTable(string $propertyName, array $objsIds, $objId) { @@ -825,7 +830,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function deleteRelationTable(string $propertyName, array $objsIds, $objId) { @@ -860,7 +864,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function updateOwnsOne(string $propertyName, $obj) { @@ -887,7 +890,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function updateBelongsTo(string $propertyName, $obj) { @@ -911,7 +913,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function updateModel($obj, $objId, \ReflectionClass $reflectionClass = null) /* : void */ { @@ -975,7 +976,6 @@ class DataMapperAbstract implements DataMapperInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function update($obj, int $relations = RelationType::ALL) : int { @@ -1010,10 +1010,9 @@ class DataMapperAbstract implements DataMapperInterface * * @return void * - * @throws \Exception + * @throws InvalidMapperException * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function deleteHasMany(\ReflectionClass $reflectionClass, $obj, $objId, int $relations) /* : void */ { @@ -1031,7 +1030,7 @@ class DataMapperAbstract implements DataMapperInterface } if (!isset(static::$hasMany[$propertyName]['mapper'])) { - throw new \Exception('No mapper set for relation object.'); + throw new InvalidMapperException(); } /** @var DataMapperAbstract $mapper */ @@ -1083,7 +1082,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function deleteOwnsOne(string $propertyName, $obj) { @@ -1109,7 +1107,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function deleteBelongsTo(string $propertyName, $obj) { @@ -1134,7 +1131,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function deleteModel($obj, $objId, int $relations = RelationType::REFERENCE, \ReflectionClass $reflectionClass = null) /* : void */ { @@ -1186,10 +1182,9 @@ class DataMapperAbstract implements DataMapperInterface * @param mixed $obj Object reference (gets filled with insert id) * @param int $relations Create all relations as well * - * @return int + * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function delete($obj, int $relations = RelationType::REFERENCE) { @@ -1218,7 +1213,6 @@ class DataMapperAbstract implements DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populateIterable(array $result) : array { @@ -1244,7 +1238,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populate(array $result, $obj = null) { @@ -1274,7 +1267,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populateManyToMany(array $result, &$obj) { @@ -1316,7 +1308,6 @@ class DataMapperAbstract implements DataMapperInterface * @todo accept reflection class as parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populateHasOne(&$obj) { @@ -1359,7 +1350,6 @@ class DataMapperAbstract implements DataMapperInterface * @todo accept reflection class as parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populateOwnsOne(&$obj) { @@ -1402,7 +1392,6 @@ class DataMapperAbstract implements DataMapperInterface * @todo accept reflection class as parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populateBelongsTo(&$obj) { @@ -1443,10 +1432,9 @@ class DataMapperAbstract implements DataMapperInterface * * @return mixed * - * @throws \Exception + * @throws \UnexpectedValueException * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function populateAbstract(array $result, $obj) { @@ -1493,7 +1481,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null) { @@ -1543,9 +1530,8 @@ class DataMapperAbstract implements DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function getAll(int $relations = RelationType::ALL, string $lang = '') + public static function getAll(int $relations = RelationType::ALL, string $lang = '') : array { if(!isset(self::$parentMapper)) { self::setUpParentMapper(); @@ -1566,9 +1552,8 @@ class DataMapperAbstract implements DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function listResults(Builder $query) + public static function listResults(Builder $query) : array { $sth = self::$db->con->prepare($query->toSql()); $sth->execute(); @@ -1589,9 +1574,8 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function getNewest(int $limit = 1, Builder $query = null, int $relations = RelationType::ALL, string $lang = '') + public static function getNewest(int $limit = 1, Builder $query = null, int $relations = RelationType::ALL, string $lang = '') : array { self::extend(__CLASS__); @@ -1631,7 +1615,6 @@ class DataMapperAbstract implements DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAllByQuery(Builder $query, int $relations = RelationType::ALL) : array { @@ -1657,7 +1640,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRandom(int $amount = 1, int $relations = RelationType::ALL) { @@ -1679,12 +1661,11 @@ class DataMapperAbstract implements DataMapperInterface * @param mixed $obj Objects to fill * @param int $relations Relations type * - * @return array + * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function fillRelations(array &$obj, int $relations = RelationType::ALL) + public static function fillRelations(array &$obj, int $relations = RelationType::ALL) /* : void */ { $hasMany = !empty(static::$hasMany); $hasOne = !empty(static::$hasOne); @@ -1721,7 +1702,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRaw($primaryKey) : array { @@ -1744,7 +1724,6 @@ class DataMapperAbstract implements DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAllRaw(string $lang = '') : array { @@ -1771,7 +1750,6 @@ class DataMapperAbstract implements DataMapperInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getHasManyRaw($primaryKey, int $relations = RelationType::ALL) : array { @@ -1825,7 +1803,6 @@ class DataMapperAbstract implements DataMapperInterface * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getQuery(Builder $query = null) : Builder { @@ -1843,7 +1820,6 @@ class DataMapperAbstract implements DataMapperInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCreatedAt() : string { @@ -1860,7 +1836,6 @@ class DataMapperAbstract implements DataMapperInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getByRequest(RequestAbstract $request) { @@ -1902,7 +1877,18 @@ class DataMapperAbstract implements DataMapperInterface return $result; } - private static function addInitialized($mapper, $id, $obj = null) + /** + * Add initialized object to local cache + * + * @param string $mapper Mapper name + * @param mixed $id Object id + * @param object $obj Model to cache locally + * + * @return void + * + * @since 1.0.0 + */ + private static function addInitialized(string $mapper, $id, $obj = null) /* : void */ { if(!isset(self::$initObjects[$mapper])) { self::$initObjects[$mapper] = []; @@ -1911,13 +1897,55 @@ class DataMapperAbstract implements DataMapperInterface self::$initObjects[$mapper][$id] = $obj; } - private static function isInitialized($mapper, $id) + /** + * Check if a object is initialized + * + * @param string $mapper Mapper name + * @param mixed $id Object id + * + * @return bool + * + * @since 1.0.0 + */ + private static function isInitialized($mapper, $id) : bool { return isset(self::$initObjects[$mapper]) && isset(self::$initObjects[$mapper][$id]); } - private static function setUpParentMapper() + /** + * 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 + * + * @param mixed $id Object id + * + * @return bool + * + * @since 1.0.0 + */ + public static function exists($id) : bool + { + $query = $query ?? new Builder(self::$db); + $query->prefix(self::$db->getPrefix()) + ->select(static::$primaryField) + ->from(static::$table) + ->where(static::$primaryField, '=', $id); + + $sth = self::$db->con->prepare($query->toSql()); + $sth->execute(); + + $results = $sth->fetchAll(\PDO::FETCH_ASSOC); + + return count($results) === 0; + } } diff --git a/DataStorage/Database/DatabaseExceptionFactory.php b/DataStorage/Database/DatabaseExceptionFactory.php index 5005b651e..7a88508d4 100644 --- a/DataStorage/Database/DatabaseExceptionFactory.php +++ b/DataStorage/Database/DatabaseExceptionFactory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,11 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database; -use phpOMS\DataStorage\Database\Schema\Exception\TableException; - /** * Database exception factory. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,33 +31,36 @@ class DatabaseExceptionFactory * * @param \PDOException $e Exception * - * @return \PDOException + * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function create(\PDOException $e) : \PDOException + public static function createException(\PDOException $e) : string { switch ($e->getCode()) { case '42S02': - return self::createTableViewException($e); + return '\phpOMS\DataStorage\Database\Schema\Exception\TableException'; default: - return $e; + return '\PDOException'; } } /** - * Create table exception. + * Constructor. * * @param \PDOException $e Exception * - * @return \PDOException + * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ - private static function createTableViewException(\PDOException $e) : \PDOException + public static function createExceptionMessage(\PDOException $e) : string { - return new TableException(TableException::findTable($e->getMessage())); + switch ($e->getCode()) { + case '42S02': + return TableException::findTable($e->getMessage()); + default: + return $e->getMessage(); + } } } diff --git a/DataStorage/Database/DatabasePool.php b/DataStorage/Database/DatabasePool.php index 772d1f73c..aaec74103 100644 --- a/DataStorage/Database/DatabasePool.php +++ b/DataStorage/Database/DatabasePool.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\Connection\ConnectionFactory; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class DatabasePool * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -61,7 +56,6 @@ class DatabasePool * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(string $key = 'core', ConnectionAbstract $db) : bool { @@ -82,7 +76,6 @@ class DatabasePool * @return ConnectionAbstract|null * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(string $key = 'core') /* : ?ConnectionAbstract */ { @@ -101,7 +94,6 @@ class DatabasePool * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(string $key) : bool { @@ -123,7 +115,6 @@ class DatabasePool * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function create($key, array $config) : bool { diff --git a/DataStorage/Database/DatabaseStatus.php b/DataStorage/Database/DatabaseStatus.php index 2222d87f5..db73f88cb 100644 --- a/DataStorage/Database/DatabaseStatus.php +++ b/DataStorage/Database/DatabaseStatus.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database status enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Database/DatabaseType.php b/DataStorage/Database/DatabaseType.php index f7b3ff614..f0ac90eb4 100644 --- a/DataStorage/Database/DatabaseType.php +++ b/DataStorage/Database/DatabaseType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Matrix/DimensionException.php b/DataStorage/Database/Exception/InvalidConnectionConfigException.php similarity index 51% rename from Math/Matrix/DimensionException.php rename to DataStorage/Database/Exception/InvalidConnectionConfigException.php index 3112eacdd..c56ddff3e 100644 --- a/Math/Matrix/DimensionException.php +++ b/DataStorage/Database/Exception/InvalidConnectionConfigException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,34 +13,30 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Matrix; +namespace phpOMS\DataStorage\Database\Exception; /** * Permission exception class. * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ -class DimensionException extends \RuntimeException +class InvalidConnectionConfigException extends \RuntimeException { /** * Constructor. * - * @param int $m Dimension M - * @param int $n Dimension N + * @param string $message Exception message * @param int $code Exception code * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function __construct($m, $n, int $code = 0, \Exception $previous = null) + public function __construct(string $message = '', int $code = 0, \Exception $previous = null) { - parent::__construct('Dimension of "' . $n . '-' . $m . '" invalid.', $code, $previous); + parent::__construct('Missing config value for "'. $message .'".', $code, $previous); } } diff --git a/DataStorage/Database/Exception/InvalidMapperException.php b/DataStorage/Database/Exception/InvalidMapperException.php new file mode 100644 index 000000000..240c3b097 --- /dev/null +++ b/DataStorage/Database/Exception/InvalidMapperException.php @@ -0,0 +1,46 @@ + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Utils\StringUtils; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -98,7 +94,6 @@ abstract class GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function compileQuery(BuilderAbstract $query) : string { @@ -122,7 +117,6 @@ abstract class GrammarAbstract * @return array Parsed query components * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract protected function compileComponents(BuilderAbstract $query) : array; @@ -132,7 +126,6 @@ abstract class GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDateFormat() : string { @@ -145,7 +138,6 @@ abstract class GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getTablePrefix() : string { @@ -158,7 +150,6 @@ abstract class GrammarAbstract * @param string $prefix Table prefix * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setTablePrefix(string $prefix) /* : void */ { @@ -174,7 +165,6 @@ abstract class GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function expressionizeTableColumn(array $elements, string $prefix = '') : string { @@ -208,7 +198,6 @@ abstract class GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileSystem($system, string $prefix = '') : string { diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index d011f1358..9628f1736 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\Connection\ConnectionAbstract; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -217,7 +213,6 @@ class Builder extends BuilderAbstract * @param ConnectionAbstract $connection Database connection * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(ConnectionAbstract $connection, bool $readOnly = false) { @@ -233,7 +228,6 @@ class Builder extends BuilderAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setConnection(ConnectionAbstract $connection) /* : void */ { @@ -251,7 +245,6 @@ class Builder extends BuilderAbstract * @todo Closure is not working this way, needs to be evaluated befor assigning * * @since 1.0.0 - * @author Dennis Eichhorn */ public function select(...$columns) : Builder { @@ -278,7 +271,6 @@ class Builder extends BuilderAbstract * @todo Closure is not working this way, needs to be evaluated befor assigning * * @since 1.0.0 - * @author Dennis Eichhorn */ public function random(...$columns) : Builder { @@ -297,7 +289,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function bind($binds) : Builder { @@ -318,7 +309,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function newQuery() : Builder { @@ -331,7 +321,6 @@ class Builder extends BuilderAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function toSql() : string { @@ -346,7 +335,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function raw(string $raw) : Builder { @@ -377,7 +365,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function selectRaw($expression) : Builder { @@ -392,7 +379,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function distinct(...$columns) : Builder { @@ -409,7 +395,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function from(...$tables) : Builder { @@ -432,7 +417,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function fromRaw($expression) : Builder { @@ -454,7 +438,6 @@ class Builder extends BuilderAbstract * @throws \InvalidArgumentException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function where($columns, $operator = null, $values = null, $boolean = 'and') : Builder { @@ -504,7 +487,6 @@ class Builder extends BuilderAbstract * @return array|null * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getWhereByColumn($column) /* : ?array */ { @@ -520,7 +502,6 @@ class Builder extends BuilderAbstract * @return string|null * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getTableOfSystem($expression, string $systemIdentifier) /* : ?string */ { @@ -539,7 +520,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function andWhere(Where $where) : Builder { @@ -559,7 +539,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function orWhere(Where $where) : Builder { @@ -581,7 +560,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function whereIn($column, $values = null, string $boolean = 'and') : Builder { @@ -599,7 +577,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function whereNull($column, string $boolean = 'and') : Builder { @@ -617,7 +594,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function whereNotNull($column, string $boolean = 'and') : Builder { @@ -634,7 +610,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function groupBy(...$columns) : Builder { @@ -657,7 +632,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function newest($column) : Builder { @@ -674,7 +648,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function oldest($column) : Builder { @@ -692,7 +665,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function orderBy($columns, $order = 'DESC') : Builder { @@ -717,7 +689,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function offset($offset) : Builder { @@ -734,7 +705,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function limit($limit) : Builder { @@ -751,7 +721,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function union($query) : Builder { @@ -768,7 +737,6 @@ class Builder extends BuilderAbstract * Lock query. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function lock() { @@ -778,7 +746,6 @@ class Builder extends BuilderAbstract * Lock for update query. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function lockUpdate() { @@ -788,7 +755,6 @@ class Builder extends BuilderAbstract * Create query string. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __toString() { @@ -799,7 +765,6 @@ class Builder extends BuilderAbstract * Find query. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function find() { @@ -809,7 +774,6 @@ class Builder extends BuilderAbstract * Count results. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count(string $table = '*') { @@ -821,7 +785,6 @@ class Builder extends BuilderAbstract * Check if exists. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function exists() { @@ -831,7 +794,6 @@ class Builder extends BuilderAbstract * Select minimum. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function min() { @@ -841,7 +803,6 @@ class Builder extends BuilderAbstract * Select maximum. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function max() { @@ -851,7 +812,6 @@ class Builder extends BuilderAbstract * Select sum. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function sum() { @@ -861,7 +821,6 @@ class Builder extends BuilderAbstract * Select average. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function avg() { @@ -875,7 +834,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function insert(...$columns) : Builder { @@ -900,7 +858,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function into($table) : Builder { @@ -917,7 +874,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function values(...$values) : Builder { @@ -935,7 +891,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function value($value, string $type = 'string') : Builder { @@ -955,7 +910,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function update(...$columns) : Builder { @@ -976,7 +930,6 @@ class Builder extends BuilderAbstract * Increment value. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function increment() { @@ -986,7 +939,6 @@ class Builder extends BuilderAbstract * Decrement value. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function decrement() { @@ -996,7 +948,6 @@ class Builder extends BuilderAbstract * Join. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function join($table1, $table2, $column1, $opperator, $column2) { @@ -1007,7 +958,6 @@ class Builder extends BuilderAbstract * Join where. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function joinWhere() { @@ -1017,7 +967,6 @@ class Builder extends BuilderAbstract * Left join. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function leftJoin() { @@ -1027,7 +976,6 @@ class Builder extends BuilderAbstract * Left join where. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function leftJoinWhere() { @@ -1037,7 +985,6 @@ class Builder extends BuilderAbstract * Right join. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function rightJoin() { @@ -1047,7 +994,6 @@ class Builder extends BuilderAbstract * Right join where. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function rightJoinWhere() { @@ -1059,7 +1005,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function rollback() { @@ -1070,7 +1015,6 @@ class Builder extends BuilderAbstract * On. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function on() { @@ -1087,7 +1031,6 @@ class Builder extends BuilderAbstract * @return Builder * * @since 1.0.0 - * @author Dennis Eichhorn */ public function merge(Builder $query) : Builder { @@ -1100,7 +1043,6 @@ class Builder extends BuilderAbstract * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function execute() { @@ -1123,7 +1065,6 @@ class Builder extends BuilderAbstract * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getBindParamType($value) { diff --git a/DataStorage/Database/Query/Column.php b/DataStorage/Database/Query/Column.php index 7f7e2ce88..7c485668a 100644 --- a/DataStorage/Database/Query/Column.php +++ b/DataStorage/Database/Query/Column.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Database\Query; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,7 +41,6 @@ class Column * @param string $column Column * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $column) { @@ -58,7 +53,6 @@ class Column * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getColumn() : string { diff --git a/DataStorage/Database/Query/Expression.php b/DataStorage/Database/Query/Expression.php index f879096b7..0a9946fb0 100644 --- a/DataStorage/Database/Query/Expression.php +++ b/DataStorage/Database/Query/Expression.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index 507d5dc76..a67b302b1 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -29,8 +27,6 @@ use phpOMS\DataStorage\Database\Query\Where; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -102,7 +98,6 @@ class Grammar extends GrammarAbstract * @throws \InvalidArgumentException * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileComponents(BuilderAbstract $query) : array { @@ -150,7 +145,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileSelects(Builder $query, array $columns) : string { @@ -172,7 +166,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileFrom(Builder $query, array $table) : string { @@ -195,7 +188,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileWheres(Builder $query, array $wheres, bool $first = true) : string { @@ -225,7 +217,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileWhereElement(array $element, Builder $query, bool $first = true) : string { @@ -271,7 +262,6 @@ class Grammar extends GrammarAbstract * @throws \InvalidArgumentException Throws this exception if the value to compile is not supported by this function. * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileValue($value, $prefix = '') : string { @@ -313,7 +303,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileLimit(Builder $query, int $limit) : string { @@ -329,7 +318,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileOffset(Builder $query, $offset) : string { @@ -350,7 +338,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function compileGroups(Builder $query, array $groups) { @@ -374,7 +361,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function compileOrders(Builder $query, array $orders) : string { @@ -412,7 +398,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileInto(Builder $query, $table) : string { @@ -428,7 +413,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileInserts(Builder $query, array $columns) : string { @@ -454,7 +438,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileValues(Builder $query, array $values) : string { diff --git a/DataStorage/Database/Query/Grammar/GrammarInterface.php b/DataStorage/Database/Query/Grammar/GrammarInterface.php index 3c3b84182..234da813f 100644 --- a/DataStorage/Database/Query/Grammar/GrammarInterface.php +++ b/DataStorage/Database/Query/Grammar/GrammarInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/DataStorage/Database/Query/Grammar/MicrosoftGrammar.php b/DataStorage/Database/Query/Grammar/MicrosoftGrammar.php index 8ad8e5cf1..00214fbb5 100644 --- a/DataStorage/Database/Query/Grammar/MicrosoftGrammar.php +++ b/DataStorage/Database/Query/Grammar/MicrosoftGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\DataStorage\Database\Query\Grammar - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class MicrosoftGrammar extends Grammar * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileRandom(Builder $query, array $columns) : string { diff --git a/DataStorage/Database/Query/Grammar/MysqlGrammar.php b/DataStorage/Database/Query/Grammar/MysqlGrammar.php index c914e3a57..082535a71 100644 --- a/DataStorage/Database/Query/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Query/Grammar/MysqlGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\DataStorage\Database\Query\Grammar - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -49,7 +45,6 @@ class MysqlGrammar extends Grammar * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileRandom(Builder $query, array $columns) : string { diff --git a/DataStorage/Database/Query/Grammar/OracleGrammar.php b/DataStorage/Database/Query/Grammar/OracleGrammar.php index a85a1f833..df49c2ea4 100644 --- a/DataStorage/Database/Query/Grammar/OracleGrammar.php +++ b/DataStorage/Database/Query/Grammar/OracleGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\DataStorage\Database\Query\Grammar - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class OracleGrammar extends Grammar * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileRandom(Builder $query, array $columns) : string { diff --git a/DataStorage/Database/Query/Grammar/PostgresGrammar.php b/DataStorage/Database/Query/Grammar/PostgresGrammar.php index 03be13a70..a29215e9f 100644 --- a/DataStorage/Database/Query/Grammar/PostgresGrammar.php +++ b/DataStorage/Database/Query/Grammar/PostgresGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\DataStorage\Database\Query\Grammar - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class PostgresGrammar extends Grammar * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileRandom(Builder $query, array $columns) : string { diff --git a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php index f39b44885..80d950103 100644 --- a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\DataStorage\Database\Query\Grammar - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -49,7 +45,6 @@ class SqliteGrammar extends Grammar * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileRandom(Builder $query, array $columns) : string { diff --git a/DataStorage/Database/Query/JoinType.php b/DataStorage/Database/Query/JoinType.php index f9650ff47..449a165cd 100644 --- a/DataStorage/Database/Query/JoinType.php +++ b/DataStorage/Database/Query/JoinType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database\Query; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Query type enum. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Database/Query/QueryType.php b/DataStorage/Database/Query/QueryType.php index efd1efa2e..40481343b 100644 --- a/DataStorage/Database/Query/QueryType.php +++ b/DataStorage/Database/Query/QueryType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database\Query; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Query type enum. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Database/Query/Where.php b/DataStorage/Database/Query/Where.php index d89d85d20..d2af3ccd0 100644 --- a/DataStorage/Database/Query/Where.php +++ b/DataStorage/Database/Query/Where.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Database\Query; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Database/RelationType.php b/DataStorage/Database/RelationType.php index 2a24baa8d..206e5d019 100644 --- a/DataStorage/Database/RelationType.php +++ b/DataStorage/Database/RelationType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/Database/Schema/Builder.php b/DataStorage/Database/Schema/Builder.php index e4fb6ba3b..c330dcf38 100644 --- a/DataStorage/Database/Schema/Builder.php +++ b/DataStorage/Database/Schema/Builder.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\DataStorage\Database\Query; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ class Builder extends BuilderAbstract * @param ConnectionAbstract $connection Database connection * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(ConnectionAbstract $connection) { @@ -82,7 +77,6 @@ class Builder extends BuilderAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function toSql() : string { diff --git a/DataStorage/Database/Schema/Exception/TableException.php b/DataStorage/Database/Schema/Exception/TableException.php index dd21ea4c8..b69bc0cc9 100644 --- a/DataStorage/Database/Schema/Exception/TableException.php +++ b/DataStorage/Database/Schema/Exception/TableException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Database\Schema\Exception; * * @category System * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class TableException extends \PDOException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { @@ -53,7 +48,6 @@ class TableException extends \PDOException * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function findTable(string $message) : string { diff --git a/DataStorage/Database/Schema/Grammar/Grammar.php b/DataStorage/Database/Schema/Grammar/Grammar.php index 8894e87dd..406c92f4d 100644 --- a/DataStorage/Database/Schema/Grammar/Grammar.php +++ b/DataStorage/Database/Schema/Grammar/Grammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\DataStorage\Database\Schema\QueryType; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -63,7 +59,6 @@ class Grammar extends GrammarAbstract * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function compileComponents(BuilderAbstract $query) : array { @@ -96,7 +91,6 @@ class Grammar extends GrammarAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileDrop(BuilderAbstract $query, array $tables) : string { diff --git a/DataStorage/Database/Schema/Grammar/GrammarInterface.php b/DataStorage/Database/Schema/Grammar/GrammarInterface.php index dc5873c5d..b3dc4695e 100644 --- a/DataStorage/Database/Schema/Grammar/GrammarInterface.php +++ b/DataStorage/Database/Schema/Grammar/GrammarInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php index dd7e34a2e..53f4102c8 100644 --- a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\Query\Builder; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -49,7 +45,6 @@ class MysqlGrammar extends Grammar * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileSelects(Builder $query, array $columns) : string { @@ -71,7 +66,6 @@ class MysqlGrammar extends Grammar * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function compileFrom(Builder $query, array $table) : string { diff --git a/DataStorage/Database/Schema/Grammar/PostgresGrammar.php b/DataStorage/Database/Schema/Grammar/PostgresGrammar.php index af761cd6d..fb6868741 100644 --- a/DataStorage/Database/Schema/Grammar/PostgresGrammar.php +++ b/DataStorage/Database/Schema/Grammar/PostgresGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php index d8268d309..864ea36cd 100644 --- a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php b/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php index f5b4b7b71..c9ee5d5b8 100644 --- a/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php +++ b/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/DataStorage/Database/Schema/QueryType.php b/DataStorage/Database/Schema/QueryType.php index 7ec1bc76c..98cbba489 100644 --- a/DataStorage/Database/Schema/QueryType.php +++ b/DataStorage/Database/Schema/QueryType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Database\Schema; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/DataStorage/LockException.php b/DataStorage/LockException.php index c8fc1f528..b00a96209 100644 --- a/DataStorage/LockException.php +++ b/DataStorage/LockException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class LockException extends \RuntimeException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { diff --git a/DataStorage/Session/ConsoleSession.php b/DataStorage/Session/ConsoleSession.php index 9405ab9f3..70b2a09f9 100644 --- a/DataStorage/Session/ConsoleSession.php +++ b/DataStorage/Session/ConsoleSession.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Session; * * @category Framework * @package phpOMS\DataStorage\Session - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,7 +41,6 @@ class ConsoleSession implements SessionInterface * @param string|int|bool $sid Session id * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($sid = false) { diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index 4ea6eddd8..05a33847c 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\DataStorage\LockException; * * @category Framework * @package phpOMS\DataStorage\Session - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -58,19 +54,27 @@ class HttpSession implements SessionInterface * @since 1.0.0 */ private $sid = null; + + /** + * Inactivity Interval. + * + * @var int + * @since 1.0.0 + */ + private $inactivityInterval = 0; /** * Constructor. * * @param int $liftetime Session life time * @param string|int|bool $sid Session id + * @param int $inactivityInterval Interval for session activity * * @throws LockException Throws this exception if the session is alrady locked for further interaction. * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function __construct(int $liftetime = 3600, $sid = false) + public function __construct(int $liftetime = 3600, $sid = false, int $inactivityInterval = 0) { if (self::$isLocked) { throw new LockException('HttpSession'); @@ -79,13 +83,21 @@ class HttpSession implements SessionInterface if (!is_bool($sid)) { session_id($sid); } + + $this->inactivityInterval = $inactivityInterval; session_set_cookie_params($liftetime, '/', '', false, true); session_start(); + + if($this->inactivityInterval > 0 && ($this->inactivityInterval + ($_SESSION['lastActivity'] ?? 0) < time())) { + $this->destroy(); + } + $this->sessionData = $_SESSION; $_SESSION = null; - + $this->sessionData['lastActivity'] = time(); $this->sid = session_id(); + $this->setCsrfProtection(); } @@ -93,7 +105,6 @@ class HttpSession implements SessionInterface * Set Csrf protection for forms. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function setCsrfProtection() /* : void */ { @@ -133,7 +144,6 @@ class HttpSession implements SessionInterface * Lock session from further adjustments. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function lock() { @@ -146,7 +156,6 @@ class HttpSession implements SessionInterface * @return bool Lock status * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isLocked() : bool { @@ -193,12 +202,18 @@ class HttpSession implements SessionInterface { $this->sid = $sid; } + + private function destroy() /* : void */ + { + session_destroy(); + $this->sessionData = []; + session_start(); + } /** * Destruct session. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __destruct() { diff --git a/DataStorage/Session/SessionInterface.php b/DataStorage/Session/SessionInterface.php index 463582867..d69d2e427 100644 --- a/DataStorage/Session/SessionInterface.php +++ b/DataStorage/Session/SessionInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\DataStorage\Session; * * @category Framework * @package phpOMS\DataStorage\Cache - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ interface SessionInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get($key); @@ -55,7 +50,6 @@ interface SessionInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set($key, $value, bool $overwrite = true) : bool; @@ -67,7 +61,6 @@ interface SessionInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove($key) : bool; @@ -79,7 +72,6 @@ interface SessionInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function save() /* : void */; @@ -87,7 +79,6 @@ interface SessionInterface * @return int|string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSID(); @@ -97,7 +88,6 @@ interface SessionInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setSID($sid) /* : void */; diff --git a/DataStorage/Session/SocketSession.php b/DataStorage/Session/SocketSession.php index 8150a2ec0..464068d6e 100644 --- a/DataStorage/Session/SocketSession.php +++ b/DataStorage/Session/SocketSession.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Session; * * @category Framework * @package phpOMS\DataStorage\Session - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,7 +41,6 @@ class SocketSession implements SessionInterface * @param string|int|bool $sid Session id * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($sid = false) { diff --git a/DataStorage/Web/Builder.php b/DataStorage/Web/Builder.php index 4bcaa0da7..cef7ce903 100644 --- a/DataStorage/Web/Builder.php +++ b/DataStorage/Web/Builder.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMs\DataStorage\Database\Query\Builder as DatabaseQueryBuilder; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Dispatcher/Dispatcher.php b/Dispatcher/Dispatcher.php index d54dd3c97..1c8cb680a 100644 --- a/Dispatcher/Dispatcher.php +++ b/Dispatcher/Dispatcher.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\System\File\PathException; * * @category Framework * @package phpOMS\Dispatcher - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -59,7 +55,6 @@ class Dispatcher * @param ApplicationAbstract $app Appliaction * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(ApplicationAbstract $app) { @@ -75,7 +70,6 @@ class Dispatcher * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function dispatch($controller, ...$data) : array { @@ -107,7 +101,6 @@ class Dispatcher * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function dispatchString(string $controller, array $data = null) : array { @@ -137,7 +130,6 @@ class Dispatcher * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function dispatchArray(array $controller, array $data = null) : array { @@ -160,9 +152,8 @@ class Dispatcher * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ - private function dispatchClosure(\Closure $controller, array $data = null) + private function dispatchClosure(\Closure $controller, array $data = null) /* : void */ { return $controller($this->app, ...$data); } @@ -174,10 +165,11 @@ class Dispatcher * * @return mixed * + * @throws PathException This exception is thrown in case the controller couldn't be found. + * * @since 1.0.0 - * @author Dennis Eichhorn */ - private function getController(string $controller) + private function getController(string $controller) /* : object */ { if (!isset($this->controllers[$controller])) { if (!file_exists($path = __DIR__ . '/../../' . str_replace('\\', '/', $controller) . '.php')) { @@ -186,6 +178,7 @@ class Dispatcher // If module controller use module manager for initialization if(strpos('\Modules\Controller', $controller) === 0) { + $split = explode('\\', $controller); $this->controllers[$controller] = $this->app->moduleManager->get($split[2]); } else { $this->controllers[$controller] = new $controller($this->app); @@ -201,19 +194,12 @@ class Dispatcher * @param ModuleAbstract $controller Controller * @param string $name Controller string * - * @return bool + * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function set(ModuleAbstract $controller, string $name) : bool + public function set(ModuleAbstract $controller, string $name) /* : void */ { - if (!isset($this->controllers[$name])) { - $this->controllers[$name] = $controller; - - return true; - } - - return false; + $this->controllers[$name] = $controller; } } diff --git a/Event/EventManager.php b/Event/EventManager.php index a47f9a387..ecdd60481 100644 --- a/Event/EventManager.php +++ b/Event/EventManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Event; * * @category Framework * @package phpOMS\Event - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -52,14 +48,22 @@ class EventManager * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { } /** - * {@inheritdoc} + * Attach new event + * + * @param string $group Name of the event (unique) + * @param \Closure $callback Callback for the event + * @param bool $remove Remove event after triggering it? + * @param bool $reset Reset event after triggering it? Remove must be false! + * + * @return bool + * + * @since 1.0.0 */ public function attach(string $group, \Closure $callback, bool $remove = false, bool $reset = false) : bool { @@ -73,12 +77,20 @@ class EventManager } /** - * {@inheritdoc} + * Trigger event + * + * @param string $group Name of the event + * @param string $id Sub-requirement for event + * @param mixed $data Data to pass to the callback + * + * @return bool Returns true on sucessfully triggering the event, false if the event couldn't be triggered which also includes sub-requirements missing. + * + * @since 1.0.0 */ - public function trigger(string $group, string $id = '', $data = null) /* : void */ + public function trigger(string $group, string $id = '', $data = null) : bool { if(!isset($this->callbacks[$group])) { - return; + return false; } if (isset($this->groups[$group])) { @@ -93,9 +105,22 @@ class EventManager } elseif($this->callbacks[$group]['reset']) { $this->reset($group); } + + return true; } + + return false; } + /** + * Reset group + * + * @param string $group Name of the event + * + * @return void + * + * @since 1.0.0 + */ private function reset(string $group) /* : void */ { foreach($this->groups[$group] as $id => $ok) { @@ -104,7 +129,13 @@ class EventManager } /** - * {@inheritdoc} + * Check if a group has missing sub-requirements + * + * @param string $group Name of the event + * + * @return bool + * + * @since 1.0.0 */ private function hasOutstanding(string $group) : bool { @@ -122,23 +153,40 @@ class EventManager } /** - * {@inheritdoc} + * Detach an event + * + * @param string $group Name of the event + * + * @return bool + * + * @since 1.0.0 */ public function detach(string $group) : bool { + $found = false; + if (isset($this->callbacks[$group])) { unset($this->callbacks[$group]); + $found = true; } if (isset($this->groups[$group])) { unset($this->groups[$group]); + $found = true; } - return true; + return $found; } /** - * {@inheritdoc} + * Add sub-requirement for event + * + * @param string $group Name of the event + * @param string $id ID of the sub-requirement + * + * @return void + * + * @since 1.0.0 */ public function addGroup(string $group, string $id) /* : void */ { @@ -155,7 +203,6 @@ class EventManager * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Html/TagType.php b/Html/TagType.php index 7fb703f38..9c246f465 100644 --- a/Html/TagType.php +++ b/Html/TagType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Html; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Tag type enum. * * @category Framework * @package phpOMS\Html - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/Default/en_US.json b/Localization/Default/en_US.json index ebcb6af2e..6ba33326d 100644 --- a/Localization/Default/en_US.json +++ b/Localization/Default/en_US.json @@ -17,7 +17,7 @@ "very_heavy": "t" }, "speed": { - "very_slow": "ms", + "very_slow": "ns", "slow": "ms", "medium": "kph", "fast": "kph", @@ -25,19 +25,19 @@ "sea": "knot" }, "length": { - "very_short": "mm", - "short": "cm", - "medium": "m", - "long": "km", + "very_short": "nm", + "short": "mm", + "medium": "cm", + "long": "m", "very_long": "km", "sea": "mile" }, "area": { - "very_small": "mm", - "small": "cm", - "medium": "m", - "large": "km", - "very_large": "ha" + "very_small": "nm", + "small": "mm", + "medium": "cm", + "large": "m", + "very_large": "km" }, "volume": { "very_small": "ml", diff --git a/Localization/ISO3166CharEnum.php b/Localization/ISO3166CharEnum.php index a73425381..02cf06b0b 100644 --- a/Localization/ISO3166CharEnum.php +++ b/Localization/ISO3166CharEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Country codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO3166NameEnum.php b/Localization/ISO3166NameEnum.php index 7c861fd43..f85eecfbe 100644 --- a/Localization/ISO3166NameEnum.php +++ b/Localization/ISO3166NameEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Country names ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO3166NumEnum.php b/Localization/ISO3166NumEnum.php index 7251438eb..5ba84a9a7 100644 --- a/Localization/ISO3166NumEnum.php +++ b/Localization/ISO3166NumEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Country codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO3166TwoEnum.php b/Localization/ISO3166TwoEnum.php index 8a762254c..68a4162bc 100644 --- a/Localization/ISO3166TwoEnum.php +++ b/Localization/ISO3166TwoEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Country codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO4217CharEnum.php b/Localization/ISO4217CharEnum.php index d5dc6dd1e..03ce8bb89 100644 --- a/Localization/ISO4217CharEnum.php +++ b/Localization/ISO4217CharEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Currency codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO4217DecimalEnum.php b/Localization/ISO4217DecimalEnum.php index f18350b3a..416ee7aaa 100644 --- a/Localization/ISO4217DecimalEnum.php +++ b/Localization/ISO4217DecimalEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Currency decimals ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO4217Enum.php b/Localization/ISO4217Enum.php index 30ecb4458..09cced948 100644 --- a/Localization/ISO4217Enum.php +++ b/Localization/ISO4217Enum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Currency names ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO4217NumEnum.php b/Localization/ISO4217NumEnum.php index 4cadea101..b3c574bb7 100644 --- a/Localization/ISO4217NumEnum.php +++ b/Localization/ISO4217NumEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Currency codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO4217SubUnitEnum.php b/Localization/ISO4217SubUnitEnum.php index 5fb20cf8d..391b8ffc4 100644 --- a/Localization/ISO4217SubUnitEnum.php +++ b/Localization/ISO4217SubUnitEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Currency sub units ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO4217SymbolEnum.php b/Localization/ISO4217SymbolEnum.php index 72ed3e994..c4ae80496 100644 --- a/Localization/ISO4217SymbolEnum.php +++ b/Localization/ISO4217SymbolEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Country symbols ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO639Enum.php b/Localization/ISO639Enum.php index ce0373106..110c3216f 100644 --- a/Localization/ISO639Enum.php +++ b/Localization/ISO639Enum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Language name ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO639x1Enum.php b/Localization/ISO639x1Enum.php index 9f049aa31..f88b890cf 100644 --- a/Localization/ISO639x1Enum.php +++ b/Localization/ISO639x1Enum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Language codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO639x2Enum.php b/Localization/ISO639x2Enum.php index 88217e49a..f5cb1cfed 100644 --- a/Localization/ISO639x2Enum.php +++ b/Localization/ISO639x2Enum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Language codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/ISO8601EnumArray.php b/Localization/ISO8601EnumArray.php index 30cd1e599..2524fb9d8 100644 --- a/Localization/ISO8601EnumArray.php +++ b/Localization/ISO8601EnumArray.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\EnumArray; +use phpOMS\Stdlib\Base\EnumArray; /** * Datetime ISO format. @@ -27,8 +25,6 @@ use phpOMS\Datatypes\EnumArray; * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/L11nManager.php b/Localization/L11nManager.php index edff93711..7d8216e4f 100644 --- a/Localization/L11nManager.php +++ b/Localization/L11nManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\Module\ModuleAbstract; * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -57,7 +53,6 @@ class L11nManager * @param LoggerInterface $logger Logger * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(LoggerInterface $logger = null) { @@ -72,7 +67,6 @@ class L11nManager * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isLanguageLoaded(string $language) : bool { @@ -91,15 +85,14 @@ class L11nManager * * @return void * - * @throws \Exception + * @throws \UnexpectedValueException This exception is thrown when no language definitions for the defined source `$from` exist. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function loadLanguage(string $language, string $from, array $translation) /* : void */ { if (!isset($translation[$from])) { - throw new \Exception('Unexpected language key: ' . $from); + throw new \UnexpectedValueException($from); } if (!isset($this->language[$language][$from])) { @@ -123,7 +116,6 @@ class L11nManager * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function loadLanguageFromFile(string $language, string $from, string $file) /* : void */ { @@ -145,7 +137,6 @@ class L11nManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getModuleLanguage(string $language, string $module = null) : array { @@ -153,9 +144,9 @@ class L11nManager return $this->language[$language]; } elseif (isset($this->language[$language], $this->language[$language][$module])) { return $this->language[$language][$module]; - } else { - return []; } + + return []; } /** @@ -166,24 +157,31 @@ class L11nManager * @param string $theme Theme * @param string $translation Text * - * @return string + * @return string In case the language element couldn't be found 'ERROR' will be returned * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getText(string $code, string $module, string $theme, string $translation) : string { if (!isset($this->language[$code][$module][$translation])) { - /** @var ModuleAbstract $class */ - $class = '\Modules\\' . $module . '\\Controller'; - $this->loadLanguage($code, $module, $class::getLocalization($code, $theme)); + try { + /** @var ModuleAbstract $class */ + $class = '\Modules\\' . $module . '\\Controller'; + $this->loadLanguage($code, $module, $class::getLocalization($code, $theme)); - if (!isset($this->language[$code][$module][$translation])) { - if(isset($this->logger)) { - $this->logger->warning(FileLogger::MSG_FULL, [ - 'message' => 'Undefined translation for \'' . $code . '/' . $module . '/' . $translation . '\'.', - ]); + if (!isset($this->language[$code][$module][$translation])) { + if(isset($this->logger)) { + $this->logger->warning(FileLogger::MSG_FULL, [ + 'message' => 'Undefined translation for \'' . $code . '/' . $module . '/' . $translation . '\'.', + ]); + } + + return 'ERROR'; } + } catch(\Excpetion $e) { + $this->logger->warning(FileLogger::MSG_FULL, [ + 'message' => 'Undefined translation for \'' . $code . '/' . $module . '/' . $translation . '\'.', + ]); return 'ERROR'; } @@ -191,4 +189,21 @@ class L11nManager return $this->language[$code][$module][$translation]; } + + /** + * Get translation html escaped. + * + * @param string $code Country code + * @param string $module Module name + * @param string $theme Theme + * @param string $translation Text + * + * @return string In case the language element couldn't be found 'ERROR' will be returned + * + * @since 1.0.0 + */ + public function getHtml(string $code, string $module, string $theme, string $translation) : string + { + return htmlspecialchars($this->getText($code, $module, $theme, $translation)); + } } diff --git a/Localization/Localization.php b/Localization/Localization.php index f0698a218..4fd894cd3 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Exception\InvalidEnumValue; +use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; use phpOMS\Utils\Converter\AngleType; use phpOMS\Utils\Converter\TemperatureType; @@ -26,8 +24,6 @@ use phpOMS\Utils\Converter\TemperatureType; * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -146,7 +142,6 @@ class Localization * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -156,7 +151,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCountry() : string { @@ -169,7 +163,6 @@ class Localization * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCountry(string $country) /* : void */ { @@ -184,7 +177,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getTimezone() : string { @@ -197,7 +189,6 @@ class Localization * @todo : maybe make parameter int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setTimezone(string $timezone) /* : void */ { @@ -212,7 +203,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLanguage() : string { @@ -227,7 +217,6 @@ class Localization * @throws InvalidEnumValue * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLanguage(string $language) /* : void */ { @@ -242,7 +231,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCurrency() : string { @@ -255,7 +243,6 @@ class Localization * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCurrency(string $currency) /* : void */ { @@ -270,7 +257,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDatetime() : string { @@ -283,7 +269,6 @@ class Localization * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDatetime(string $datetime) /* : void */ { @@ -294,7 +279,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDecimal() : string { @@ -307,7 +291,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDecimal(string $decimal) /* : void */ { @@ -318,7 +301,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getThousands() : string { @@ -331,7 +313,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setThousands(string $thousands) /* : void */ { @@ -342,7 +323,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAngle() : string { @@ -355,7 +335,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAngle(string $angle) /* : void */ { @@ -366,7 +345,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getTemperature() : string { @@ -379,7 +357,6 @@ class Localization * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setTemperature(string $temperature) /* : void */ { diff --git a/Localization/Money.php b/Localization/Money.php index 0db8da76b..3d805fbe0 100644 --- a/Localization/Money.php +++ b/Localization/Money.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Localization; * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -58,7 +54,7 @@ class Money implements \Serializable /** * Currency symbol position * - * @var string + * @var int * @since 1.0.0 */ private $position = 1; @@ -89,7 +85,6 @@ class Money implements \Serializable * @param int $position Symbol position * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($value = 0, string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0) { @@ -110,7 +105,6 @@ class Money implements \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function toInt(string $value, string $thousands = ',', string $decimal = '.') : int { @@ -139,7 +133,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLocalization(string $thousands = ',', string $decimal = '.', string $symbol = '', int $position = 0) /* : void */ { @@ -159,7 +152,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setString(string $value) : Money { @@ -176,7 +168,6 @@ class Money implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCurrency(int $decimals = 2) : string { @@ -191,7 +182,6 @@ class Money implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAmount(int $decimals = 2) : string { @@ -211,7 +201,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add($value) : Money { @@ -232,7 +221,6 @@ class Money implements \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getInt() : int { @@ -247,7 +235,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function sub($value) : Money { @@ -270,7 +257,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function mult($value) : Money { @@ -289,7 +275,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function div($value) : Money { @@ -306,7 +291,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function abs() : Money { @@ -323,7 +307,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function pow($value) : Money { @@ -340,7 +323,6 @@ class Money implements \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serialize() { @@ -355,7 +337,6 @@ class Money implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function unserialize($value) { @@ -370,7 +351,6 @@ class Money implements \Serializable * @return Money * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setInt(int $value) : Money { diff --git a/Localization/NullLocalization.php b/Localization/NullLocalization.php index 5d697536b..15d21810d 100644 --- a/Localization/NullLocalization.php +++ b/Localization/NullLocalization.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Localization; * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/PhoneEnum.php b/Localization/PhoneEnum.php index 554bc3869..9cc663db8 100644 --- a/Localization/PhoneEnum.php +++ b/Localization/PhoneEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Country codes ISO list. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Localization/TimeZoneEnumArray.php b/Localization/TimeZoneEnumArray.php index 20a3cf369..0c5ea8276 100644 --- a/Localization/TimeZoneEnumArray.php +++ b/Localization/TimeZoneEnumArray.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Localization; -use phpOMS\Datatypes\EnumArray; +use phpOMS\Stdlib\Base\EnumArray; /** * PHP Time zones. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Log/FileLogger.php b/Log/FileLogger.php index 4634c1f0b..4a23e6319 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Log; -use phpOMS\Datatypes\Exception\InvalidEnumValue; +use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; use phpOMS\System\File\Local\File; use phpOMS\System\File\PathException; use phpOMS\Utils\StringUtils; @@ -27,8 +25,6 @@ use phpOMS\Utils\StringUtils; * * @category Framework * @package phpOMS\Log - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -101,7 +97,6 @@ class FileLogger implements LoggerInterface * @param bool $verbose Verbose logging * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $lpath, bool $verbose = false) { @@ -123,7 +118,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function createFile() /* : void */ { @@ -142,7 +136,6 @@ class FileLogger implements LoggerInterface * @return FileLogger * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getInstance(string $path = '', bool $verbose = false) : FileLogger { @@ -159,7 +152,6 @@ class FileLogger implements LoggerInterface * Closes the logging file * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __destruct() { @@ -172,7 +164,6 @@ class FileLogger implements LoggerInterface * Protect instance from getting copied from outside. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __clone() { @@ -186,9 +177,8 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function startTimeLog($id = '') + public function startTimeLog($id = '') /* : void */ { $mtime = explode(' ', microtime()); $mtime = $mtime[1] + $mtime[0]; @@ -201,12 +191,11 @@ class FileLogger implements LoggerInterface * * @param string $id the ID by which this time measurement gets identified * - * @return int the time measurement + * @return int The time measurement in ms * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function endTimeLog($id = '') + public function endTimeLog($id = '') : int { $mtime = explode(' ', microtime()); $mtime = $mtime[1] + $mtime[0]; @@ -225,9 +214,8 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function timingSort(&$timings) + public function timingSort(&$timings) /* : void */ { uasort($timings, [$this, 'orderSort']); } @@ -242,9 +230,8 @@ class FileLogger implements LoggerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ - private function interpolate(string $message, array $context = [], string $level = LogLevel::DEBUG) + private function interpolate(string $message, array $context = [], string $level = LogLevel::DEBUG) : string { $replace = []; foreach ($context as $key => $val) { @@ -283,7 +270,6 @@ class FileLogger implements LoggerInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ private function orderSort($a, $b) : int { @@ -302,7 +288,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function write(string $message) /* : void */ { @@ -335,7 +320,6 @@ class FileLogger implements LoggerInterface * @return null * * @since 1.0.0 - * @author Dennis Eichhorn */ public function emergency(string $message, array $context = []) /* : void */ { @@ -355,7 +339,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function alert(string $message, array $context = []) /* : void */ { @@ -374,7 +357,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function critical(string $message, array $context = []) /* : void */ { @@ -392,7 +374,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function error(string $message, array $context = []) /* : void */ { @@ -412,7 +393,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function warning(string $message, array $context = []) /* : void */ { @@ -429,7 +409,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function notice(string $message, array $context = []) /* : void */ { @@ -448,7 +427,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function info(string $message, array $context = []) /* : void */ { @@ -465,7 +443,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function debug(string $message, array $context = []) /* : void */ { @@ -483,7 +460,6 @@ class FileLogger implements LoggerInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function log(string $level, string $message, array $context = []) /* : void */ { @@ -656,9 +632,8 @@ class FileLogger implements LoggerInterface * @param bool $verbose Is verbose * @param array $context Context * - * @return array */ - public function console(string $message, bool $verbose = true, array $context = []) + public function console(string $message, bool $verbose = true, array $context = []) /* : void */ { $message = date('[Y-m-d H:i:s] ') . $message . "\r\n"; diff --git a/Log/LogLevel.php b/Log/LogLevel.php index 1b604a17d..c12411d4d 100644 --- a/Log/LogLevel.php +++ b/Log/LogLevel.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Log; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Log level enum. * * @category Framework * @package phpOMS\Log - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Log/LoggerInterface.php b/Log/LoggerInterface.php index a20346096..574763d69 100644 --- a/Log/LoggerInterface.php +++ b/Log/LoggerInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Log; * * @category Framework * @package phpOMS\Log - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Differential/FiniteDifference.php b/Math/Differential/FiniteDifference.php index d439df09b..892c93f4e 100644 --- a/Math/Differential/FiniteDifference.php +++ b/Math/Differential/FiniteDifference.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Math\Parser\Evaluator; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -51,7 +47,6 @@ class FiniteDifference * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getNewtonDifferenceQuotient(string $formula, array $variable) : float { @@ -69,7 +64,6 @@ class FiniteDifference * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSymmetricDifferenceQuotient(string $formula, array $variable) : float { @@ -90,7 +84,6 @@ class FiniteDifference * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFivePointStencil(string $formula, array $variable, int $derivative = 1) : float { diff --git a/Math/Exception/ZeroDevisionException.php b/Math/Exception/ZeroDevisionException.php new file mode 100644 index 000000000..74bad5cfd --- /dev/null +++ b/Math/Exception/ZeroDevisionException.php @@ -0,0 +1,42 @@ + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,9 +13,9 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Finance\Forecasting\ExponentialSmoothing; +namespace phpOMS\Business\Finance\Forecasting\ExponentialSmoothing; -use phpOMS\Math\Finance\Forecasting\SmoothingType; +use phpOMS\Business\Finance\Forecasting\SmoothingType; use phpOMS\Math\Statistic\Average; use phpOMS\Math\Statistic\Forecast\Error; diff --git a/Math/Functions/Fibunacci.php b/Math/Functions/Fibunacci.php index 9325e12f8..e886f9c4f 100644 --- a/Math/Functions/Fibunacci.php +++ b/Math/Functions/Fibunacci.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Math\Number\Numbers; * * @category Framework * @package phpOMS\Math\Function - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class Fibunacci * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isFibunacci(int $n) : bool { @@ -57,7 +52,6 @@ class Fibunacci * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function fibunacci(int $n, int $start = 1) : int { @@ -86,7 +80,6 @@ class Fibunacci * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function binet(int $n) : int { diff --git a/Math/Functions/Functions.php b/Math/Functions/Functions.php index a4381130a..6b735c79c 100644 --- a/Math/Functions/Functions.php +++ b/Math/Functions/Functions.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Functions; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class Functions * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getGammaInteger(int $k) : int { @@ -58,7 +53,6 @@ class Functions * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function fact(int $n, int $start = 1) : int { @@ -84,7 +78,6 @@ class Functions * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function binomialCoefficient(int $n, int $k) : int { @@ -126,7 +119,6 @@ class Functions * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function ackermann(int $m, int $n) : int { @@ -147,7 +139,6 @@ class Functions * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function abs(array $values) : array { @@ -169,7 +160,6 @@ class Functions * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function invMod(int $a, int $n) : int { @@ -216,7 +206,6 @@ class Functions * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mod($a, $b) : int { @@ -235,15 +224,10 @@ class Functions * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isOdd($a) : bool { - if ($a & 1) { - return true; - } - - return false; + return $a & 1; } /** @@ -254,15 +238,10 @@ class Functions * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isEven($a) : bool { - if ($a & 1) { - return false; - } - - return true; + return !($a & 1); } /** @@ -278,7 +257,6 @@ class Functions * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRelativeDegree($value, $length, $start = 0) : int { diff --git a/Math/Geometry/ConvexHull/MonotoneChain.php b/Math/Geometry/ConvexHull/MonotoneChain.php index c6a4d7e3a..e27659438 100644 --- a/Math/Geometry/ConvexHull/MonotoneChain.php +++ b/Math/Geometry/ConvexHull/MonotoneChain.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Geometry\ConvexHull; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ final class MonotoneChain * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function createConvexHull(array $points) : array { @@ -88,7 +83,6 @@ final class MonotoneChain * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function cross(array $a, array $b, array $c) : float { @@ -104,7 +98,6 @@ final class MonotoneChain * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function sort(array $a, array $b) : float { diff --git a/Math/Shape/D2/Circle.php b/Math/Geometry/Shape/D2/Circle.php similarity index 76% rename from Math/Shape/D2/Circle.php rename to Math/Geometry/Shape/D2/Circle.php index e70baeb6f..996785427 100644 --- a/Math/Shape/D2/Circle.php +++ b/Math/Geometry/Shape/D2/Circle.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D2; +namespace phpOMS\Math\Geometry\Shape\D2; /** * Circle shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class Circle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $r) : float { @@ -54,7 +49,6 @@ class Circle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPerimeter(float $r) : float { @@ -69,7 +63,6 @@ class Circle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRadiusBySurface(float $surface) : float { @@ -84,7 +77,6 @@ class Circle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRadiusByPerimeter(float $C) : float { diff --git a/Math/Shape/D2/D2ShapeInterface.php b/Math/Geometry/Shape/D2/D2ShapeInterface.php similarity index 63% rename from Math/Shape/D2/D2ShapeInterface.php rename to Math/Geometry/Shape/D2/D2ShapeInterface.php index 2bf425c5e..47be0c709 100644 --- a/Math/Shape/D2/D2ShapeInterface.php +++ b/Math/Geometry/Shape/D2/D2ShapeInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D2; +namespace phpOMS\Math\Geometry\Shape\D2; -use phpOMS\Math\Shape\ShapeInterface; +use phpOMS\Math\Geometry\Shape\ShapeInterface; /** * Shape interface. * * @category Framework * @package phpOMS\Math - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Shape/D2/Ellipse.php b/Math/Geometry/Shape/D2/Ellipse.php similarity index 79% rename from Math/Shape/D2/Ellipse.php rename to Math/Geometry/Shape/D2/Ellipse.php index 9eb643390..289f1c297 100644 --- a/Math/Shape/D2/Ellipse.php +++ b/Math/Geometry/Shape/D2/Ellipse.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D2; +namespace phpOMS\Math\Geometry\Shape\D2; /** * Ellipse shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,7 +41,6 @@ class Ellipse implements D2ShapeInterface * @return float Distance between points in meter * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $a, float $b) : float { @@ -66,7 +61,6 @@ class Ellipse implements D2ShapeInterface * @return float Distance between points in meter * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPerimeter(float $a, float $b) : float { diff --git a/Math/Shape/D2/Polygon.php b/Math/Geometry/Shape/D2/Polygon.php similarity index 93% rename from Math/Shape/D2/Polygon.php rename to Math/Geometry/Shape/D2/Polygon.php index ad3a77391..a003b6341 100644 --- a/Math/Shape/D2/Polygon.php +++ b/Math/Geometry/Shape/D2/Polygon.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D2; +namespace phpOMS\Math\Geometry\Shape\D2; /** * Polygon class. * * @category Framework * @package phpOMS\Math - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -116,7 +112,6 @@ class Polygon implements D2ShapeInterface * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -130,7 +125,6 @@ class Polygon implements D2ShapeInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function pointInPolygon(array $point) : int { @@ -146,7 +140,6 @@ class Polygon implements D2ShapeInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isPointInPolygon(array $point, array $polygon) : int { @@ -203,7 +196,6 @@ class Polygon implements D2ShapeInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function onVertex(array $point) : bool { @@ -219,7 +211,6 @@ class Polygon implements D2ShapeInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function isOnVertex(array $point, array $polygon) : bool { @@ -240,7 +231,6 @@ class Polygon implements D2ShapeInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCoordinates($coord) /* : void */ { @@ -257,7 +247,6 @@ class Polygon implements D2ShapeInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCoordinate($i, $x, $y) /* : void */ { diff --git a/Math/Shape/D2/Quadrilateral.php b/Math/Geometry/Shape/D2/Quadrilateral.php similarity index 68% rename from Math/Shape/D2/Quadrilateral.php rename to Math/Geometry/Shape/D2/Quadrilateral.php index 6ca958581..a2eb21912 100644 --- a/Math/Shape/D2/Quadrilateral.php +++ b/Math/Geometry/Shape/D2/Quadrilateral.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Shape\D2; + namespace phpOMS\Math\Geometry\Shape\D2; class Quadrilateral implements D2ShapeInterface { diff --git a/Math/Shape/D2/Rectangle.php b/Math/Geometry/Shape/D2/Rectangle.php similarity index 76% rename from Math/Shape/D2/Rectangle.php rename to Math/Geometry/Shape/D2/Rectangle.php index 615b3a899..05d43d330 100644 --- a/Math/Shape/D2/Rectangle.php +++ b/Math/Geometry/Shape/D2/Rectangle.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D2; +namespace phpOMS\Math\Geometry\Shape\D2; /** * Rectangle shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class Rectangle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $a, float $b) : float { @@ -56,7 +51,6 @@ class Rectangle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPerimeter(float $a, float $b) : float { @@ -72,7 +66,6 @@ class Rectangle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDiagonal(float $a, float $b) : float { diff --git a/Math/Shape/D2/Trapezoid.php b/Math/Geometry/Shape/D2/Trapezoid.php similarity index 86% rename from Math/Shape/D2/Trapezoid.php rename to Math/Geometry/Shape/D2/Trapezoid.php index d1b62c792..a0943ea2b 100644 --- a/Math/Shape/D2/Trapezoid.php +++ b/Math/Geometry/Shape/D2/Trapezoid.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D2; +namespace phpOMS\Math\Geometry\Shape\D2; /** * Trapezoid shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -47,7 +43,6 @@ class Trapezoid implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $a, float $b, float $h) : float { @@ -71,7 +66,6 @@ class Trapezoid implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPerimeter(float $a, float $b, float $c, float $d) : float { @@ -94,7 +88,6 @@ class Trapezoid implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getHeight(float $area, float $a, float $b) : float { @@ -117,7 +110,6 @@ class Trapezoid implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getA(float $area, float $h, float $b) : float { @@ -140,7 +132,6 @@ class Trapezoid implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getB(float $area, float $h, float $a) : float { @@ -164,7 +155,6 @@ class Trapezoid implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getC(float $perimeter, float $a, float $b, float $d) : float { @@ -188,7 +178,6 @@ class Trapezoid implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getD(float $perimeter, float $a, float $b, float $c) : float { diff --git a/Math/Shape/D2/Triangle.php b/Math/Geometry/Shape/D2/Triangle.php similarity index 78% rename from Math/Shape/D2/Triangle.php rename to Math/Geometry/Shape/D2/Triangle.php index ed6e6a36d..4493d196b 100644 --- a/Math/Shape/D2/Triangle.php +++ b/Math/Geometry/Shape/D2/Triangle.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D2; +namespace phpOMS\Math\Geometry\Shape\D2; /** * Triangle shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class Triangle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $b, float $h) : float { @@ -63,7 +58,6 @@ class Triangle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPerimeter(float $a, float $b, float $c) : float { @@ -79,7 +73,6 @@ class Triangle implements D2ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getHeight(float $area, float $b) : float { diff --git a/Math/Shape/D3/Cone.php b/Math/Geometry/Shape/D3/Cone.php similarity index 78% rename from Math/Shape/D3/Cone.php rename to Math/Geometry/Shape/D3/Cone.php index c0e5ccbc6..2dc80e45e 100644 --- a/Math/Shape/D3/Cone.php +++ b/Math/Geometry/Shape/D3/Cone.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D3; +namespace phpOMS\Math\Geometry\Shape\D3; /** * Cone shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class Cone implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVolume(float $r, float $h) : float { @@ -56,7 +51,6 @@ class Cone implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $r, float $h) : float { @@ -72,7 +66,6 @@ class Cone implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSlantHeight(float $r, float $h) : float { @@ -88,7 +81,6 @@ class Cone implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getHeightFromVolume(float $V, float $r) : float { diff --git a/Math/Shape/D3/Cuboid.php b/Math/Geometry/Shape/D3/Cuboid.php similarity index 76% rename from Math/Shape/D3/Cuboid.php rename to Math/Geometry/Shape/D3/Cuboid.php index e803dab55..35ce4f6ae 100644 --- a/Math/Shape/D3/Cuboid.php +++ b/Math/Geometry/Shape/D3/Cuboid.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D3; +namespace phpOMS\Math\Geometry\Shape\D3; /** * Cuboid shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class Cuboid implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVolume(float $a, float $b, float $h) : float { @@ -58,7 +53,6 @@ class Cuboid implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $a, float $b, float $h) : float { diff --git a/Math/Shape/D3/Cylinder.php b/Math/Geometry/Shape/D3/Cylinder.php similarity index 77% rename from Math/Shape/D3/Cylinder.php rename to Math/Geometry/Shape/D3/Cylinder.php index 38a7671f0..2062250e0 100644 --- a/Math/Shape/D3/Cylinder.php +++ b/Math/Geometry/Shape/D3/Cylinder.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D3; +namespace phpOMS\Math\Geometry\Shape\D3; /** * Cylinder shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class Cylinder implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVolume(float $r, float $h) : float { @@ -56,7 +51,6 @@ class Cylinder implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $r, float $h) : float { @@ -72,7 +66,6 @@ class Cylinder implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getLateralSurface(float $r, float $h) : float { diff --git a/Math/Shape/D3/D3ShapeInterface.php b/Math/Geometry/Shape/D3/D3ShapeInterface.php similarity index 63% rename from Math/Shape/D3/D3ShapeInterface.php rename to Math/Geometry/Shape/D3/D3ShapeInterface.php index 03922f936..af28edc99 100644 --- a/Math/Shape/D3/D3ShapeInterface.php +++ b/Math/Geometry/Shape/D3/D3ShapeInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D3; +namespace phpOMS\Math\Geometry\Shape\D3; -use phpOMS\Math\Shape\ShapeInterface; +use phpOMS\Math\Geometry\Shape\ShapeInterface; /** * Shape interface. * * @category Framework * @package phpOMS\Math - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Shape/D3/Prism.php b/Math/Geometry/Shape/D3/Prism.php similarity index 68% rename from Math/Shape/D3/Prism.php rename to Math/Geometry/Shape/D3/Prism.php index 7de5b0b54..f6ba669a5 100644 --- a/Math/Shape/D3/Prism.php +++ b/Math/Geometry/Shape/D3/Prism.php @@ -6,15 +6,13 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Math\Shape\D3; + namespace phpOMS\Math\Geometry\Shape\D3; class Prism implements D3ShapeInterface { diff --git a/Math/Shape/D3/RectangularPyramid.php b/Math/Geometry/Shape/D3/RectangularPyramid.php similarity index 79% rename from Math/Shape/D3/RectangularPyramid.php rename to Math/Geometry/Shape/D3/RectangularPyramid.php index c26d02691..2c437a905 100644 --- a/Math/Shape/D3/RectangularPyramid.php +++ b/Math/Geometry/Shape/D3/RectangularPyramid.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D3; +namespace phpOMS\Math\Geometry\Shape\D3; /** * Rectangular pyramid shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class RectangularPyramid implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVolume(float $a, float $b, float $h) : float { @@ -58,7 +53,6 @@ class RectangularPyramid implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $a, float $b, float $h) : float { @@ -75,7 +69,6 @@ class RectangularPyramid implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getLateralSurface(float $a, float $b, float $h) : float { diff --git a/Math/Shape/D3/Sphere.php b/Math/Geometry/Shape/D3/Sphere.php similarity index 83% rename from Math/Shape/D3/Sphere.php rename to Math/Geometry/Shape/D3/Sphere.php index 285a2e714..334e872b6 100644 --- a/Math/Shape/D3/Sphere.php +++ b/Math/Geometry/Shape/D3/Sphere.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D3; +namespace phpOMS\Math\Geometry\Shape\D3; /** * Sphere shape. * * @category Framework - * @package phpOMS\Math\Shape - * @author OMS Development Team - * @author Dennis Eichhorn + * @package phpOMS\Math\Geometry\Shape * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ class Sphere implements D3ShapeInterface * @param float $radius Sphere radius * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(float $radius) { @@ -63,7 +58,6 @@ class Sphere implements D3ShapeInterface * @return float Distance between points in meter * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function distance2PointsOnSphere(float $latStart, float $longStart, float $latEnd, float $longEnd, float $radius = 6371000.0) : float { @@ -93,7 +87,6 @@ class Sphere implements D3ShapeInterface * @return Sphere * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function byRadius(float $r) : Sphere { @@ -108,7 +101,6 @@ class Sphere implements D3ShapeInterface * @return Sphere * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function byVolume(float $v) : Sphere { @@ -123,7 +115,6 @@ class Sphere implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRadiusByVolume(float $v) : float { @@ -138,7 +129,6 @@ class Sphere implements D3ShapeInterface * @return Sphere * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function bySurface(float $s) : Sphere { @@ -153,7 +143,6 @@ class Sphere implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRadiusBySurface(float $S) : float { @@ -166,7 +155,6 @@ class Sphere implements D3ShapeInterface * @return float Sphere volume * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getVolume() : float { @@ -181,7 +169,6 @@ class Sphere implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVolumeByRadius(float $r) : float { @@ -194,7 +181,6 @@ class Sphere implements D3ShapeInterface * @return float Sphere radius * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRadius() : float { @@ -207,7 +193,6 @@ class Sphere implements D3ShapeInterface * @return float Sphere surface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSurface() : float { @@ -222,7 +207,6 @@ class Sphere implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurfaceByRadius(float $r) : float { diff --git a/Math/Shape/D3/Tetrahedron.php b/Math/Geometry/Shape/D3/Tetrahedron.php similarity index 75% rename from Math/Shape/D3/Tetrahedron.php rename to Math/Geometry/Shape/D3/Tetrahedron.php index 54b2708db..e50351841 100644 --- a/Math/Shape/D3/Tetrahedron.php +++ b/Math/Geometry/Shape/D3/Tetrahedron.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape\D3; +namespace phpOMS\Math\Geometry\Shape\D3; /** * Tetraedron shape. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class Tetrahedron implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVolume(float $a) : float { @@ -54,7 +49,6 @@ class Tetrahedron implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSurface(float $a) : float { @@ -69,7 +63,6 @@ class Tetrahedron implements D3ShapeInterface * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFaceArea(float $a) : float { diff --git a/Math/Shape/ShapeInterface.php b/Math/Geometry/Shape/ShapeInterface.php similarity index 66% rename from Math/Shape/ShapeInterface.php rename to Math/Geometry/Shape/ShapeInterface.php index 258a84425..8e336e504 100644 --- a/Math/Shape/ShapeInterface.php +++ b/Math/Geometry/Shape/ShapeInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Math\Shape; +namespace phpOMS\Math\Geometry\Shape; /** * Shape interface. * * @category Framework * @package phpOMS\Math - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Integral/Gauss.php b/Math/Integral/Gauss.php index 0146f3e1a..5618df6ba 100644 --- a/Math/Integral/Gauss.php +++ b/Math/Integral/Gauss.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Matrix/Cholesky.php b/Math/Matrix/Cholesky.php index 2c4f7943b..3d4237aad 100644 --- a/Math/Matrix/Cholesky.php +++ b/Math/Matrix/Cholesky.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Matrix/Exception/InvalidDimensionException.php b/Math/Matrix/Exception/InvalidDimensionException.php new file mode 100644 index 000000000..a63fb845b --- /dev/null +++ b/Math/Matrix/Exception/InvalidDimensionException.php @@ -0,0 +1,42 @@ + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Matrix; * * @category Framework * @package phpOMS\Math\Matrix - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -36,7 +32,6 @@ class IdentityMatrix extends Matrix * @param int $n Matrix dimension * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __constrcut(int $n) { diff --git a/Math/Matrix/InverseType.php b/Math/Matrix/InverseType.php index db286efe1..d58908585 100644 --- a/Math/Matrix/InverseType.php +++ b/Math/Matrix/InverseType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Matrix; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Inverse type enum. * * @category Framework * @package phpOMS\Math\Matrix - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index f4359f1b1..c040dc0c9 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,13 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Matrix; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; + /** * Matrix class * * @category Framework * @package phpOMS\Math\Matrix - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -69,7 +67,6 @@ class Matrix implements \ArrayAccess, \Iterator * @param int $n Columns * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(int $m, int $n = 1) { @@ -88,15 +85,14 @@ class Matrix implements \ArrayAccess, \Iterator * @param int $n Column * @param int $value Value * - * @throws DimensionException + * @throws InvalidDimensionException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(int $m, int $n, $value) /* : void */ { if (!isset($this->matrix[$m][$n])) { - throw new DimensionException($m, $n); + throw new InvalidDimensionException($m . 'x' . $n); } $this->matrix[$m][$n] = $value; @@ -110,15 +106,14 @@ class Matrix implements \ArrayAccess, \Iterator * * @return mixed * - * @throws DimensionException + * @throws InvalidDimensionException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(int $m, int $n) { if (!isset($this->matrix[$m][$n])) { - throw new DimensionException($m, $n); + throw new InvalidDimensionException($m . 'x' . $n); } return $this->matrix[$m][$n]; @@ -130,7 +125,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return Matrix * * @since 1.0.0 - * @author Dennis Eichhorn */ public function transpose() : Matrix { @@ -146,7 +140,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMatrix() : array { @@ -159,7 +152,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function rank() : int { @@ -176,12 +168,11 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setMatrix(array $matrix) : Matrix { if ($this->m !== count($matrix) || $this->n !== count($matrix[0])) { - throw new DimensionException(count($matrix), count($matrix[0])); + throw new InvalidDimensionException(count($matrix) . 'x' . count($matrix[0])); } $this->matrix = $matrix; @@ -199,7 +190,6 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function sub($value) : Matrix { @@ -222,7 +212,6 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add($value) : Matrix { @@ -245,12 +234,11 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function addMatrix(Matrix $matrix) : Matrix { if ($this->m !== $matrix->getM() || $this->n !== $matrix->getN()) { - throw new DimensionException($matrix->getM(), $matrix->getN()); + throw new InvalidDimensionException($matrix->getM() . 'x' . $matrix->getN()); } $matrixArr = $matrix->getMatrix(); @@ -274,7 +262,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getM() : int { @@ -287,7 +274,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getN() : int { @@ -304,7 +290,6 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function addScalar($scalar) : Matrix { @@ -332,7 +317,6 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function mult($value) : Matrix { @@ -355,7 +339,6 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function multMatrix(Matrix $matrix) : Matrix { @@ -363,7 +346,7 @@ class Matrix implements \ArrayAccess, \Iterator $mDim = $matrix->getM(); if ($this->n !== $mDim) { - throw new DimensionException($mDim, $nDim); + throw new InvalidDimensionException($mDim . 'x' . $nDim); } $matrixArr = $matrix->getMatrix(); @@ -397,7 +380,6 @@ class Matrix implements \ArrayAccess, \Iterator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function multScalar($scalar) : Matrix { @@ -421,7 +403,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return Matrix * * @since 1.0.0 - * @author Dennis Eichhorn */ public function upperTriangular() : Matrix { @@ -442,7 +423,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return int Det sign * * @since 1.0.0 - * @author Dennis Eichhorn */ private function upperTrianglize(array &$arr) : int { @@ -491,7 +471,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return Matrix * * @since 1.0.0 - * @author Dennis Eichhorn */ public function lowerTriangular() : Matrix { @@ -506,15 +485,14 @@ class Matrix implements \ArrayAccess, \Iterator * * @return Matrix * - * @throws \Exception + * @throws InvalidDimensionException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function inverse(int $algorithm = InverseType::GAUSS_JORDAN) : Matrix { if ($this->n !== $this->m) { - throw new DimensionException($this->m, $this->n); + throw new InvalidDimensionException($this->m . 'x' . $this->n); } switch ($algorithm) { @@ -531,7 +509,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return Matrix * * @since 1.0.0 - * @author Dennis Eichhorn */ private function inverseGaussJordan() : Matrix { @@ -653,7 +630,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function diag(array $arr) : array { @@ -692,7 +668,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public function det() : float { @@ -840,7 +815,6 @@ class Matrix implements \ArrayAccess, \Iterator * @return Matrix * * @since 1.0.0 - * @author Dennis Eichhorn */ private function decompositionCholesky() : Matrix { diff --git a/Math/Matrix/Vector.php b/Math/Matrix/Vector.php index b30e376c1..7bae8060e 100644 --- a/Math/Matrix/Vector.php +++ b/Math/Matrix/Vector.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Matrix; * * @category Framework * @package phpOMS\Math\Matrix - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -36,7 +32,6 @@ class Vector extends Matrix * @param int $m Columns * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(int $m) { diff --git a/Math/Number/Complex.php b/Math/Number/Complex.php index 912002978..1e45f3436 100644 --- a/Math/Number/Complex.php +++ b/Math/Number/Complex.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Number/Integer.php b/Math/Number/Integer.php index 90f3acba6..992b2138d 100644 --- a/Math/Number/Integer.php +++ b/Math/Number/Integer.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Number; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class Integer * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isInteger($value) : bool { @@ -53,7 +48,6 @@ class Integer * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function trialFactorization(int $value) : array { @@ -96,7 +90,6 @@ class Integer * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function pollardsRho(int $n, int $x = 2, int $factor = 1, int $cycleSize = 2, int $y = 2) : int { @@ -122,7 +115,6 @@ class Integer * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function greatestCommonDivisor(int $n, int $m) : int { @@ -151,7 +143,6 @@ class Integer * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function fermatFactor(int $value, int $limit = 1000000) : array { diff --git a/Math/Number/Irrational.php b/Math/Number/Irrational.php index 777d8a57d..8e6ececc5 100644 --- a/Math/Number/Irrational.php +++ b/Math/Number/Irrational.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Number/Natural.php b/Math/Number/Natural.php index aa7f95789..0cd79144f 100644 --- a/Math/Number/Natural.php +++ b/Math/Number/Natural.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Number; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class Natural * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isNatural($value) : bool { diff --git a/Math/Number/NumberType.php b/Math/Number/NumberType.php index e93b79811..de6d487ea 100644 --- a/Math/Number/NumberType.php +++ b/Math/Number/NumberType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Number; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Number type enum. * * @category Framework * @package Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Number/Numbers.php b/Math/Number/Numbers.php index 259849641..c82304bf7 100644 --- a/Math/Number/Numbers.php +++ b/Math/Number/Numbers.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Number; * * @category Framework * @package Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class Numbers * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isPerfect(int $n) : bool { @@ -61,7 +56,6 @@ class Numbers * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isSelfdescribing(int $n) : bool { @@ -85,7 +79,6 @@ class Numbers * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isSquare(int $n) : bool { @@ -100,7 +93,6 @@ class Numbers * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function countTrailingZeros(int $n) : int { diff --git a/Math/Number/OperationInterface.php b/Math/Number/OperationInterface.php index 05b4421a5..0e6082435 100644 --- a/Math/Number/OperationInterface.php +++ b/Math/Number/OperationInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Number; * * @category Framework * @package phpOMS\Account - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ interface OperationInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add($x); @@ -50,7 +45,6 @@ interface OperationInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function sub($x); @@ -62,7 +56,6 @@ interface OperationInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function mult($x); @@ -74,7 +67,6 @@ interface OperationInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function div($x); @@ -86,7 +78,6 @@ interface OperationInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function pow($p); @@ -96,7 +87,6 @@ interface OperationInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function abs(); } \ No newline at end of file diff --git a/Math/Number/Prime.php b/Math/Number/Prime.php index 01cff7de9..a8e5ad977 100644 --- a/Math/Number/Prime.php +++ b/Math/Number/Prime.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Number; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class Prime * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isMersenne(int $n) : bool { @@ -55,7 +50,6 @@ class Prime * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mersenne(int $p) : int { @@ -71,7 +65,6 @@ class Prime * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function rabinTest(int $n, int $k = 10000) : bool { @@ -126,7 +119,6 @@ class Prime * @return int[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function sieveOfEratosthenes(int $n) : array { @@ -157,7 +149,6 @@ class Prime * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isPrime(int $n) : bool { diff --git a/Math/Number/Rational.php b/Math/Number/Rational.php index 016868f1f..b09b21f8b 100644 --- a/Math/Number/Rational.php +++ b/Math/Number/Rational.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Number/Real.php b/Math/Number/Real.php index b8b9ff564..64af2f956 100644 --- a/Math/Number/Real.php +++ b/Math/Number/Real.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Numerics/Interpolation/CubicSplineInterpolation.php b/Math/Numerics/Interpolation/CubicSplineInterpolation.php index a94e72fd3..84f1b5a01 100644 --- a/Math/Numerics/Interpolation/CubicSplineInterpolation.php +++ b/Math/Numerics/Interpolation/CubicSplineInterpolation.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Numerics\Interpolation; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Numerics/Interpolation/LinearInterpolation.php b/Math/Numerics/Interpolation/LinearInterpolation.php index 40f74e97b..6ef4109b8 100644 --- a/Math/Numerics/Interpolation/LinearInterpolation.php +++ b/Math/Numerics/Interpolation/LinearInterpolation.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Numerics\Interpolation; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Numerics/Interpolation/PolynomialInterpolation.php b/Math/Numerics/Interpolation/PolynomialInterpolation.php index 79d2802ab..b9caea664 100644 --- a/Math/Numerics/Interpolation/PolynomialInterpolation.php +++ b/Math/Numerics/Interpolation/PolynomialInterpolation.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Numerics\Interpolation; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Optimization/AssignmentProblem.php b/Math/Optimization/AssignmentProblem.php new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/Math/Optimization/AssignmentProblem.php @@ -0,0 +1 @@ + diff --git a/Math/Optimization/GeneticAlgorithmInterface.php b/Math/Optimization/GeneticAlgorithmInterface.php index 060c4b576..6705ea7ee 100644 --- a/Math/Optimization/GeneticAlgorithmInterface.php +++ b/Math/Optimization/GeneticAlgorithmInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Optimization/Graph/Dijkstra.php b/Math/Optimization/Graph/Dijkstra.php index dfaef4f1e..49ca19e1f 100644 --- a/Math/Optimization/Graph/Dijkstra.php +++ b/Math/Optimization/Graph/Dijkstra.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/Graph/EdgeInterface.php b/Math/Optimization/Graph/EdgeInterface.php index 71a0aef2b..937648621 100644 --- a/Math/Optimization/Graph/EdgeInterface.php +++ b/Math/Optimization/Graph/EdgeInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization\Graph; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -36,7 +32,6 @@ interface EdgeInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getId(); @@ -46,7 +41,6 @@ interface EdgeInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getWeight(); @@ -56,7 +50,6 @@ interface EdgeInterface * @param mixed $weight Weight of edge * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setWeight($weight); @@ -66,7 +59,6 @@ interface EdgeInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getVertices() : array; @@ -77,7 +69,6 @@ interface EdgeInterface * @param VerticeInterface $b Vertice b * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setVertices(VerticeInterface $a, VerticeInterface $b); } \ No newline at end of file diff --git a/Math/Optimization/Graph/FloydWarshall.php b/Math/Optimization/Graph/FloydWarshall.php index b38c06e86..1257aabe9 100644 --- a/Math/Optimization/Graph/FloydWarshall.php +++ b/Math/Optimization/Graph/FloydWarshall.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/Graph/Graph.php b/Math/Optimization/Graph/Graph.php index 512d04e97..1cd85c6c3 100644 --- a/Math/Optimization/Graph/Graph.php +++ b/Math/Optimization/Graph/Graph.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\Stdlib\Map\OrderType; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -54,7 +50,6 @@ class Graph * Constructor * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -69,7 +64,6 @@ class Graph * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addVertice(VerticeInterface $vertice) : bool { @@ -90,7 +84,6 @@ class Graph * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addEdge(EdgeInterface $edge) : bool { @@ -111,7 +104,6 @@ class Graph * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeVertice($id) : bool { @@ -133,7 +125,6 @@ class Graph * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeEdge($a, $b) : bool { @@ -148,7 +139,6 @@ class Graph * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeEdgeById($id) : bool { @@ -169,7 +159,6 @@ class Graph * @return VerticeInterface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getVertice($id) : VerticeInterface { @@ -187,7 +176,6 @@ class Graph * @return EdgeInterface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEdge($a, $b) : EdgeInterface { @@ -202,7 +190,6 @@ class Graph * @return EdgeInterface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEdgeById(int $id) : EdgeInterface { @@ -215,7 +202,6 @@ class Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function countVertices() : int { @@ -228,7 +214,6 @@ class Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function countEdges() : int { diff --git a/Math/Optimization/Graph/NullEdge.php b/Math/Optimization/Graph/NullEdge.php index bae587b4a..27c324783 100644 --- a/Math/Optimization/Graph/NullEdge.php +++ b/Math/Optimization/Graph/NullEdge.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ namespace phpOMS\Math\Optimization\Graph; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Optimization/Graph/NullVertice.php b/Math/Optimization/Graph/NullVertice.php index 631fff565..19cb5c5f0 100644 --- a/Math/Optimization/Graph/NullVertice.php +++ b/Math/Optimization/Graph/NullVertice.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ namespace phpOMS\Math\Optimization\Graph; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Optimization/Graph/VerticeInterface.php b/Math/Optimization/Graph/VerticeInterface.php index 9b63a2761..4724b5ceb 100644 --- a/Math/Optimization/Graph/VerticeInterface.php +++ b/Math/Optimization/Graph/VerticeInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization\Graph; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -36,7 +32,6 @@ interface VerticeInterface * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getId(); @@ -46,7 +41,6 @@ interface VerticeInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEdges() : array; @@ -58,7 +52,6 @@ interface VerticeInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addEdge(EdgeInterface $edge) : bool; } diff --git a/Math/Optimization/Knappsack/Backpack.php b/Math/Optimization/Knappsack/Backpack.php index da13bf79a..eb15addd1 100644 --- a/Math/Optimization/Knappsack/Backpack.php +++ b/Math/Optimization/Knappsack/Backpack.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/Knappsack/BruteForce.php b/Math/Optimization/Knappsack/BruteForce.php index 420e5b522..8887394d1 100644 --- a/Math/Optimization/Knappsack/BruteForce.php +++ b/Math/Optimization/Knappsack/BruteForce.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/Knappsack/GA.php b/Math/Optimization/Knappsack/GA.php index 4e98fc7fc..c01faddf3 100644 --- a/Math/Optimization/Knappsack/GA.php +++ b/Math/Optimization/Knappsack/GA.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/Knappsack/Item.php b/Math/Optimization/Knappsack/Item.php index cde2a27f5..2b396d108 100644 --- a/Math/Optimization/Knappsack/Item.php +++ b/Math/Optimization/Knappsack/Item.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/Knappsack/ItemPool.php b/Math/Optimization/Knappsack/ItemPool.php index 4f05681e5..676ad5780 100644 --- a/Math/Optimization/Knappsack/ItemPool.php +++ b/Math/Optimization/Knappsack/ItemPool.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/Knappsack/Population.php b/Math/Optimization/Knappsack/Population.php index 3a70b8dcc..eeb6f279c 100644 --- a/Math/Optimization/Knappsack/Population.php +++ b/Math/Optimization/Knappsack/Population.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/ShiftScheduling/BruteForce.php b/Math/Optimization/ShiftScheduling/BruteForce.php index dff47946c..2e23e980f 100644 --- a/Math/Optimization/ShiftScheduling/BruteForce.php +++ b/Math/Optimization/ShiftScheduling/BruteForce.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/ShiftScheduling/GA.php b/Math/Optimization/ShiftScheduling/GA.php index 3cfa8860d..86560a2b3 100644 --- a/Math/Optimization/ShiftScheduling/GA.php +++ b/Math/Optimization/ShiftScheduling/GA.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/ShiftScheduling/Population.php b/Math/Optimization/ShiftScheduling/Population.php index 599585bae..ab8bad8c1 100644 --- a/Math/Optimization/ShiftScheduling/Population.php +++ b/Math/Optimization/ShiftScheduling/Population.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/ShiftScheduling/Workday.php b/Math/Optimization/ShiftScheduling/Workday.php index 625509da5..482bd43b0 100644 --- a/Math/Optimization/ShiftScheduling/Workday.php +++ b/Math/Optimization/ShiftScheduling/Workday.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/ShiftScheduling/Worker.php b/Math/Optimization/ShiftScheduling/Worker.php index 4ebff2bbc..2dae946b4 100644 --- a/Math/Optimization/ShiftScheduling/Worker.php +++ b/Math/Optimization/ShiftScheduling/Worker.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/ShiftScheduling/WorkerPool.php b/Math/Optimization/ShiftScheduling/WorkerPool.php index ba1184d58..64bb3fadd 100644 --- a/Math/Optimization/ShiftScheduling/WorkerPool.php +++ b/Math/Optimization/ShiftScheduling/WorkerPool.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Optimization/TSP/BruteForce.php b/Math/Optimization/TSP/BruteForce.php index 340a4c490..16a67e3ec 100644 --- a/Math/Optimization/TSP/BruteForce.php +++ b/Math/Optimization/TSP/BruteForce.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization\TSP; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -54,7 +50,6 @@ class BruteForce * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(CityPool $pool) { @@ -73,7 +68,6 @@ class BruteForce * @return Population * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSolution(int $limit = 1) : Population { @@ -95,7 +89,6 @@ class BruteForce * @return Population * * @since 1.0.0 - * @author Dennis Eichhorn */ private function bruteForce(array $cities, Tour $tour, Population $population) { diff --git a/Math/Optimization/TSP/City.php b/Math/Optimization/TSP/City.php index 6acd33c7a..d2e45f0f7 100644 --- a/Math/Optimization/TSP/City.php +++ b/Math/Optimization/TSP/City.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Optimization\TSP; -use phpOMS\Math\Shape\D3\Sphere; +use phpOMS\Math\Geometry\Shape\D3\Sphere; /** * City class. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -64,7 +60,6 @@ class City * @param string $name City name * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(float $lat, float $long, string $name) { @@ -81,7 +76,6 @@ class City * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function equals(City $city) : bool { @@ -94,7 +88,6 @@ class City * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -107,7 +100,6 @@ class City * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLatitude() : float { @@ -122,7 +114,6 @@ class City * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDistanceTo(City $city) : float { @@ -135,7 +126,6 @@ class City * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLongitude() : float { diff --git a/Math/Optimization/TSP/CityPool.php b/Math/Optimization/TSP/CityPool.php index 4f6b0a460..3a3ede868 100644 --- a/Math/Optimization/TSP/CityPool.php +++ b/Math/Optimization/TSP/CityPool.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization\TSP; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ class CityPool implements \Countable * @param City[] $cities Cities * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(array $cities = []) { @@ -57,7 +52,6 @@ class CityPool implements \Countable * @param City $city City * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addCity(City $city) { @@ -72,7 +66,6 @@ class CityPool implements \Countable * @return City * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCity(int $index) : City { @@ -85,7 +78,6 @@ class CityPool implements \Countable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCities() : array { @@ -100,7 +92,6 @@ class CityPool implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function hasCity(City $city) : bool { @@ -119,7 +110,6 @@ class CityPool implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Math/Optimization/TSP/GA.php b/Math/Optimization/TSP/GA.php index da09309fc..0cb2a85b6 100644 --- a/Math/Optimization/TSP/GA.php +++ b/Math/Optimization/TSP/GA.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization\TSP; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -68,7 +64,6 @@ class GA * @param CityPool $pool City pool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(CityPool $pool) { @@ -83,7 +78,6 @@ class GA * @return Population * * @since 1.0.0 - * @author Dennis Eichhorn */ public function evolvePopulation(Population $population) : Population { @@ -117,7 +111,6 @@ class GA * @return Tour * * @since 1.0.0 - * @author Dennis Eichhorn */ private function tournamentSelection(Population $population) : Tour { @@ -140,7 +133,6 @@ class GA * @return Tour * * @since 1.0.0 - * @author Dennis Eichhorn */ public function crossover(Tour $tour1, Tour $tour2) : Tour { @@ -183,7 +175,6 @@ class GA * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function mutate(Tour $tour) { diff --git a/Math/Optimization/TSP/Population.php b/Math/Optimization/TSP/Population.php index e29c448f5..52e9bb0a3 100644 --- a/Math/Optimization/TSP/Population.php +++ b/Math/Optimization/TSP/Population.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization\TSP; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class Population implements \Countable * @param bool $initialize Initialize with random tours * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(CityPool $pool, int $size, bool $initialize = false) { @@ -64,7 +59,6 @@ class Population implements \Countable * @param Tour $tour Tour to insert * * @since 1.0.0 - * @author Dennis Eichhorn */ public function insertAt(int $index, Tour $tour) { @@ -78,7 +72,6 @@ class Population implements \Countable * @param Tour $tour Tour to set * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(int $index, Tour $tour) /* : void */ { @@ -92,7 +85,6 @@ class Population implements \Countable * @param Tour $tour Tour to add * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(Tour $tour) { @@ -107,7 +99,6 @@ class Population implements \Countable * @return null|Tour * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(int $index) { @@ -120,7 +111,6 @@ class Population implements \Countable * @return Tour * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFittest() : Tour { @@ -142,7 +132,6 @@ class Population implements \Countable * @return Tour * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getUnfittest() : Tour { @@ -164,7 +153,6 @@ class Population implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Math/Optimization/TSP/Tour.php b/Math/Optimization/TSP/Tour.php index 54c5a3028..a3b719603 100644 --- a/Math/Optimization/TSP/Tour.php +++ b/Math/Optimization/TSP/Tour.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Optimization\TSP; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -69,7 +65,6 @@ class Tour implements \Countable * @param bool $initialize Initialize with random tours * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(CityPool $pool, bool $initialize = false) { @@ -89,7 +84,6 @@ class Tour implements \Countable * @return null|City * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCity($index) { @@ -102,7 +96,6 @@ class Tour implements \Countable * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFitness() : float { @@ -119,7 +112,6 @@ class Tour implements \Countable * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDistance() : float { @@ -146,7 +138,6 @@ class Tour implements \Countable * @param City $city City * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addCity(City $city) { @@ -163,7 +154,6 @@ class Tour implements \Countable * @param City $city City * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCity(int $index, City $city) /* : void */ { @@ -182,7 +172,6 @@ class Tour implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function hasCity(City $city) : bool { @@ -201,7 +190,6 @@ class Tour implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Math/Optimization/TransportationProblem.php b/Math/Optimization/TransportationProblem.php new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/Math/Optimization/TransportationProblem.php @@ -0,0 +1 @@ + diff --git a/Math/Parser/Evaluator.php b/Math/Parser/Evaluator.php index 6430bcd01..ce78cc437 100644 --- a/Math/Parser/Evaluator.php +++ b/Math/Parser/Evaluator.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Parser; * * @category Framework * @package phpOMS\Math - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ class Evaluator * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function evaluate(string $formula, array $vars) : float { diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index 6f6d3c7e3..0bcd1674d 100644 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,13 +15,14 @@ declare(strict_types=1); namespace phpOMS\Math\Statistic; +use phpOMS\Math\Exception\ZeroDevisionException; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; + /** * Average class. * * @category Framework * @package phpOMS\Math\Statistic - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -52,7 +51,6 @@ class Average * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function averageChange(array $x, int $h = 1) : float { @@ -74,7 +72,6 @@ class Average * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function totalMovingAverage(array $x, int $order, array $weight = null, bool $symmetric = false) : array { @@ -103,7 +100,6 @@ class Average * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function movingAverage(array $x, int $t, int $order, array $weight = null, bool $symmetric = false) : float { @@ -135,15 +131,14 @@ class Average * * @return float * - * @throws \Exception + * @throws InvalidDimensionException This exception is thrown in case both parameters have different array length * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function weightedAverage(array $values, array $weight) : float { if (($count = count($values)) !== count($weight)) { - throw new \Exception('Dimension'); + throw new InvalidDimensionException(count($values) . 'x' . count($weight)); } $avg = 0.0; @@ -167,14 +162,13 @@ class Average * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function arithmeticMean(array $values) : float { $count = count($values); if ($count === 0) { - throw new \Exception('Division zero'); + throw new ZeroDevisionException(); } return array_sum($values) / $count; @@ -190,7 +184,6 @@ class Average * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mode($values) { @@ -210,7 +203,6 @@ class Average * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function median(array $values) : float { @@ -242,14 +234,13 @@ class Average * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function geometricMean(array $values, int $offset = 0) : float { $count = count($values); if ($count === 0) { - throw new \Exception('Division zero'); + throw new ZeroDevisionException(); } return pow(array_product($values), 1 / $count); @@ -268,7 +259,6 @@ class Average * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function harmonicMean(array $values, int $offset = 0) : float { @@ -283,7 +273,7 @@ class Average foreach ($values as $value) { if ($value === 0) { - throw new \Exception('Division zero'); + throw new ZeroDevisionException(); } $sum += 1 / $value; @@ -303,7 +293,6 @@ class Average * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function angleMean($angles, int $offset = 0) : float { @@ -333,7 +322,6 @@ class Average * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function timeToAngle(string $time) : float { @@ -359,7 +347,6 @@ class Average * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function angleToTime(float $angle) : string { @@ -380,7 +367,6 @@ class Average * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function angleMean2(array $angles, int $offset = 0) : float { diff --git a/Math/Statistic/Basic.php b/Math/Statistic/Basic.php index 38c6595fa..090e01cae 100644 --- a/Math/Statistic/Basic.php +++ b/Math/Statistic/Basic.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Statistic; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class Basic * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function freaquency(array $values) : array { diff --git a/Math/Statistic/Correlation.php b/Math/Statistic/Correlation.php index 70b64ec5a..509118b66 100644 --- a/Math/Statistic/Correlation.php +++ b/Math/Statistic/Correlation.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Statistic; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,7 +38,6 @@ class Correlation * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function bravaisPersonCorrelationCoefficient(array $x, array $y) : float { @@ -58,7 +53,6 @@ class Correlation * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function autocorrelationCoefficient(array $x, int $k = 0) : float { @@ -83,7 +77,6 @@ class Correlation * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function boxPierceTest(array $autocorrelations, int $h) : float { @@ -104,7 +97,6 @@ class Correlation * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function ljungBoxTest(array $autocorrelations, int $h) : float { diff --git a/Math/Statistic/Forecast/Error.php b/Math/Statistic/Forecast/Error.php index da7f0f745..43792db3c 100644 --- a/Math/Statistic/Forecast/Error.php +++ b/Math/Statistic/Forecast/Error.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\Math\Statistic\MeasureOfDispersion; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getForecastError(float $observed, float $forecasted) : float { @@ -59,7 +54,6 @@ class Error * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getForecastErrorArray(array $observed, array $forecasted) : array { @@ -81,7 +75,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPercentageError(float $error, float $observed) : float { @@ -97,7 +90,6 @@ class Error * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPercentageErrorArray(array $errors, array $observed) : array { @@ -118,7 +110,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMeanAbsoulteError(array $errors) : float { @@ -133,7 +124,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMeanSquaredError(array $errors) : float { @@ -148,7 +138,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRootMeanSquaredError(array $errors) : float { @@ -168,7 +157,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCoefficientOfDetermination(array $observed, array $forecasted) : float { @@ -197,7 +185,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSumSquaredError(array $errors) : float { @@ -220,7 +207,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRBarSquared(float $R, int $observations, int $predictors) : float { @@ -237,7 +223,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getAkaikeInformationCriterion(float $sse, int $observations, int $predictors) : float { @@ -256,7 +241,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCorrectedAkaikeInformationCriterion(float $aic, int $observations, int $predictors) : float { @@ -273,7 +257,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSchwarzBayesianInformationCriterion(float $sse, int $observations, int $predictors) : float { @@ -289,7 +272,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMeanAbsolutePercentageError(array $observed, array $forecasted) : float { @@ -305,7 +287,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSymmetricMeanAbsolutePercentageError(array $observed, array $forecasted) : float { @@ -326,7 +307,6 @@ class Error * @return array * * @since 1.0.0 - * @author Dennis Eichhorn * todo: move to utils?! implement sqrt for array as well... could be usefull for others (e.g. matrix) */ private static function square(array $values) : array @@ -349,7 +329,6 @@ class Error * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCrossSectionalScaledErrorArray(array $errors, array $observed) : array { @@ -372,7 +351,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCrossSectionalScaledError(float $error, array $observed) : float { @@ -394,7 +372,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMeanAbsoluteScaledError(array $scaledErrors) : float { @@ -409,7 +386,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMeanSquaredScaledError(array $scaledErrors) : float { @@ -426,7 +402,6 @@ class Error * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getScaledErrorArray(array $errors, array $observed, int $m = 1) : array { @@ -450,7 +425,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getScaledError(float $error, array $observed, int $m = 1) : float { @@ -466,7 +440,6 @@ class Error * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function getNaiveForecast(array $observed, int $m = 1) : float { diff --git a/Math/Statistic/Forecast/ForecastIntervalMultiplier.php b/Math/Statistic/Forecast/ForecastIntervalMultiplier.php index 972ca84f9..a8bddc0fa 100644 --- a/Math/Statistic/Forecast/ForecastIntervalMultiplier.php +++ b/Math/Statistic/Forecast/ForecastIntervalMultiplier.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Statistic\Forecast; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Prediction interval multiplier. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Statistic/Forecast/Forecasts.php b/Math/Statistic/Forecast/Forecasts.php index 7e7de433a..6f7765c72 100644 --- a/Math/Statistic/Forecast/Forecasts.php +++ b/Math/Statistic/Forecast/Forecasts.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Statistic\Forecast; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class Forecasts * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getForecastInteval(float $forecast, float $standardDeviation, float $interval = ForecastIntervalMultiplier::P_95) : array { diff --git a/Math/Statistic/Forecast/Regression/LevelLevelRegression.php b/Math/Statistic/Forecast/Regression/LevelLevelRegression.php index cd6c05d72..09cffb4d0 100644 --- a/Math/Statistic/Forecast/Regression/LevelLevelRegression.php +++ b/Math/Statistic/Forecast/Regression/LevelLevelRegression.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Statistic\Forecast\Regression; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Math/Statistic/Forecast/Regression/LevelLogRegression.php b/Math/Statistic/Forecast/Regression/LevelLogRegression.php index e4d91c722..94cd2d309 100644 --- a/Math/Statistic/Forecast/Regression/LevelLogRegression.php +++ b/Math/Statistic/Forecast/Regression/LevelLogRegression.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,13 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Statistic\Forecast\Regression; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; + /** * Regression class. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,8 +33,8 @@ class LevelLogRegression extends RegressionAbstract */ public static function getRegression(array $x, array $y) : array { - if (($c = count($x)) != count($y)) { - throw new \Exception('Dimension'); + if (($c = count($x)) !== count($y)) { + throw new InvalidDimensionException($c . 'x' . count($y)); } for ($i = 0; $i < $c; $i++) { diff --git a/Math/Statistic/Forecast/Regression/LogLevelRegression.php b/Math/Statistic/Forecast/Regression/LogLevelRegression.php index c2a3dab49..c7e99a0ef 100644 --- a/Math/Statistic/Forecast/Regression/LogLevelRegression.php +++ b/Math/Statistic/Forecast/Regression/LogLevelRegression.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,13 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Statistic\Forecast\Regression; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; + /** * Regression class. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,8 +33,8 @@ class LogLevelRegression extends RegressionAbstract */ public static function getRegression(array $x, array $y) : array { - if (($c = count($x)) != count($y)) { - throw new \Exception('Dimension'); + if (($c = count($x)) !== count($y)) { + throw new InvalidDimensionException($c . 'x' . count($y)); } for ($i = 0; $i < $c; $i++) { diff --git a/Math/Statistic/Forecast/Regression/LogLogRegression.php b/Math/Statistic/Forecast/Regression/LogLogRegression.php index d1bd4a25d..fb0f20680 100644 --- a/Math/Statistic/Forecast/Regression/LogLogRegression.php +++ b/Math/Statistic/Forecast/Regression/LogLogRegression.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,13 +15,13 @@ declare(strict_types=1); namespace phpOMS\Math\Statistic\Forecast\Regression; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; + /** * Regression class. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,8 +33,8 @@ class LogLogRegression extends RegressionAbstract */ public static function getRegression(array $x, array $y) : array { - if (($c = count($x)) != count($y)) { - throw new \Exception('Dimension'); + if (($c = count($x)) !== count($y)) { + throw new InvalidDimensionException($c . 'x' . count($y)); } for ($i = 0; $i < $c; $i++) { diff --git a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php index ca36a93fa..56fcc32dc 100644 --- a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php +++ b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Statistic/Forecast/Regression/RegressionAbstract.php b/Math/Statistic/Forecast/Regression/RegressionAbstract.php index cdce46a0c..b8f7cda32 100644 --- a/Math/Statistic/Forecast/Regression/RegressionAbstract.php +++ b/Math/Statistic/Forecast/Regression/RegressionAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -19,6 +17,7 @@ declare(strict_types=1); use phpOMS\Math\Statistic\Average; use phpOMS\Math\Statistic\Forecast\ForecastIntervalMultiplier; use phpOMS\Math\Statistic\MeasureOfDispersion; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; abstract class RegressionAbstract { @@ -32,15 +31,14 @@ abstract class RegressionAbstract * * @return array [b0 => ?, b1 => ?] * - * @throws \Exception + * @throws InvalidDimensionException Throws this exception if the dimension of both arrays is not equal. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRegression(array $x, array $y) : array { - if (count($x) != count($y)) { - throw new \Exception('Dimension'); + if (count($x) !== count($y)) { + throw new InvalidDimensionException(count($x) . 'x' . count($y)); } $b1 = self::getBeta1($x, $y); @@ -60,7 +58,6 @@ abstract class RegressionAbstract * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getStandardErrorOfRegression(array $errors) : float { @@ -86,7 +83,6 @@ abstract class RegressionAbstract * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPredictionInterval(float $forecasted, array $x, array $errors, float $multiplier = ForecastIntervalMultiplier::P_95) : array { @@ -114,7 +110,6 @@ abstract class RegressionAbstract * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function getBeta1(array $x, array $y) : float { @@ -145,7 +140,6 @@ abstract class RegressionAbstract * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function getBeta0(array $x, array $y, float $b1) : float { diff --git a/Math/Statistic/MeasureOfDispersion.php b/Math/Statistic/MeasureOfDispersion.php index 2cf345624..09bc6d104 100644 --- a/Math/Statistic/MeasureOfDispersion.php +++ b/Math/Statistic/MeasureOfDispersion.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,13 +15,14 @@ declare(strict_types=1); namespace phpOMS\Math\Statistic; +use phpOMS\Math\Exception\ZeroDevisionException; +use phpOMS\Math\Matrix\Exception\InvalidDimensionException; + /** * Measure of dispersion. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +40,6 @@ class MeasureOfDispersion * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function range(array $values) : float { @@ -64,14 +62,13 @@ class MeasureOfDispersion * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function empiricalVariationcoefficient(array $values) : float { $mean = Average::arithmeticMean($values); if ($mean === 0) { - throw new \Exception('Division zero'); + throw new ZeroDevisionException(); } return self::standardDeviation($values) / $mean; @@ -87,7 +84,6 @@ class MeasureOfDispersion * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function standardDeviation(array $values) : float { @@ -106,14 +102,13 @@ class MeasureOfDispersion * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function sampleVariance(array $values) : float { $count = count($values); if ($count < 2) { - throw new \Exception('Division zero'); + throw new ZeroDevisionException(); } return $count * self::empiricalVariance($values) / ($count - 1); @@ -131,14 +126,13 @@ class MeasureOfDispersion * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function empiricalVariance(array $values) : float { $count = count($values); if ($count === 0) { - throw new \Exception('Division zero'); + throw new ZeroDevisionException(); } $mean = Average::arithmeticMean($values); @@ -161,21 +155,20 @@ class MeasureOfDispersion * * @return float * - * @throws \Exception + * @throws InvalidDimensionException * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function empiricalCovariance(array $x, array $y) : float { $count = count($x); if ($count < 2) { - throw new \Exception('Division zero'); + throw new ZeroDevisionException(); } if ($count !== count($y)) { - throw new \Exception('Dimensions'); + throw new InvalidDimensionException($count . 'x' . count($y)); } $xMean = Average::arithmeticMean($x); @@ -198,7 +191,6 @@ class MeasureOfDispersion * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getIQR(array $x) : float { @@ -212,7 +204,6 @@ class MeasureOfDispersion * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function meanDeviation(array $x) : float { @@ -234,7 +225,6 @@ class MeasureOfDispersion * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function squaredMeanDeviation(array $x) : float { diff --git a/Math/Stochastic/Distribution/BernoulliDistribution.php b/Math/Stochastic/Distribution/BernoulliDistribution.php index 21d13cb4b..6a6e8dcae 100644 --- a/Math/Stochastic/Distribution/BernoulliDistribution.php +++ b/Math/Stochastic/Distribution/BernoulliDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class BernoulliDistribution * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPmf(float $p, int $k) : float { @@ -62,7 +57,6 @@ class BernoulliDistribution * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode(float $p) : int { @@ -83,7 +77,6 @@ class BernoulliDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $p) : float { @@ -98,7 +91,6 @@ class BernoulliDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $p) : float { @@ -119,7 +111,6 @@ class BernoulliDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $p) : float { @@ -135,7 +126,6 @@ class BernoulliDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(float $p, float $t) : float { @@ -150,7 +140,6 @@ class BernoulliDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness(float $p) : float { @@ -165,7 +154,6 @@ class BernoulliDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFisherInformation(float $p) : float { @@ -180,7 +168,6 @@ class BernoulliDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis(float $p) : float { diff --git a/Math/Stochastic/Distribution/BetaDistribution.php b/Math/Stochastic/Distribution/BetaDistribution.php index d8379a1f3..e3e9a5598 100644 --- a/Math/Stochastic/Distribution/BetaDistribution.php +++ b/Math/Stochastic/Distribution/BetaDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/BinomialDistribution.php b/Math/Stochastic/Distribution/BinomialDistribution.php index 28b853529..1dbb1bb74 100644 --- a/Math/Stochastic/Distribution/BinomialDistribution.php +++ b/Math/Stochastic/Distribution/BinomialDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Math\Functions\Functions; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ class BinomialDistribution * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode(int $n, float $p) : float { @@ -69,7 +64,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(int $n, float $t, float $p) : float { @@ -85,7 +79,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness(int $n, float $p) : float { @@ -101,7 +94,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFisherInformation(int $n, float $p) : float { @@ -117,7 +109,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis(int $n, float $p) : float { @@ -134,7 +125,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(int $n, int $x, float $p) : float { @@ -159,7 +149,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPmf(int $n, int $k, float $p) : float { @@ -175,7 +164,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(int $n, float $p) : float { @@ -191,7 +179,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(int $n, float $p) : float { @@ -207,7 +194,6 @@ class BinomialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(int $n, float $p) : float { diff --git a/Math/Stochastic/Distribution/CauchyDistribution.php b/Math/Stochastic/Distribution/CauchyDistribution.php index 7fff30f20..91347b973 100644 --- a/Math/Stochastic/Distribution/CauchyDistribution.php +++ b/Math/Stochastic/Distribution/CauchyDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class CauchyDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPdf(float $x, float $x0, float $gamma) : float { @@ -57,7 +52,6 @@ class CauchyDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(float $x, float $x0, float $gamma) : float { @@ -72,7 +66,6 @@ class CauchyDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode($x0) : float { @@ -87,7 +80,6 @@ class CauchyDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $x0) : float { diff --git a/Math/Stochastic/Distribution/ChiSquaredDistribution.php b/Math/Stochastic/Distribution/ChiSquaredDistribution.php index a6a821eb1..0a7afa1d8 100644 --- a/Math/Stochastic/Distribution/ChiSquaredDistribution.php +++ b/Math/Stochastic/Distribution/ChiSquaredDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Math\Functions\Functions; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -92,7 +88,6 @@ class ChiSquaredDistribution * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function testHypothesis(array $dataset, array $expected, float $significance = 0.05, int $df = 0) : array { @@ -136,7 +131,6 @@ class ChiSquaredDistribution * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDegreesOfFreedom(array $values) : int { @@ -158,7 +152,6 @@ class ChiSquaredDistribution * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPdf(float $x, int $df) : float { @@ -177,7 +170,6 @@ class ChiSquaredDistribution * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode(int $df) : int { @@ -192,7 +184,6 @@ class ChiSquaredDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(int $df) : float { @@ -207,7 +198,6 @@ class ChiSquaredDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(int $df) : float { @@ -222,7 +212,6 @@ class ChiSquaredDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(int $df) : float { @@ -240,7 +229,6 @@ class ChiSquaredDistribution * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(int $df, float $t) : float { @@ -259,7 +247,6 @@ class ChiSquaredDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness(int $df) : float { @@ -274,7 +261,6 @@ class ChiSquaredDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis(int $df) : float { diff --git a/Math/Stochastic/Distribution/ExponentialDistribution.php b/Math/Stochastic/Distribution/ExponentialDistribution.php index 8938f86be..237c62eb7 100644 --- a/Math/Stochastic/Distribution/ExponentialDistribution.php +++ b/Math/Stochastic/Distribution/ExponentialDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPdf(float $x, float $lambda) : float { @@ -55,7 +50,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(float $x, float $lambda) : float { @@ -68,7 +62,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode() : float { @@ -83,7 +76,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $lambda) : float { @@ -98,7 +90,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $lambda) : float { @@ -113,7 +104,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $lambda) : float { @@ -131,7 +121,6 @@ class ExponentialDistribution * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(float $t, float $lambda) : float { @@ -148,7 +137,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness() : float { @@ -161,7 +149,6 @@ class ExponentialDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis() : float { diff --git a/Math/Stochastic/Distribution/FDistribution.php b/Math/Stochastic/Distribution/FDistribution.php index 668999d95..df308127b 100644 --- a/Math/Stochastic/Distribution/FDistribution.php +++ b/Math/Stochastic/Distribution/FDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/GammaDistribution.php b/Math/Stochastic/Distribution/GammaDistribution.php index bdda04f03..10fc9d628 100644 --- a/Math/Stochastic/Distribution/GammaDistribution.php +++ b/Math/Stochastic/Distribution/GammaDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/GeometricDistribution.php b/Math/Stochastic/Distribution/GeometricDistribution.php index f30d2701f..15ac256bd 100644 --- a/Math/Stochastic/Distribution/GeometricDistribution.php +++ b/Math/Stochastic/Distribution/GeometricDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPmf(float $p, int $k) : float { @@ -55,7 +50,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(float $p, int $k) : float { @@ -68,7 +62,6 @@ class GeometricDistribution * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode() : int { @@ -83,7 +76,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $p) : float { @@ -98,7 +90,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $p) : float { @@ -113,7 +104,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $p) : float { @@ -129,7 +119,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(float $p, float $t) : float { @@ -144,7 +133,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness(float $lambda) : float { @@ -159,7 +147,6 @@ class GeometricDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis(float $lambda) : float { diff --git a/Math/Stochastic/Distribution/HypergeometricDistribution.php b/Math/Stochastic/Distribution/HypergeometricDistribution.php index 9fbbf3980..c7df59a02 100644 --- a/Math/Stochastic/Distribution/HypergeometricDistribution.php +++ b/Math/Stochastic/Distribution/HypergeometricDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/LaplaceDistribution.php b/Math/Stochastic/Distribution/LaplaceDistribution.php index 13e5eb97b..61b32d8dd 100644 --- a/Math/Stochastic/Distribution/LaplaceDistribution.php +++ b/Math/Stochastic/Distribution/LaplaceDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPdf(float $x, float $mu, float $b) : float { @@ -57,7 +52,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(float $x, float $mu, float $b) : float { @@ -72,7 +66,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode(float $mu) : float { @@ -87,7 +80,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $mu) : float { @@ -102,7 +94,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $mu) : float { @@ -117,7 +108,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $b) : float { @@ -136,7 +126,6 @@ class LaplaceDistribution * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(float $t, float $mu, float $b) : float { @@ -153,7 +142,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness() : float { @@ -166,7 +154,6 @@ class LaplaceDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis() : float { diff --git a/Math/Stochastic/Distribution/LogDistribution.php b/Math/Stochastic/Distribution/LogDistribution.php index ac8167531..f1c3749af 100644 --- a/Math/Stochastic/Distribution/LogDistribution.php +++ b/Math/Stochastic/Distribution/LogDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/LogNormalDistribution.php b/Math/Stochastic/Distribution/LogNormalDistribution.php index da3182a88..5aa64e3db 100644 --- a/Math/Stochastic/Distribution/LogNormalDistribution.php +++ b/Math/Stochastic/Distribution/LogNormalDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/LogisticDistribution.php b/Math/Stochastic/Distribution/LogisticDistribution.php index ae0c8a3ec..482364c66 100644 --- a/Math/Stochastic/Distribution/LogisticDistribution.php +++ b/Math/Stochastic/Distribution/LogisticDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/NormalDistribution.php b/Math/Stochastic/Distribution/NormalDistribution.php index ce3906fbc..6a8c45631 100644 --- a/Math/Stochastic/Distribution/NormalDistribution.php +++ b/Math/Stochastic/Distribution/NormalDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPdf(float $x, float $mu, float $sig) : float { @@ -56,7 +51,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode(float $mu) : float { @@ -71,7 +65,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $mu) : float { @@ -86,7 +79,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $mu) : float { @@ -101,7 +93,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $sig) : float { @@ -118,7 +109,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(float $t, float $mu, float $sig) : float { @@ -131,7 +121,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness() : float { @@ -146,7 +135,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFisherInformation(float $sig) : float { @@ -159,7 +147,6 @@ class NormalDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis() : float { diff --git a/Math/Stochastic/Distribution/ParetoDistribution.php b/Math/Stochastic/Distribution/ParetoDistribution.php index 7adebdcf8..7464a7c1f 100644 --- a/Math/Stochastic/Distribution/ParetoDistribution.php +++ b/Math/Stochastic/Distribution/ParetoDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/PoissonDistribution.php b/Math/Stochastic/Distribution/PoissonDistribution.php index f78fe2ef0..e901576fa 100644 --- a/Math/Stochastic/Distribution/PoissonDistribution.php +++ b/Math/Stochastic/Distribution/PoissonDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Math\Functions\Functions; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPmf(int $k, float $lambda) : float { @@ -59,7 +54,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(int $k, float $lambda) : float { @@ -80,7 +74,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode(float $lambda) : float { @@ -95,7 +88,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $lambda) : float { @@ -110,7 +102,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $lambda) : float { @@ -125,7 +116,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $lambda) : float { @@ -141,7 +131,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(float $lambda, float $t) : float { @@ -156,7 +145,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness(float $lambda) : float { @@ -171,7 +159,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFisherInformation(float $lambda) : float { @@ -186,7 +173,6 @@ class PoissonDistribution * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis(float $lambda) : float { diff --git a/Math/Stochastic/Distribution/TDistribution.php b/Math/Stochastic/Distribution/TDistribution.php index 7ea719aa4..19f51ae9e 100644 --- a/Math/Stochastic/Distribution/TDistribution.php +++ b/Math/Stochastic/Distribution/TDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/Distribution/UniformDistributionContinuous.php b/Math/Stochastic/Distribution/UniformDistributionContinuous.php index d90fa9647..cc90f439d 100644 --- a/Math/Stochastic/Distribution/UniformDistributionContinuous.php +++ b/Math/Stochastic/Distribution/UniformDistributionContinuous.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMode(float $a, float $b) : float { @@ -57,7 +52,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPdf(float $x, float $a, float $b) : float { @@ -74,7 +68,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(float $x, float $a, float $b) : float { @@ -97,7 +90,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(int $t, float $a, float $b) : float { @@ -110,7 +102,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness() : float { @@ -123,7 +114,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis() : float { @@ -139,7 +129,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $a, float $b) : float { @@ -155,7 +144,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $a, float $b) : float { @@ -171,7 +159,6 @@ class UniformDistributionContinuous * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $a, float $b) : float { diff --git a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php index bc67b5545..93fbe39a6 100644 --- a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php +++ b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Math\Stochastic\Distribution; * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class UniformDistributionDiscrete * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getPmf(float $a, float $b) : float { @@ -59,7 +54,6 @@ class UniformDistributionDiscrete * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCdf(float $k, float $a, float $b) : float { @@ -80,7 +74,6 @@ class UniformDistributionDiscrete * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMgf(int $t, float $a, float $b) : float { @@ -93,7 +86,6 @@ class UniformDistributionDiscrete * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSkewness() : float { @@ -109,7 +101,6 @@ class UniformDistributionDiscrete * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getExKurtosis(float $a, float $b) : float { @@ -127,7 +118,6 @@ class UniformDistributionDiscrete * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMedian(float $a, float $b) : float { @@ -143,7 +133,6 @@ class UniformDistributionDiscrete * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getMean(float $a, float $b) : float { @@ -159,7 +148,6 @@ class UniformDistributionDiscrete * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getVariance(float $a, float $b) : float { diff --git a/Math/Stochastic/Distribution/WeibullDistribution.php b/Math/Stochastic/Distribution/WeibullDistribution.php index 8c0b93c3f..9b7e8296e 100644 --- a/Math/Stochastic/Distribution/WeibullDistribution.php +++ b/Math/Stochastic/Distribution/WeibullDistribution.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Math/Stochastic/NaiveBayesFilter.php b/Math/Stochastic/NaiveBayesFilter.php new file mode 100644 index 000000000..99bcee44c --- /dev/null +++ b/Math/Stochastic/NaiveBayesFilter.php @@ -0,0 +1,59 @@ +normalizeDictionary(); + + $n = 0.0; + foreach($toMatch as $element) { + if(isset($normalizedDict[$element])) { + $n += log(1-$normalizedDict[$element]['match'] / $normalizedDict[$element]['total']) - log($normalizedDict[$element]['match'] / $normalizedDict[$element]['total']); + } + } + + return 1 / (1+exp(M_E, $n)); + } + + private function normalizeDictionary() : array + { + return $this->dict; + } +} diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index db63b7697..0fd00cc2b 100644 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,13 +15,13 @@ declare(strict_types=1); namespace phpOMS\Message; +use phpOMS\Localization\Localization; + /** * Response class. * * @category Framework * @package phpOMS\Response - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,6 +35,129 @@ abstract class HeaderAbstract * @since 1.0.0 */ protected static $isLocked = false; + + /** + * Localization. + * + * @var Localization + * @since 1.0.0 + */ + protected $l11n = null; + + /** + * Account. + * + * @var int + * @since 1.0.0 + */ + protected $account = 0; + + /** + * Response status. + * + * @var int + * @since 1.0.0 + */ + protected $status = 0; + + /** + * Constructor. + * + * @since 1.0.0 + */ + public function __construct() + { + $this->l11n = new Localization(); + } + + /** + * Get Localization + * + * @return Localization + * + * @since 1.0.0 + */ + public function getL11n() : Localization + { + return $this->l11n; + } + + /** + * Set localization + * + * @param int $localization Localization + * + * @return void + * + * @since 1.0.0 + */ + public function setL11n(Localization $l11n) /* : void */ + { + $this->l11n = $l11n; + } + + /** + * Get account id + * + * @return int + * + * @since 1.0.0 + */ + public function getAccount() : int + { + return $this->account; + } + + /** + * Set account id + * + * @param int $account Account id + * + * @return void + * + * @since 1.0.0 + */ + public function setAccount(int $account) /* : void */ + { + $this->account = $account; + } + + + /** + * Set status code + * + * @param int $status Status code + * + * @return void + * + * @since 1.0.0 + */ + public function setStatusCode(int $status) /* : void */ + { + $this->status = $status; + $this->header->generate($status); + } + + /** + * Get status code + * + * @return int + * + * @since 1.0.0 + */ + public function getStatusCode() : int + { + return $this->status; + } + + /** + * Get protocol version. + * + * @return string + * + * @since 1.0.0 + */ + abstract public function getProtocolVersion() : string; /** * Set header. @@ -46,19 +167,17 @@ abstract class HeaderAbstract * @param bool $overwrite Overwrite if key already exists * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function set(string $key, string $value, bool $overwrite = false); /** * Generate header based on status code. * - * @param string $statusCode Status code + * @param int $statusCode Status code * * @since 1.0.0 - * @author Dennis Eichhorn */ - abstract public function generate(string $statusCode) /* : void */; + abstract public function generate(int $statusCode) /* : void */; /** * Get header by key. @@ -68,7 +187,6 @@ abstract class HeaderAbstract * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function get(string $key) : array; @@ -80,7 +198,6 @@ abstract class HeaderAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function has(string $key) : bool; @@ -88,7 +205,6 @@ abstract class HeaderAbstract * Set header locked. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function lock() /* : void */ { @@ -102,10 +218,9 @@ abstract class HeaderAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isLocked() : bool { return self::$isLocked; } -} \ No newline at end of file +} diff --git a/Message/Http/BrowserType.php b/Message/Http/BrowserType.php index 3180361e1..1fa9b75dd 100644 --- a/Message/Http/BrowserType.php +++ b/Message/Http/BrowserType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Message\Http; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Browser type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Request * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Message/Http/Header.php b/Message/Http/Header.php index 4cbbf972a..0a8e341b0 100644 --- a/Message/Http/Header.php +++ b/Message/Http/Header.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -18,14 +16,13 @@ declare(strict_types=1); namespace phpOMS\Message\Http; use phpOMS\Message\HeaderAbstract; +use phpOMS\DataStorage\LockExcpetion; /** * Response class. * * @category Framework * @package phpOMS\Response - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,20 +42,33 @@ class Header extends HeaderAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { $this->set('Content-Type', 'text/html; charset=utf-8'); + parent::__construct(); } /** - * {@inheritdoc} + * Set header. + * + * @param string $key Header key (case insensitive) + * @param string $header Header value + * @param bool $overwrite Overwrite if already existing + * + * @return bool + * + * @throws LockException The http header needs to be defined at the beginning. If it is already pushed further interactions are impossible and locked. + * @throws \Exception If the header already exists and cannot be overwritten this exception will be thrown. + * + * @todo Allow to extend header key with additional values. + * + * @since 1.0.0 */ public function set(string $key, string $header, bool $overwrite = false) : bool { if (self::$isLocked) { - throw new \Exception('Already locked'); + throw new LockExcpetion('HTTP header'); } $key = strtolower($key); @@ -81,6 +91,14 @@ class Header extends HeaderAbstract return true; } + + /** + * {@inheritdoc} + */ + public function getProtocolVersion() : string + { + return $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1'; + } /** * Is security header. @@ -89,10 +107,7 @@ class Header extends HeaderAbstract * * @return bool * - * @throws \Exception - * * @since 1.0.0 - * @author Dennis Eichhorn */ private function isSecurityHeader(string $key) : bool { @@ -108,32 +123,61 @@ class Header extends HeaderAbstract * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function getStatusCode() : int + public function getStatusCode() : int { - return http_response_code(); + if($this->status === 0) { + $this->status = \http_response_code(); + } + + return $this->status; } /** - * Returns all headers. + * Returns all pushed headers. * * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHeaders() : array { - return getallheaders(); + return self::getAllHeaders(); } /** - * {@inheritdoc} + * Get pushed header by name. + * + * @return string + * + * @since 1.0.0 */ public function getHeader(string $name) : string { - return getallheaders()[$name]; + return self::getAllHeaders()[$name] ?? ''; + } + + /** + * Get all headers for apache and nginx + * + * @return array + * + * @since 1.0.0 + */ + private static function getAllHeaders() : array + { + if (function_exists('getallheaders')) { + return getallheaders(); + } + + $headers = []; + foreach ($_SERVER as $name => $value) { + if (substr($name, 0, 5) == 'HTTP_') { + $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; + } + } + + return $headers; } /** @@ -143,15 +187,14 @@ class Header extends HeaderAbstract * * @return bool * - * @throws \Exception + * @throws LockException The http header needs to be defined at the beginning. If it is already pushed further interactions are impossible and locked. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(int $key) : bool { if (self::$isLocked) { - throw new \Exception('Already locked'); + throw new \LockException('HTTP header'); } if (isset($this->header[$key])) { @@ -164,26 +207,45 @@ class Header extends HeaderAbstract } /** - * {@inheritdoc} + * Get header by name. + * + * @param int $key Header key + * + * @return array + * + * @since 1.0.0 */ public function get(string $key) : array { return $this->header[strtolower($key)] ?? []; } - + /** * {@inheritdoc} */ + public function getReasonPhrase() : string + { + return $this->header->getHeader('Status'); + } + + /** + * Check if header is defined. + * + * @param int $key Header key + * + * @return bool + * + * @since 1.0.0 + */ public function has(string $key) : bool { - return array_key_exists($key, $this->header); + return isset($this->header[$key]); } /** * Push all headers. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function push() /* : void */ { @@ -205,22 +267,22 @@ class Header extends HeaderAbstract /** * {@inheritdoc} */ - public function generate(string $code) /* : void */ + public function generate(int $code) /* : void */ { switch ($code) { - case RequestStatus::R_403: + case RequestStatusCode::R_403: $this->generate403(); break; - case RequestStatus::R_404: + case RequestStatusCode::R_404: $this->generate404(); break; - case RequestStatus::R_406: + case RequestStatusCode::R_406: $this->generate406(); break; - case RequestStatus::R_407: + case RequestStatusCode::R_407: $this->generate407(); break; - case RequestStatus::R_503: + case RequestStatusCode::R_503: $this->generate503(); break; default: @@ -234,13 +296,12 @@ class Header extends HeaderAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generate403() /* : void */ { $this->set('HTTP', 'HTTP/1.0 403 Forbidden'); $this->set('Status', 'Status: HTTP/1.0 403 Forbidden'); - http_response_code(403); + \http_response_code(403); } /** @@ -249,13 +310,12 @@ class Header extends HeaderAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generate404() /* : void */ { $this->set('HTTP', 'HTTP/1.0 404 Not Found'); $this->set('Status', 'Status: HTTP/1.0 404 Not Found'); - http_response_code(404); + \http_response_code(404); } /** @@ -264,13 +324,12 @@ class Header extends HeaderAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generate406() /* : void */ { $this->set('HTTP', 'HTTP/1.0 406 Not acceptable'); $this->set('Status', 'Status: 406 Not acceptable'); - http_response_code(406); + \http_response_code(406); } /** @@ -279,7 +338,6 @@ class Header extends HeaderAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generate407() /* : void */ { @@ -292,14 +350,13 @@ class Header extends HeaderAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generate500() /* : void */ { $this->set('HTTP', 'HTTP/1.0 500 Internal Server Error'); $this->set('Status', 'Status: 500 Internal Server Error'); $this->set('Retry-After', 'Retry-After: 300'); - http_response_code(500); + \http_response_code(500); } /** @@ -308,13 +365,12 @@ class Header extends HeaderAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generate503() /* : void */ { $this->set('HTTP', 'HTTP/1.0 503 Service Temporarily Unavailable'); $this->set('Status', 'Status: 503 Service Temporarily Unavailable'); $this->set('Retry-After', 'Retry-After: 300'); - http_response_code(503); + \http_response_code(503); } -} \ No newline at end of file +} diff --git a/Message/Http/OSType.php b/Message/Http/OSType.php index 40746d53d..343381749 100644 --- a/Message/Http/OSType.php +++ b/Message/Http/OSType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Message\Http; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * OS type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Request * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Message/Http/Request.php b/Message/Http/Request.php index 52d3d82a9..6f29e33c4 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -30,8 +28,6 @@ use phpOMS\Uri\UriInterface; * * @category Framework * @package phpOMS\Request - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -49,14 +45,14 @@ class Request extends RequestAbstract /** * Browser type. * - * @var BrowserType + * @var string * @since 1.0.0 */ private $browser = BrowserType::CHROME; /** * OS type. * - * @var OSType + * @var string * @since 1.0.0 */ private $os = OSType::LINUX; @@ -75,7 +71,6 @@ class Request extends RequestAbstract * @param UriInterface $uri Uri * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(Localization $l11n = null, UriInterface $uri = null) { @@ -87,6 +82,29 @@ class Request extends RequestAbstract $this->init(); } + /** + * Create request from super globals. + * + * @param Localization $l11n Localization + * + * @return Request + * + * @since 1.0.0 + */ + public static function createFromSuperglobals(Localization $l11n = null) : Request + { + return new self($l11n); + } + + /** + * {@inheritdoc} + */ + public function setUri(UriInterface $uri) /* : void */ + { + $this->uri = $uri; + $this->data += $uri->getQueryArray(); + } + /** * Init request. * @@ -97,7 +115,6 @@ class Request extends RequestAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function init() /* : void */ { @@ -108,7 +125,6 @@ class Request extends RequestAbstract } $this->data = array_change_key_case($this->data, CASE_LOWER); - $this->path = explode('/', $this->uri->getPath()); $this->setupUriBuilder(); } @@ -121,7 +137,6 @@ class Request extends RequestAbstract * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function initCurrentRequest() /* : void */ { @@ -152,7 +167,6 @@ class Request extends RequestAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function loadRequestLanguage() : string { @@ -172,7 +186,6 @@ class Request extends RequestAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function cleanupGlobals() /* : void */ { @@ -188,7 +201,6 @@ class Request extends RequestAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function setupUriBuilder() /* : void */ { @@ -220,15 +232,16 @@ class Request extends RequestAbstract * @todo: maybe change to normal path string e.g. /some/path/here instead of hash! Remember to adjust navigation elements * * @since 1.0.0 - * @author Dennis Eichhorn */ public function createRequestHashs(int $start = 0) /* : void */ { $this->hash = []; - foreach ($this->path as $key => $path) { + $pathArray = $this->uri->getPathElements(); + + foreach ($pathArray as $key => $path) { $paths = []; for ($i = $start; $i < $key + 1; $i++) { - $paths[] = $this->path[$i]; + $paths[] = $pathArray[$i]; } $this->hash[] = sha1(implode('', $paths)); @@ -241,7 +254,6 @@ class Request extends RequestAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isMobile() : bool { @@ -274,13 +286,13 @@ class Request extends RequestAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBrowser() : string { if (!isset($this->browser)) { $arr = BrowserType::getConstants(); $http_request_type = strtolower($_SERVER['HTTP_USER_AGENT']); + foreach ($arr as $key => $val) { if (stripos($http_request_type, $val)) { $this->browser = $val; @@ -300,7 +312,6 @@ class Request extends RequestAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setBrowser(string $browser) /* : void */ { @@ -313,7 +324,6 @@ class Request extends RequestAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getOS() : string { @@ -339,7 +349,6 @@ class Request extends RequestAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setOS(string $os) /* : void */ { @@ -362,7 +371,6 @@ class Request extends RequestAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isHttps(int $port = 443) : bool { @@ -383,7 +391,6 @@ class Request extends RequestAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __toString() { @@ -393,14 +400,6 @@ class Request extends RequestAbstract return $lastElement; } - /** - * {@inheritdoc} - */ - public function getProtocolVersion() : string - { - return $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1'; - } - /** * {@inheritdoc} */ @@ -423,7 +422,6 @@ class Request extends RequestAbstract * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFiles() : array { @@ -438,7 +436,6 @@ class Request extends RequestAbstract * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRouteVerb() : int { @@ -462,7 +459,6 @@ class Request extends RequestAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMethod() : string { diff --git a/Message/Http/RequestMethod.php b/Message/Http/RequestMethod.php index a4dc52bf5..c287f14ee 100644 --- a/Message/Http/RequestMethod.php +++ b/Message/Http/RequestMethod.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Message\Http; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Request method enum. * * @category Request * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Message/Http/RequestStatus.php b/Message/Http/RequestStatus.php index e440da632..537aabc46 100644 --- a/Message/Http/RequestStatus.php +++ b/Message/Http/RequestStatus.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Message\Http; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Request status enum. * * @category Request * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Message/Http/RequestStatusCode.php b/Message/Http/RequestStatusCode.php new file mode 100644 index 000000000..ea849833b --- /dev/null +++ b/Message/Http/RequestStatusCode.php @@ -0,0 +1,139 @@ + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -28,21 +26,26 @@ use phpOMS\Views\View; * * @category Framework * @package phpOMS\Response - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ class Response extends ResponseAbstract implements RenderableInterface { + /** + * Response status. + * + * @var int + * @since 1.0.0 + */ + protected $status = RequestStatusCode::R_200; + /** * Constructor. * * @param Localization $l11n Localization * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(Localization $l11n) { @@ -58,7 +61,6 @@ class Response extends ResponseAbstract implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setResponse(array $response) /* : void */ { @@ -68,16 +70,13 @@ class Response extends ResponseAbstract implements RenderableInterface /** * Remove response by ID. * - * @param int $id Response ID + * @param mixed $id Response ID * * @return bool * - * @throws \Exception - * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function remove(int $id) : bool + public function remove($id) : bool { if (isset($this->response[$id])) { unset($this->response[$id]); @@ -88,14 +87,6 @@ class Response extends ResponseAbstract implements RenderableInterface return false; } - /** - * {@inheritdoc} - */ - public function getProtocolVersion() : string - { - return '1.0'; - } - /** * {@inheritdoc} */ @@ -109,10 +100,7 @@ class Response extends ResponseAbstract implements RenderableInterface * * @return string * - * @throws \Exception - * * @since 1.0.0 - * @author Dennis Eichhorn */ public function render() : string { @@ -135,7 +123,6 @@ class Response extends ResponseAbstract implements RenderableInterface * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function getRaw() : string { @@ -186,12 +173,4 @@ class Response extends ResponseAbstract implements RenderableInterface return $result; } } - - /** - * {@inheritdoc} - */ - public function getReasonPhrase() : string - { - return $this->header->getHeader('Status'); - } } diff --git a/Message/Http/Rest.php b/Message/Http/Rest.php index 4ed7e3d9c..9feff40d1 100644 --- a/Message/Http/Rest.php +++ b/Message/Http/Rest.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Message\Http; * * @category Framework * @package phpOMS\Request - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class Rest * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function request(Request $request) : string { diff --git a/Message/Mail/EmailAbstract.php b/Message/Mail/EmailAbstract.php new file mode 100644 index 000000000..8fe899e90 --- /dev/null +++ b/Message/Mail/EmailAbstract.php @@ -0,0 +1,525 @@ +host = $host; + $this->port = $port; + $this->timeout = $timeout; + $this->ssl = $ssl; + + imap_timeout(IMAP_OPENTIMEOUT, $timeout); + imap_timeout(IMAP_READTIMEOUT, $timeout); + imap_timeout(IMAP_WRITETIMEOUT, $timeout); + imap_timeout(IMAP_CLOSETIMEOUT, $timeout); + } + + /** + * Decode + * + * @param string $host Content to decode + * @param int $encoding Encoding type + * + * @since 1.0.0 + */ + public static function decode(string $content, int $encoding) + { + if ($encoding == 3) { + return imap_base64($content); + } else { + if ($encoding == 1) { + return imap_8bit($content); + } else { + return imap_qprint($content); + } + } + } + + /** + * Descrutor + * + * @since 1.0.0 + */ + public function __destruct() + { + $this->disconnect(); + } + + /** + * Disconnect server + * + * @since 1.0.0 + */ + public function disconnect() + { + if(!isset($this->con)) { + imap_close($this->con); + $this->con = null; + } + } + + /** + * Connect to server + * + * @param string $user Username + * @param string $pass Password + * + * @return void + * + * @since 1.0.0 + */ + public function connect(string $user = '', string $pass = '') /* : void */ + { + $this->mailbox = substr($this->mailbox, 0, -1) . ($this->ssl ? '/ssl/validate-cert' : '/novalidate-cert') . '}'; + + // /novalidate-cert + if(!isset($this->con)) { + $this->con = imap_open($this->mailbox . 'INBOX', $user, $pass); + } + } + + /** + * Test connection + * + * @return bool + * + * @since 1.0.0 + */ + public function isConnected() : bool + { + return imap_ping($this->con); + } + + /** + * Get boxes. + * + * @param string $pattern Pattern for boxes + * + * @return array + * + * @since 1.0.0 + */ + public function getBoxes(string $pattern = '*') : array + { + return imap_list($this->con, $this->host, $pattern); + } + + /** + * Get inbox quota. + * + * @return mixed + * + * @since 1.0.0 + */ + public function getQuota() + { + return imap_get_quotaroot($this->con, "INBOX"); + } + + /** + * Get email. + * + * @param mixed $id mail id + * + * @return Mail + * + * @since 1.0.0 + */ + public function getEmail($id) : Mail + { + $mail = new Mail($id); + $mail->setOverview(imap_fetch_overview($this->con, $id)); + $mail->setBody(imap_fetchbody($this->con, $id, 2)); + $mail->setEncoding(imap_fetchstructure($this->con, $id)); + + return $mail; + } + + /** + * Get all inbox messages. + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxAll() : array + { + return $this->getInboxOverview('ALL'); + } + + /** + * Get inbox overview. + * + * @param string $option Inbox option (imap_search creterias) + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxOverview(string $option = 'ALL') : array + { + $ids = imap_search($this->con, $option, SE_FREE, 'UTF-8'); + + return is_array($ids) ? imap_fetch_overview($this->con, implode(',', $ids)) : []; + } + + /** + * Get all new inbox messages. + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxNew() : array + { + return $this->getInboxOverview('NEW'); + } + + /** + * Get all inbox messages from a person. + * + * @param string $from Messages from + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxFrom(string $from) : array + { + return $this->getInboxOverview('FROM "' . $from . '"'); + } + + /** + * Get all inbox messages to a person. + * + * @param string $to Messages to + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxTo(string $to) : array + { + return $this->getInboxOverview('TO "' . $to . '"'); + } + + /** + * Get all inbox messages cc a person. + * + * @param string $cc Messages cc + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxCc(string $cc) : array + { + return $this->getInboxOverview('CC "' . $cc . '"'); + } + + /** + * Get all inbox messages bcc a person. + * + * @param string $bcc Messages bcc + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxBcc(string $bcc) : array + { + return $this->getInboxOverview('BCC "' . $bcc . '"'); + } + + /** + * Get all answered inbox messages. + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxAnswered() : array + { + return $this->getInboxOverview('ANSWERED'); + } + + /** + * Get all inbox messages with a certain subject. + * + * @param string $subject Subject + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxSubject(string $subject) : array + { + return $this->getInboxOverview('SUBJECT "' . $subject . '"'); + } + + /** + * Get all inbox messages from a certain date onwards. + * + * @param \DateTime $since Messages since + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxSince(\DateTime $since) : array + { + return $this->getInboxOverview('SINCE "' . $since->format('d-M-Y') . '"'); + } + + /** + * Get all unseen inbox messages. + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxUnseen() : array + { + return $this->getInboxOverview('UNSEEN'); + } + + /** + * Get all seen inbox messages. + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxSeen() : array + { + return $this->getInboxOverview('SEEN'); + } + + /** + * Get all deleted inbox messages. + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxDeleted() : array + { + return $this->getInboxOverview('DELETED'); + } + + /** + * Get all inbox messages with text. + * + * @param string $text Text in message body + * + * @return array + * + * @since 1.0.0 + */ + public function getInboxText(string $text) : array + { + return $this->getInboxOverview('TEXT "' . $text . '"'); + } + + /** + * List mailboxes + * + * @return array + * + * @since 1.0.0 + */ + public function listMailbox() : array + { + return imap_listmailbox($this->con, $this->mailbox, '*'); + } + + /** + * Create mailbox + * + * @param string $mailbox Mailbox to create + * + * @return bool + * + * @since 1.0.0 + */ + public function createMailbox(string $mailbox) : bool + { + return imap_createmailbox($this->con, $mailbox); + } + + /** + * Rename mailbox + * + * @param string $old Old mailbox name + * @param string $new New mailbox name + * + * @return bool + * + * @since 1.0.0 + */ + public function renameMailbox(string $old, string $new) : bool + { + return imap_renamemailbox($this->con, $old, $new); + } + + /** + * Delete mailbox + * + * @param string $mailbox Mailbox to delete + * + * @return bool + * + * @since 1.0.0 + */ + public function deleteMailbox(string $mailbox) : bool + { + return imap_deletemailbox($this->con, $mailbox); + } + + /** + * Check message to delete + * + * @param int $id Message id + * + * @return bool + * + * @since 1.0.0 + */ + public function deleteMessage(int $id) : bool + { + return imap_delete($this->con, $id); + } + + /** + * Delete all marked messages + * + * @return bool + * + * @since 1.0.0 + */ + public function deleteMarkedMessages() : bool + { + return imap_expunge($this->con); + } + + /** + * Check message to delete + * + * @param int $length Amount of message overview + * @param int $start Start index of the overview for pagination + * + * @return array + * + * @since 1.0.0 + */ + public function getMessageOverview(int $length = 0, int $start = 1) : array + { + if($length === 0) { + $info = imap_check($this->con); + $length = $info->Nmsgs; + } + + return imap_fetch_overview($mbox, $start . ':' . ($length + $start), 0); + } + + /** + * Count messages + * + * @return int + * + * @since 1.0.0 + */ + public function countMessages() : int + { + return imap_num_msg($this->con); + } + + /** + * Get message header + * + * @param int $id Message id + * + * @return string + * + * @since 1.0.0 + */ + public function getMessageHeader(int $id) : string + { + return imap_fetchheader($this->con, $id); + } +} diff --git a/Message/Mail/Imap.php b/Message/Mail/Imap.php index 072d91f13..4e19db672 100644 --- a/Message/Mail/Imap.php +++ b/Message/Mail/Imap.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,341 +20,40 @@ namespace phpOMS\Message\Mail; * * @category Framework * @package phpOMS\Message\Mail - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ -class Imap extends Mail +class Imap extends EmailAbstract { /** - * Mail inbox. + * Construct * - * @var resource - * @since 1.0.0 - */ - private $inbox = null; - - /** - * Host. - * - * @var string - * @since 1.0.0 - */ - private $host = ''; - - /** - * User. - * - * @var string - * @since 1.0.0 - */ - private $user = ''; - - /** - * Constructor. + * @param string $host Host + * @param int $port Host port + * @param int $timeout Timeout + * @param bool $ssl Use ssl * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function __construct() + public function __construct(string $host = 'localhost', int $port = 25, int $timeout = 30, bool $ssl = false) { - parent::__construct(MailType::IMAP); - } - - public static function decode($content, $encoding) - { - if ($encoding == 3) { - return imap_base64($content); - } else { - if ($encoding == 1) { - return imap_8bit($content); - } else { - return imap_qprint($content); - } - } + parent::__construct($host, $port, $timeout, $ssl); } /** - * Destructor. + * Connect to server + * + * @param string $user Username + * @param string $pass Password + * + * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function __destruct() + public function connect(string $user = '', string $pass = '') /* : void */ { - if (isset($this->inbox)) { - imap_close($this->inbox); - } - } - - /** - * Connect to inbox. - * - * @param string $host Host - * @param string $user User - * @param string $password Password - * - * @return bool - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function connect($host, $user, $password) - { - $this->host = $host; - $this->user = $user; - $this->inbox = imap_open($host, $user, $password); - - return !($this->inbox === false); - } - - /** - * Get boxes. - * - * @param string $pattern Pattern for boxes - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getBoxes(string $pattern = '*') : array - { - return imap_list($this->inbox, $this->host, $pattern); - } - - /** - * Get inbox quota. - * - * @return mixed - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getQuota() - { - return imap_get_quotaroot($this->inbox, "INBOX"); - } - - /** - * Get email. - * - * @param mixed $id mail id - * - * @return Mail - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getEmail($id) : Mail - { - $mail = new Mail($id); - $mail->setOverview(imap_fetch_overview($this->inbox, $id)); - $mail->setBody(imap_fetchbody($this->inbox, $id, 2)); - $mail->setEncoding(imap_fetchstructure($this->inbox, $id)); - - return $mail; - } - - /** - * Get all inbox messages. - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxAll() : array - { - return $this->getInboxOverview('ALL'); - } - - /** - * Get inbox overview. - * - * @param string $option Inbox option (imap_search creterias) - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxOverview(string $option = 'ALL') : array - { - $ids = imap_search($this->inbox, $option, SE_FREE, 'UTF-8'); - - return is_array($ids) ? imap_fetch_overview($this->inbox, implode(',', $ids)) : []; - } - - /** - * Get all new inbox messages. - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxNew() : array - { - return $this->getInboxOverview('NEW'); - } - - /** - * Get all inbox messages from a person. - * - * @param string $from Messages from - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxFrom(string $from) : array - { - return $this->getInboxOverview('FROM "' . $from . '"'); - } - - /** - * Get all inbox messages to a person. - * - * @param string $to Messages to - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxTo(string $to) : array - { - return $this->getInboxOverview('TO "' . $to . '"'); - } - - /** - * Get all inbox messages cc a person. - * - * @param string $cc Messages cc - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxCc(string $cc) : array - { - return $this->getInboxOverview('CC "' . $cc . '"'); - } - - /** - * Get all inbox messages bcc a person. - * - * @param string $bcc Messages bcc - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxBcc(string $bcc) : array - { - return $this->getInboxOverview('BCC "' . $bcc . '"'); - } - - /** - * Get all answered inbox messages. - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxAnswered() : array - { - return $this->getInboxOverview('ANSWERED'); - } - - /** - * Get all inbox messages with a certain subject. - * - * @param string $subject Subject - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxSubject(string $subject) : array - { - return $this->getInboxOverview('SUBJECT "' . $subject . '"'); - } - - /** - * Get all inbox messages from a certain date onwards. - * - * @param \DateTime $since Messages since - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxSince(\DateTime $since) : array - { - return $this->getInboxOverview('SINCE "' . $since->format('d-M-Y') . '"'); - } - - /** - * Get all unseen inbox messages. - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxUnseen() : array - { - return $this->getInboxOverview('UNSEEN'); - } - - /** - * Get all seen inbox messages. - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxSeen() : array - { - return $this->getInboxOverview('SEEN'); - } - - /** - * Get all deleted inbox messages. - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxDeleted() : array - { - return $this->getInboxOverview('DELETED'); - } - - /** - * Get all inbox messages with text. - * - * @param string $text Text in message body - * - * @return array - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getInboxText(string $text) : array - { - return $this->getInboxOverview('TEXT "' . $text . '"'); + $this->mailbox = '{' . $this->host . ':' . $this->port . '/imap}'; + parent::connect(); } } diff --git a/Message/Mail/Mail.php b/Message/Mail/Mail.php index 468a737a1..bc52fb4c5 100644 --- a/Message/Mail/Mail.php +++ b/Message/Mail/Mail.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Message\Mail; * * @category Framework * @package phpOMS\Message\Mail - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -142,14 +138,6 @@ class Mail */ protected $encoding = 0; - /** - * Mail type. - * - * @var int - * @since 1.0.0 - */ - protected $type = MailType::MAIL; - /** * Mail host name. * @@ -182,18 +170,12 @@ class Mail */ protected $messageDate = null; - /** - * todo: ??? - */ - protected $mailer = null; - /** * Constructor. * * @param mixed $id Id * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($id) { @@ -208,7 +190,6 @@ class Mail * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setBody(string $body) /* : void */ { @@ -223,7 +204,6 @@ class Mail * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setOverview(string $overview) /* : void */ { @@ -238,7 +218,6 @@ class Mail * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setEncoding(int $encoding) /* : void */ { diff --git a/Message/Mail/MailType.php b/Message/Mail/MailType.php deleted file mode 100644 index 842d49c1d..000000000 --- a/Message/Mail/MailType.php +++ /dev/null @@ -1,40 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - -namespace phpOMS\Message\Mail; - -use phpOMS\Datatypes\Enum; - -/** - * Mail type. - * - * @category Framework - * @package phpOMS\Message\Mail - * @author OMS Development Team - * @author Dennis Eichhorn - * @license OMS License 1.0 - * @link http://orange-management.com - * @since 1.0.0 - */ -abstract class MailType extends Enum -{ - /* public */ const MAIL = 0; - /* public */ const SMTP = 1; - /* public */ const IMAP = 2; - /* public */ const POP3 = 3; - /* public */ const SENDMAIL = 4; -} diff --git a/Message/Mail/Nntp.php b/Message/Mail/Nntp.php new file mode 100644 index 000000000..a0a905d23 --- /dev/null +++ b/Message/Mail/Nntp.php @@ -0,0 +1,59 @@ +mailbox = '{' . $this->host . ':' . $this->port . '/nntp' . '}'; + parent::connect(); + } +} diff --git a/Message/Mail/OAuth.php b/Message/Mail/OAuth.php deleted file mode 100644 index 12c0ee75a..000000000 --- a/Message/Mail/OAuth.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - namespace phpOMS\Message\Mail; - -class OAuth -{ - -} \ No newline at end of file diff --git a/Message/Mail/Pop3.php b/Message/Mail/Pop3.php index 187512318..38830a32d 100644 --- a/Message/Mail/Pop3.php +++ b/Message/Mail/Pop3.php @@ -6,17 +6,54 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ declare(strict_types=1); - namespace phpOMS\Message\Mail; -class Pop3 +namespace phpOMS\Message\Mail; + +/** + * Imap mail class. + * + * @category Framework + * @package phpOMS\Message\Mail + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Pop3 extends EmailAbstract { + /** + * Construct + * + * @param string $host Host + * @param int $port Host port + * @param int $timeout Timeout + * @param bool $ssl Use ssl + * + * @since 1.0.0 + */ + public function __construct(string $host = 'localhost', int $port = 25, int $timeout = 30, bool $ssl = false) + { + parent::__construct($host, $port, $timeout, $ssl); + } -} \ No newline at end of file + /** + * Connect to server + * + * @param string $user Username + * @param string $pass Password + * + * @return void + * + * @since 1.0.0 + */ + public function connect(string $user = '', string $pass = '') /* : void */ + { + $this->mailbox = '{' . $this->host . ':' . $this->port . '/pop3' . '}'; + parent::connect(); + } +} diff --git a/Message/Mail/Smtp.php b/Message/Mail/Smtp.php deleted file mode 100644 index 15b154eae..000000000 --- a/Message/Mail/Smtp.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @author Dennis Eichhorn - * @copyright Dennis Eichhorn - * @license OMS License 1.0 - * @version 1.0.0 - * @link http://orange-management.com - */ -declare(strict_types=1); - namespace phpOMS\Message\Mail; - -class Smtp -{ - -} \ No newline at end of file diff --git a/Message/MessageInterface.php b/Message/MessageInterface.php index 55cb82c68..071b36133 100644 --- a/Message/MessageInterface.php +++ b/Message/MessageInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,30 +20,18 @@ namespace phpOMS\Message; * * @category Framework * @package phpOMS\Response - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ interface MessageInterface { - - /** - * Retrieves the HTTP protocol version as a string. - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getProtocolVersion(); - /** * Retrieves all message header values. * * @return HeaderAbstract * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHeader() : HeaderAbstract; @@ -55,29 +41,6 @@ interface MessageInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBody() : string; - - /** - * Get account id. - * - * @return int Account id - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getAccount() : int; - - /** - * Set account id. - * - * @param int $account Account id - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setAccount(int $account) /* : void */; } diff --git a/Message/RequestAbstract.php b/Message/RequestAbstract.php index 1b2108276..8c2edfff5 100644 --- a/Message/RequestAbstract.php +++ b/Message/RequestAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Message; -use phpOMS\Datatypes\Exception\InvalidEnumValue; +use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; use phpOMS\Localization\Localization; use phpOMS\Uri\UriInterface; @@ -28,8 +26,6 @@ use phpOMS\Uri\UriInterface; * * @category Request * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -76,45 +72,13 @@ abstract class RequestAbstract implements MessageInterface */ protected $data = []; - /** - * Request data. - * - * @var array - * @since 1.0.0 - */ - protected $path = []; - - /** - * Localization. - * - * @var Localization - * @since 1.0.0 - */ - protected $l11n = null; - - /** - * Language. - * - * @var string - * @since 1.0.0 - */ - protected $language = ''; - - /** - * Account. - * - * @var int - * @since 1.0.0 - */ - protected $account = null; - /** * Request type. * * @var \phpOMS\Message\RequestSource * @since 1.0.0 */ - private $source = null; + protected $source = RequestSource::UNDEFINED; /** * Request hash. @@ -144,7 +108,6 @@ abstract class RequestAbstract implements MessageInterface * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -156,7 +119,6 @@ abstract class RequestAbstract implements MessageInterface * @return UriInterface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getUri() : UriInterface { @@ -169,30 +131,18 @@ abstract class RequestAbstract implements MessageInterface * @param UriInterface $uri * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setUri(UriInterface $uri) /* : void */ { $this->uri = $uri; } - /** - * Get request language. - * - * @return string - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - abstract public function getLanguage() : string; - /** * Get request hash. * * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHash() : array { @@ -200,20 +150,30 @@ abstract class RequestAbstract implements MessageInterface } /** - * {@inheritdoc} + * Get request source. + * + * @return int + * + * @since 1.0.0 */ - public function getRequestSource() + public function getRequestSource() : int { return $this->source; } /** - * {@inheritdoc} + * Set request source. + * + * @param int $source Request source + * + * @return void + * + * @since 1.0.0 */ - public function setRequestSource($source) /* : void */ + public function setRequestSource(int $source) /* : void */ { if (!RequestSource::isValidValue($source)) { - throw new InvalidEnumValue($source); + throw new InvalidEnumValue((string) $source); } $this->source = $source; @@ -225,7 +185,6 @@ abstract class RequestAbstract implements MessageInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function getMethod() : string; @@ -235,25 +194,12 @@ abstract class RequestAbstract implements MessageInterface * @param string $method * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setMethod(string $method) /* : void */ { $this->method = $method; } - /** - * {@inheritdoc} - */ - public function getPath($key = null) /* : ?string */ - { - if ($key === null) { - return $this->path; - } - - return $this->path[$key] ?? null; - } - /** * {@inheritdoc} */ @@ -278,7 +224,6 @@ abstract class RequestAbstract implements MessageInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setData($key, $value, bool $overwrite = true) : bool { @@ -294,50 +239,24 @@ abstract class RequestAbstract implements MessageInterface return false; } - /** - * {@inheritdoc} - */ - public function getL11n() : Localization - { - return $this->l11n; - } - /** * Lock request for further manipulations. * * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function lock() /* : void */ { $this->lock = true; } - /** - * {@inheritdoc} - */ - public function getAccount() : int - { - return $this->account; - } - - /** - * {@inheritdoc} - */ - public function setAccount(int $account) /* : void */ - { - $this->account = $account; - } - /** * Get request header. * * @return HeaderAbstract * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHeader() : HeaderAbstract { @@ -363,7 +282,6 @@ abstract class RequestAbstract implements MessageInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function getRequestTarget() : string; @@ -373,7 +291,6 @@ abstract class RequestAbstract implements MessageInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function getRouteVerb() : int; } diff --git a/Message/RequestSource.php b/Message/RequestSource.php index e0afe2681..3b30da6df 100644 --- a/Message/RequestSource.php +++ b/Message/RequestSource.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Message; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Request source enum. * * @category Request * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,4 +31,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; /* Request through socket connection */ } diff --git a/Message/ResponseAbstract.php b/Message/ResponseAbstract.php index e69639d91..b1375f5aa 100644 --- a/Message/ResponseAbstract.php +++ b/Message/ResponseAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,23 +23,12 @@ use phpOMS\Utils\ArrayUtils; * * @category Framework * @package phpOMS\Response - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable { - - /** - * Localization. - * - * @var Localization - * @since 1.0.0 - */ - protected $l11n = null; - /** * Responses. * @@ -50,22 +37,6 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable */ protected $response = []; - /** - * Response status. - * - * @var string - * @since 1.0.0 - */ - protected $status = 200; - - /** - * Account. - * - * @var int - * @since 1.0.0 - */ - protected $account = null; - /** * Header. * @@ -74,14 +45,6 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable */ protected $header = null; - /** - * {@inheritdoc} - */ - public function getL11n() : Localization - { - return $this->l11n; - } - /** * Get response by ID. * @@ -90,7 +53,6 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function &get($id) { @@ -107,48 +69,12 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set($key, $response, bool $overwrite = true) /* : void */ { $this->response = ArrayUtils::setArray((string) $key, $this->response, $response, ':', $overwrite); } - /** - * {@inheritdoc} - * todo: shouldn't this only be available in the header?! - */ - public function setStatusCode(string $status) /* : void */ - { - $this->status = $status; - $this->header->generate($status); - } - - /** - * {@inheritdoc} - * todo: shouldn't this only be available in the header?! - */ - public function getStatusCode() : string - { - return $this->status; - } - - /** - * {@inheritdoc} - */ - public function getAccount() : int - { - return $this->account; - } - - /** - * {@inheritdoc} - */ - public function setAccount(int $account) /* : void */ - { - $this->account = $account; - } - /** * {@inheritdoc} */ @@ -165,7 +91,6 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function toArray() : array; @@ -175,7 +100,6 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable * @return HeaderAbstract * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHeader() : HeaderAbstract { @@ -188,7 +112,6 @@ abstract class ResponseAbstract implements MessageInterface, \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function getBody() : string; } diff --git a/Message/ResponseType.php b/Message/ResponseType.php index 415b41a14..5681897b8 100644 --- a/Message/ResponseType.php +++ b/Message/ResponseType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Message; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Request type enum. * * @category Framework * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Message/Socket/Request.php b/Message/Socket/Request.php index 6b20298d4..e44169e2b 100644 --- a/Message/Socket/Request.php +++ b/Message/Socket/Request.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Message/Socket/Response.php b/Message/Socket/Response.php index bd0dc5035..df4a9bfcd 100644 --- a/Message/Socket/Response.php +++ b/Message/Socket/Response.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Message/UploadedFileInterface.php b/Message/UploadedFileInterface.php index 2286e37c1..2ab08acb7 100644 --- a/Message/UploadedFileInterface.php +++ b/Message/UploadedFileInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Message; * * @category Framework * @package phpOMS\Response - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,7 +31,6 @@ interface UploadedFileInterface * Retrieve a stream representing the uploaded file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStream(); @@ -47,7 +42,6 @@ interface UploadedFileInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function moveTo(string $targetPath); @@ -55,7 +49,6 @@ interface UploadedFileInterface * Retrieve the file size. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSize(); @@ -63,7 +56,6 @@ interface UploadedFileInterface * Retrieve the error associated with the uploaded file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getError(); @@ -71,7 +63,6 @@ interface UploadedFileInterface * Retrieve the filename sent by the client. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getClientFilename(); @@ -79,7 +70,6 @@ interface UploadedFileInterface * Retrieve the media type sent by the client. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getClientMediaType(); } diff --git a/Model/Html/Head.php b/Model/Html/Head.php index 38d2c23fd..250d10f80 100644 --- a/Model/Html/Head.php +++ b/Model/Html/Head.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -28,8 +26,6 @@ use phpOMS\Contract\RenderableInterface; * * @category Framework * @package phpOMS/Model - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -99,7 +95,6 @@ class Head implements RenderableInterface * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -110,7 +105,6 @@ class Head implements RenderableInterface * Set page meta. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMeta() : Meta { @@ -123,7 +117,6 @@ class Head implements RenderableInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getTitle() : string { @@ -138,7 +131,6 @@ class Head implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setTitle(string $title) /* : void */ { @@ -154,7 +146,6 @@ class Head implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addAsset(int $type, string $uri) /* : void */ { @@ -169,7 +160,6 @@ class Head implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLanguage(string $language) /* : void */ { @@ -182,7 +172,6 @@ class Head implements RenderableInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function render() : string { @@ -202,7 +191,6 @@ class Head implements RenderableInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function renderStyle() : string { @@ -220,7 +208,6 @@ class Head implements RenderableInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function renderScript() : string { @@ -242,7 +229,6 @@ class Head implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStyle(string $key, string $style, bool $overwrite = true) /* : void */ { @@ -261,7 +247,6 @@ class Head implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setScript(string $key, string $script, bool $overwrite = true) /* : void */ { @@ -276,7 +261,6 @@ class Head implements RenderableInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStyleAll() : array { @@ -289,7 +273,6 @@ class Head implements RenderableInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getScriptAll() : array { @@ -302,7 +285,6 @@ class Head implements RenderableInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function renderAssets() : string { @@ -324,7 +306,6 @@ class Head implements RenderableInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function renderAssetsLate() : string { diff --git a/Model/Html/Meta.php b/Model/Html/Meta.php index 7e2f236f7..1725be601 100644 --- a/Model/Html/Meta.php +++ b/Model/Html/Meta.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Contract\RenderableInterface; * * @category Framework * @package phpOMS/Model - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -81,9 +77,8 @@ class Meta implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function addKeyword(string $keyword) + public function addKeyword(string $keyword) /* : void */ { if (!in_array($keyword, $this->keywords)) { $this->keywords[] = $keyword; @@ -96,7 +91,6 @@ class Meta implements RenderableInterface * @return string[] Keywords * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getKeywords() : array { @@ -109,7 +103,6 @@ class Meta implements RenderableInterface * @return string Author * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAuthor() : string { @@ -124,7 +117,6 @@ class Meta implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAuthor(string $author) /* : void */ { @@ -137,7 +129,6 @@ class Meta implements RenderableInterface * @return string Charset * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCharset() : string { @@ -152,7 +143,6 @@ class Meta implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCharset(string $charset) /* : void */ { @@ -165,7 +155,6 @@ class Meta implements RenderableInterface * @return string Descritpion * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDescription() : string { @@ -180,7 +169,6 @@ class Meta implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDescription(string $description) /* : void */ { @@ -193,7 +181,6 @@ class Meta implements RenderableInterface * @return string Language * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLanguage() : string { @@ -208,7 +195,6 @@ class Meta implements RenderableInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLanguage(string $language) /* : void */ { diff --git a/Module/ActivateAbstract.php b/Module/ActivateAbstract.php index 59b2e5355..91957ea00 100644 --- a/Module/ActivateAbstract.php +++ b/Module/ActivateAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\DatabasePool; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ class ActivateAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function activate(DatabasePool $dbPool, InfoManager $info) /* : void */ { @@ -60,7 +55,6 @@ class ActivateAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function activateRoutes(string $destRoutePath, string $srcRoutePath) /* : void */ { @@ -76,7 +70,6 @@ class ActivateAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function activateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */ { diff --git a/Module/ConsoleInterface.php b/Module/ConsoleInterface.php index dc9aca668..e84fad460 100644 --- a/Module/ConsoleInterface.php +++ b/Module/ConsoleInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Module; * * @category Module * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ interface ConsoleInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function callConsole(); } diff --git a/Module/DeactivateAbstract.php b/Module/DeactivateAbstract.php index 8d955ca62..1e3f3b763 100644 --- a/Module/DeactivateAbstract.php +++ b/Module/DeactivateAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\DatabasePool; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ class DeactivateAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function deactivate(DatabasePool $dbPool, InfoManager $info) /* : void */ { @@ -60,7 +55,6 @@ class DeactivateAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function deactivateRoutes(string $destRoutePath, string $srcRoutePath) /* : void */ { @@ -76,7 +70,6 @@ class DeactivateAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function deactivateInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */ { diff --git a/Module/Exception/InvalidModuleException.php b/Module/Exception/InvalidModuleException.php new file mode 100644 index 000000000..0ffdab349 --- /dev/null +++ b/Module/Exception/InvalidModuleException.php @@ -0,0 +1,42 @@ + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -27,8 +25,6 @@ use phpOMS\Utils\ArrayUtils; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -58,7 +54,6 @@ class InfoManager * @param string $path Info file path * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($path) { @@ -71,7 +66,6 @@ class InfoManager * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPath() : string { @@ -83,8 +77,9 @@ class InfoManager * * @return void * + * @throws PathException This exception is thrown in case the info file path doesn't exist. + * * @since 1.0.0 - * @author Dennis Eichhorn */ public function load() /* : void */ { @@ -101,7 +96,6 @@ class InfoManager * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function update() /* : void */ { @@ -120,7 +114,6 @@ class InfoManager * @param string $delim Delimiter of path * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(string $path, $data, string $delim = '/') /* : void */ { @@ -137,7 +130,6 @@ class InfoManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get() : array { @@ -150,7 +142,6 @@ class InfoManager * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getInternalName() : string { @@ -163,7 +154,6 @@ class InfoManager * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getExternalName() : string { @@ -176,7 +166,6 @@ class InfoManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDependencies() : array { @@ -189,7 +178,6 @@ class InfoManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getProviding() : array { @@ -202,7 +190,6 @@ class InfoManager * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDirectory() : string { @@ -215,7 +202,6 @@ class InfoManager * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCategory() : string { @@ -228,7 +214,6 @@ class InfoManager * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getVersion() : string { @@ -241,7 +226,6 @@ class InfoManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLoad() : array { diff --git a/Module/InstallerAbstract.php b/Module/InstallerAbstract.php index e616c583e..05678fc14 100644 --- a/Module/InstallerAbstract.php +++ b/Module/InstallerAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -29,8 +27,6 @@ use phpOMS\Utils\Parser\Php\ArrayParser; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class InstallerAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function registerInDatabase(DatabasePool $dbPool, InfoManager $info) /* : void */ { @@ -74,7 +69,7 @@ class InstallerAbstract $load = $info->getLoad(); foreach ($load as $val) { foreach ($val['pid'] as $pid) { - $sth->bindValue(':pid', $pid, \PDO::PARAM_STR); + $sth->bindValue(':pid', sha1(str_replace('/', '', $pid)), \PDO::PARAM_STR); $sth->bindValue(':type', $val['type'], \PDO::PARAM_INT); $sth->bindValue(':from', $val['from'], \PDO::PARAM_STR); $sth->bindValue(':for', $val['for'], \PDO::PARAM_STR); @@ -99,7 +94,6 @@ class InstallerAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function install(string $modulePath, DatabasePool $dbPool, InfoManager $info) /* : void */ { @@ -117,7 +111,6 @@ class InstallerAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function activate(DatabasePool $dbPool, InfoManager $info) /* : void */ { @@ -135,7 +128,6 @@ class InstallerAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function reInit(string $modulePath, InfoManager $info) /* : void */ { @@ -153,7 +145,6 @@ class InstallerAbstract * @throws PermissionException * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function initRoutes(string $modulePath, InfoManager $info) /* : void */ { @@ -180,7 +171,6 @@ class InstallerAbstract * @throws PermissionException * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function installRoutes(string $destRoutePath, string $srcRoutePath) /* : void */ { diff --git a/Module/ModuleAbstract.php b/Module/ModuleAbstract.php index 9dab3c781..fe2823a85 100644 --- a/Module/ModuleAbstract.php +++ b/Module/ModuleAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Module; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -94,7 +90,6 @@ abstract class ModuleAbstract * @param \phpOMS\ApplicationAbstract $app Application instance * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($app) { @@ -105,7 +100,6 @@ abstract class ModuleAbstract * Install external. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function installExternal() /* : void */ { @@ -120,7 +114,6 @@ abstract class ModuleAbstract * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getLocalization(string $language, string $destination) : array { @@ -174,7 +167,6 @@ abstract class ModuleAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEventId() : string { diff --git a/Module/ModuleFactory.php b/Module/ModuleFactory.php index 62f60a550..9858338db 100644 --- a/Module/ModuleFactory.php +++ b/Module/ModuleFactory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -27,8 +25,6 @@ use phpOMS\Autoloader; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -58,7 +54,6 @@ class ModuleFactory * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -73,7 +68,6 @@ class ModuleFactory * @return ModuleAbstract * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getInstance(string $module, ApplicationAbstract $app) : ModuleAbstract { @@ -103,7 +97,6 @@ class ModuleFactory * @param ModuleAbstract $obj Current module * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function registerRequesting(ModuleAbstract $obj) /* : void */ { @@ -122,7 +115,6 @@ class ModuleFactory * @param ModuleAbstract $obj Current module * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function registerProvided(ModuleAbstract $obj) /* : void */ { diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index de77d3e46..5fce9799f 100644 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,6 +20,7 @@ use phpOMS\Autoloader; use phpOMS\DataStorage\Database\DatabaseType; use phpOMS\Message\Http\Request; use phpOMS\System\File\PathException; +use phpOMS\Module\Exception\InvalidModuleException; /** * Modules class. @@ -30,8 +29,6 @@ use phpOMS\System\File\PathException; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -101,7 +98,6 @@ class ModuleManager * @param ApplicationAbstract $app Application * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(ApplicationAbstract $app, string $modulePath = '') { @@ -117,7 +113,6 @@ class ModuleManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRoutedModules(Request $request) : array { @@ -141,7 +136,6 @@ class ModuleManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getUriLoad(Request $request) : array { @@ -193,7 +187,6 @@ class ModuleManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLanguageFiles(Request $request) : array { @@ -215,7 +208,6 @@ class ModuleManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getActiveModules() : array { @@ -238,7 +230,6 @@ class ModuleManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAllModules() : array { @@ -269,7 +260,6 @@ class ModuleManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAvailableModules() : array { @@ -283,7 +273,6 @@ class ModuleManager * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function deactivate(string $module) : bool { @@ -319,7 +308,6 @@ class ModuleManager * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function activate(string $module) : bool { @@ -354,10 +342,9 @@ class ModuleManager * * @return bool * - * @throws \Exception + * @throws InvalidModuleException Throws this exception in case the installer doesn't exist * * @since 1.0.0 - * @author Dennis Eichhorn */ public function reInit(string $module) : bool { @@ -366,7 +353,7 @@ class ModuleManager $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Installer'; if (!Autoloader::exists($class)) { - throw new \Exception('Module installer does not exist'); + throw new InvalidModuleException($info->getDirectory()); } $class::reInit($this->modulePath, $info); @@ -380,7 +367,6 @@ class ModuleManager * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function install(string $module) : bool { @@ -434,7 +420,6 @@ class ModuleManager * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function installDependencies(array $dependencies) /* : void */ { @@ -450,10 +435,9 @@ class ModuleManager * * @return void * - * @throws \Exception + * @throws InvalidModuleException Throws this exception in case the installer doesn't exist * * @since 1.0.0 - * @author Dennis Eichhorn */ private function installModule(InfoManager $info) /* : void */ { @@ -461,7 +445,7 @@ class ModuleManager $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Installer'; if (!Autoloader::exists($class)) { - throw new \Exception('Module installer does not exist'); + throw new InvalidModuleException($info->getDirectory()); } $class::install($this->modulePath, $this->app->dbPool, $info); @@ -474,17 +458,16 @@ class ModuleManager * * @return void * - * @throws \Exception + * @throws InvalidModuleException Throws this exception in case the deactiviation doesn't exist * * @since 1.0.0 - * @author Dennis Eichhorn */ private function deactivateModule(InfoManager $info) /* : void */ { $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate'; if (!Autoloader::exists($class)) { - throw new \Exception('Module deactivation does not exist'); + throw new InvalidModuleException($info->getDirectory()); } /** @var $class DeactivateAbstract */ @@ -498,17 +481,16 @@ class ModuleManager * * @return void * - * @throws \Exception + * @throws InvalidModuleException Throws this exception in case the activation doesn't exist * * @since 1.0.0 - * @author Dennis Eichhorn */ private function activateModule(InfoManager $info) /* : void */ { - $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Deactivate'; + $class = '\\Modules\\' . $info->getDirectory() . '\\Admin\\Activate'; if (!Autoloader::exists($class)) { - throw new \Exception('Module deactivation does not exist'); + throw new InvalidModuleException($info->getDirectory()); } /** @var $class ActivateAbstract */ @@ -523,7 +505,6 @@ class ModuleManager * @return InfoManager * * @since 1.0.0 - * @author Dennis Eichhorn */ private function loadInfo(string $module) : InfoManager { @@ -545,14 +526,13 @@ class ModuleManager * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getInstalledModules() : array { if ($this->installed === null) { switch ($this->app->dbPool->get('core')->getType()) { case DatabaseType::MYSQL: - $sth = $this->app->dbPool->get('core')->con->prepare('SELECT `module_id`,`module_theme`,`module_version`,`module_id` FROM `' . $this->app->dbPool->get('core')->prefix . 'module`'); + $sth = $this->app->dbPool->get('core')->con->prepare('SELECT `module_id`,`module_theme`,`module_version` FROM `' . $this->app->dbPool->get('core')->prefix . 'module`'); $sth->execute(); $this->installed = $sth->fetchAll(\PDO::FETCH_GROUP); break; @@ -573,7 +553,6 @@ class ModuleManager * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function installProviding(string $from, string $for) /* : void */ { @@ -594,7 +573,6 @@ class ModuleManager * @throws \InvalidArgumentException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function initModule($modules) /* : void */ { @@ -621,7 +599,6 @@ class ModuleManager * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function initModuleController(string $module) /* : void */ { @@ -643,7 +620,6 @@ class ModuleManager * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(string $module) : ModuleAbstract { @@ -666,7 +642,6 @@ class ModuleManager * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function initRequestModules(Request $request) /* : void */ { diff --git a/Module/NullModule.php b/Module/NullModule.php index fa1054b03..54a919db3 100644 --- a/Module/NullModule.php +++ b/Module/NullModule.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Module; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Module/SocketInterface.php b/Module/SocketInterface.php index 872fefbac..7a81858a2 100644 --- a/Module/SocketInterface.php +++ b/Module/SocketInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Module; * * @category Module * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ interface SocketInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function callSock(); } diff --git a/Module/UninstallAbstract.php b/Module/UninstallAbstract.php index 571f3803b..8bce9306f 100644 --- a/Module/UninstallAbstract.php +++ b/Module/UninstallAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\DatabasePool; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,7 +38,6 @@ class UninstallAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function uninstall(DatabasePool $dbPool, InfoManager $info) /* : void */ { diff --git a/Module/UpdateAbstract.php b/Module/UpdateAbstract.php index 6fd6491dc..2bc826f9f 100644 --- a/Module/UpdateAbstract.php +++ b/Module/UpdateAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\DatabasePool; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,7 +38,6 @@ class UpdateAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function update(DatabasePool $dbPool, InfoManager $info) /* : void */ { diff --git a/Module/WebInterface.php b/Module/WebInterface.php index 16e5ba4f8..f1e95509f 100644 --- a/Module/WebInterface.php +++ b/Module/WebInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Module; * * @category Framework * @package phpOMS\Module - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Pattern/Mediator.php b/Pattern/Mediator.php index 13fb0392d..97eda8ce4 100644 --- a/Pattern/Mediator.php +++ b/Pattern/Mediator.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Pattern; * * @category Pattern * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ interface Mediator extends \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function attach(string $group, \Closure $callback, bool $remove = false) : bool; @@ -55,7 +50,6 @@ interface Mediator extends \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function detach(string $group) : bool; @@ -70,7 +64,6 @@ interface Mediator extends \Countable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addGroup(string $group, string $id) /* : void */; @@ -86,7 +79,6 @@ interface Mediator extends \Countable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function trigger(string $group, string $id, bool $reset = false) /* : void */; } diff --git a/Pattern/Multition.php b/Pattern/Multition.php index 9f9ea99eb..d575ebf5d 100644 --- a/Pattern/Multition.php +++ b/Pattern/Multition.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Pattern; * * @category Pattern * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ interface Multition * @return self * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __clone(); } diff --git a/Pattern/Observer.php b/Pattern/Observer.php index 635ff0513..cb32fd7fb 100644 --- a/Pattern/Observer.php +++ b/Pattern/Observer.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ namespace phpOMS\Pattern; * * @category Pattern * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ interface Observer * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function update(Subject $subject); } diff --git a/Pattern/Singleton.php b/Pattern/Singleton.php index 2ef013943..72f7f6e21 100644 --- a/Pattern/Singleton.php +++ b/Pattern/Singleton.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Pattern; * * @category Pattern * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ interface Singleton * @return Singleton * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getInstance() : Singleton; @@ -47,7 +42,6 @@ interface Singleton * @return self * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __clone(); } diff --git a/Pattern/Subject.php b/Pattern/Subject.php index 1054beac4..31641d3b7 100644 --- a/Pattern/Subject.php +++ b/Pattern/Subject.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ namespace phpOMS\Pattern; * * @category Pattern * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ interface Subject * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function attach(Observer $observer); @@ -52,7 +47,6 @@ interface Subject * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function detach(Observer $observer); @@ -62,7 +56,6 @@ interface Subject * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function notify(); } diff --git a/README.md b/README.md index e1dd432a1..a900bbcb8 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ Are you interested in joining us? Feel free to contact us at spl1nes.com@gmail.c * Developers: 1 * Languages: PHP, JS, Java, HTML, CSS * Dependencies: d3.js, THREE.js, tcpdf, PhpExcel -* Website: [http://orange-management.de/Website](http://orange-management.de/Website) +* Website: [http://website.orange-management.de](http://website.orange-management.de) diff --git a/Router/RouteVerb.php b/Router/RouteVerb.php index 902836360..4c36d6732 100644 --- a/Router/RouteVerb.php +++ b/Router/RouteVerb.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Router; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Route verb enum. * * @category Framework * @package phpOMS\Router - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Router/Router.php b/Router/Router.php index 324875181..7624fdf9c 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Message\RequestAbstract; * * @category Framework * @package phpOMS\Router - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,7 +41,6 @@ class Router * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -59,7 +54,6 @@ class Router * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function importFromFile(string $path) : bool { @@ -83,7 +77,6 @@ class Router * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(string $route, $destination, int $verb = RouteVerb::GET) /* : void */ { @@ -108,7 +101,6 @@ class Router * @throws \InvalidArgumentException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function route($request, int $verb = RouteVerb::GET) : array { @@ -144,7 +136,6 @@ class Router * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function match(string $route, int $routeVerb, string $uri, int $remoteVerb = RouteVerb::GET) : bool { diff --git a/Security/Encryption/Encryption.php b/Security/Encryption/Encryption.php index 1bb5e5c08..16cdd1ff4 100644 --- a/Security/Encryption/Encryption.php +++ b/Security/Encryption/Encryption.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Security\Encryption; * * @category Framework * @package phpOMS\Security\Encryption - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Socket/Client/Client.php b/Socket/Client/Client.php index 91a2dc651..fcd2b9d1f 100644 --- a/Socket/Client/Client.php +++ b/Socket/Client/Client.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\Socket\SocketAbstract; * * @category Framework * @package phpOMS\Socket\Client - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class Client extends SocketAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -55,7 +50,6 @@ class Client extends SocketAbstract * Disconnect from server. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function disconnect() { diff --git a/Socket/Client/ClientConnection.php b/Socket/Client/ClientConnection.php index 4f98812f5..8897cbf68 100644 --- a/Socket/Client/ClientConnection.php +++ b/Socket/Client/ClientConnection.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Socket\Client; * * @category Framework * @package phpOMS\Socket\Client - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Socket/Client/NullClientConnection.php b/Socket/Client/NullClientConnection.php index b098375cd..531405d99 100644 --- a/Socket/Client/NullClientConnection.php +++ b/Socket/Client/NullClientConnection.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Socket\Client; * * @category Framework * @package phpOMS\Socket\Client - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Socket/CommandManager.php b/Socket/CommandManager.php index fe1fdd729..3d3462358 100644 --- a/Socket/CommandManager.php +++ b/Socket/CommandManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -49,7 +47,6 @@ class CommandManager implements \Countable * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -65,7 +62,6 @@ class CommandManager implements \Countable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function attach(string $cmd, $callback, $source) { @@ -82,7 +78,6 @@ class CommandManager implements \Countable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function detach(string $cmd, $source) { @@ -102,7 +97,6 @@ class CommandManager implements \Countable * @return mixed|bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function trigger(string $cmd, $conn, $para) { @@ -119,7 +113,6 @@ class CommandManager implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Socket/Packets/Header.php b/Socket/Packets/Header.php index 0202493ce..2e28616e8 100644 --- a/Socket/Packets/Header.php +++ b/Socket/Packets/Header.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Socket\Packets; * * @category System * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -84,7 +80,6 @@ class Header implements \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLength() { @@ -97,7 +92,6 @@ class Header implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLength($length) /* : void */ { @@ -108,7 +102,6 @@ class Header implements \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getType() { @@ -121,7 +114,6 @@ class Header implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setType($type) /* : void */ { @@ -132,7 +124,6 @@ class Header implements \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSubtype() { @@ -145,7 +136,6 @@ class Header implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setSubtype($subtype) /* : void */ { @@ -158,7 +148,6 @@ class Header implements \Serializable * @return string Json serialization * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serialize() { @@ -171,7 +160,6 @@ class Header implements \Serializable * @return string Json serialization * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __toString() { @@ -186,7 +174,6 @@ class Header implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function unserialize($string) { diff --git a/Socket/Packets/PacketAbstract.php b/Socket/Packets/PacketAbstract.php index f54316589..8a9455db2 100644 --- a/Socket/Packets/PacketAbstract.php +++ b/Socket/Packets/PacketAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ namespace phpOMS\Socket\Packets; * * @category System * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Socket/Packets/PacketManager.php b/Socket/Packets/PacketManager.php index 799eefd31..4753c2684 100644 --- a/Socket/Packets/PacketManager.php +++ b/Socket/Packets/PacketManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -27,8 +25,6 @@ use phpOMS\Socket\Server\ClientManager; * * @category System * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -59,7 +55,6 @@ class PacketManager * @param ClientManager $user Client Manager * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(CommandManager $cmd, ClientManager $user) { @@ -75,7 +70,6 @@ class PacketManager * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function handle(string $data, $client) { diff --git a/Socket/Packets/PacketType.php b/Socket/Packets/PacketType.php index 7a9f510a0..62011fde1 100644 --- a/Socket/Packets/PacketType.php +++ b/Socket/Packets/PacketType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Socket\Packets; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Packet type enum. * * @category Framework * @package phpOMS\Socket\Packets - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Socket/Server/ClientManager.php b/Socket/Server/ClientManager.php index cacf08c87..4b1f2a732 100644 --- a/Socket/Server/ClientManager.php +++ b/Socket/Server/ClientManager.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Socket/Server/Server.php b/Socket/Server/Server.php index bfd115a75..eacdcdd9c 100644 --- a/Socket/Server/Server.php +++ b/Socket/Server/Server.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -27,8 +25,6 @@ use phpOMS\Socket\SocketAbstract; * * @category Framework * @package phpOMS\Socket\Server - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -78,7 +74,6 @@ class Server extends SocketAbstract * @param \Socket\SocketApplication $app socketApplication * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($app) { @@ -93,7 +88,6 @@ class Server extends SocketAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function hasInternet() : bool { @@ -127,7 +121,6 @@ class Server extends SocketAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLimit(int $limit) /* : void */ { diff --git a/Socket/SocketAbstract.php b/Socket/SocketAbstract.php index 70d837547..973b495a7 100644 --- a/Socket/SocketAbstract.php +++ b/Socket/SocketAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Socket; * * @category Socket * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -79,7 +75,6 @@ abstract class SocketAbstract implements SocketInterface * Destructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __destruct() { diff --git a/Socket/SocketInterface.php b/Socket/SocketInterface.php index eccc9d640..a8b18e43a 100644 --- a/Socket/SocketInterface.php +++ b/Socket/SocketInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Socket; * * @category Socket * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Socket/SocketType.php b/Socket/SocketType.php index 4a2b07640..94008f57d 100644 --- a/Socket/SocketType.php +++ b/Socket/SocketType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Socket; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Socket type enum. * * @category Framework * @package phpOMS\Socket - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Datatypes/Address.php b/Stdlib/Base/Address.php similarity index 81% rename from Datatypes/Address.php rename to Stdlib/Base/Address.php index 03e77bb2d..58192c2d4 100644 --- a/Datatypes/Address.php +++ b/Stdlib/Base/Address.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; /** * Address class. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -59,7 +55,6 @@ class Address implements \JsonSerializable * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -72,7 +67,6 @@ class Address implements \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRecipient() : string { @@ -87,7 +81,6 @@ class Address implements \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setRecipient(string $recipient) /* : void */ { @@ -100,7 +93,6 @@ class Address implements \JsonSerializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFAO() : string { @@ -115,7 +107,6 @@ class Address implements \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setFAO(string $fao) /* : void */ { @@ -128,7 +119,6 @@ class Address implements \JsonSerializable * @return Location * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLocation() : Location { @@ -143,7 +133,6 @@ class Address implements \JsonSerializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLocation(Location $location) /* : void */ { diff --git a/Datatypes/AddressType.php b/Stdlib/Base/AddressType.php similarity index 75% rename from Datatypes/AddressType.php rename to Stdlib/Base/AddressType.php index 0938c5ae9..f33b460ba 100644 --- a/Datatypes/AddressType.php +++ b/Stdlib/Base/AddressType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; /** * Address type enum. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Datatypes/Enum.php b/Stdlib/Base/Enum.php similarity index 75% rename from Datatypes/Enum.php rename to Stdlib/Base/Enum.php index 9db193d39..abaaed0d1 100644 --- a/Datatypes/Enum.php +++ b/Stdlib/Base/Enum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; /** * Enum class. @@ -24,8 +22,6 @@ namespace phpOMS\Datatypes; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ abstract class Enum * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isValidValue($value) : bool { @@ -58,7 +53,6 @@ abstract class Enum * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getConstants() : array { @@ -73,7 +67,6 @@ abstract class Enum * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRandom() { @@ -90,15 +83,14 @@ abstract class Enum * * @return mixed * - * @throws \Exception Throws this exception if the constant is not defined in the enum class. + * @throws \UnexpectedValueException Throws this exception if the constant is not defined in the enum class. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getByName(string $name) { if (!self::isValidName($name)) { - throw new \Exception('Undefined constant "' . $name . '"'); + throw new \UnexpectedValueException($name); } return constant('static::' . $name); @@ -111,10 +103,7 @@ abstract class Enum * * @return mixed * - * @throws \Exception Throws this exception if the constant is not defined in the enum class. - * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getName(string $value) { @@ -133,7 +122,6 @@ abstract class Enum * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isValidName(string $name) : bool { @@ -146,7 +134,6 @@ abstract class Enum * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function count() : int { diff --git a/Datatypes/EnumArray.php b/Stdlib/Base/EnumArray.php similarity index 81% rename from Datatypes/EnumArray.php rename to Stdlib/Base/EnumArray.php index c58a27d60..76637b2c9 100644 --- a/Datatypes/EnumArray.php +++ b/Stdlib/Base/EnumArray.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; /** * Enum class. @@ -24,8 +22,6 @@ namespace phpOMS\Datatypes; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ abstract class EnumArray * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isValidName(string $name) : bool { @@ -58,7 +53,6 @@ abstract class EnumArray * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getConstants() : array { @@ -76,7 +70,6 @@ abstract class EnumArray * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isValidValue($value) : bool { @@ -95,7 +88,6 @@ abstract class EnumArray * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function get($key) { diff --git a/Datatypes/ExactFloat.php b/Stdlib/Base/ExactFloat.php similarity index 96% rename from Datatypes/ExactFloat.php rename to Stdlib/Base/ExactFloat.php index 2de68b998..07f1cfc0e 100644 --- a/Datatypes/ExactFloat.php +++ b/Stdlib/Base/ExactFloat.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; class ExactFloat { diff --git a/Datatypes/Exception/InvalidEnumName.php b/Stdlib/Base/Exception/InvalidEnumName.php similarity index 76% rename from Datatypes/Exception/InvalidEnumName.php rename to Stdlib/Base/Exception/InvalidEnumName.php index a6030d555..a15dfa205 100644 --- a/Datatypes/Exception/InvalidEnumName.php +++ b/Stdlib/Base/Exception/InvalidEnumName.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes\Exception; +namespace phpOMS\Stdlib\Base\Exception; /** * Filesystem class. @@ -24,8 +22,6 @@ namespace phpOMS\Datatypes\Exception; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class InvalidEnumName extends \UnexpectedValueException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { diff --git a/Datatypes/Exception/InvalidEnumValue.php b/Stdlib/Base/Exception/InvalidEnumValue.php similarity index 76% rename from Datatypes/Exception/InvalidEnumValue.php rename to Stdlib/Base/Exception/InvalidEnumValue.php index ca7208e4a..fb2a8ef2f 100644 --- a/Datatypes/Exception/InvalidEnumValue.php +++ b/Stdlib/Base/Exception/InvalidEnumValue.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes\Exception; +namespace phpOMS\Stdlib\Base\Exception; /** * Filesystem class. @@ -24,8 +22,6 @@ namespace phpOMS\Datatypes\Exception; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class InvalidEnumValue extends \UnexpectedValueException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { diff --git a/Datatypes/Iban.php b/Stdlib/Base/Iban.php similarity index 81% rename from Datatypes/Iban.php rename to Stdlib/Base/Iban.php index d1ea83f6d..9fc49b8b8 100644 --- a/Datatypes/Iban.php +++ b/Stdlib/Base/Iban.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; -use phpOMS\Validation\Base\IbanEnum; +use phpOMS\Validation\Finance\IbanEnum; /** * Iban class. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -48,7 +44,6 @@ class Iban implements \Serializable * @param string $iban Iban * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $iban) { @@ -63,13 +58,12 @@ class Iban implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parse(string $iban) /* : void */ { $this->iban = self::normalize($iban); - if (!\phpOMS\Validation\Base\Iban::isValid($this->iban)) { + if (!\phpOMS\Validation\Finance\Iban::isValid($this->iban)) { throw new \InvalidArgumentException('Invalid IBAN'); } } @@ -82,7 +76,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function normalize(string $iban) : string { @@ -95,7 +88,6 @@ class Iban implements \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLength() : int { @@ -108,7 +100,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getChecksum() : string { @@ -123,7 +114,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function getSequence(string $sequence) : string { @@ -146,7 +136,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCountry() : string { @@ -159,7 +148,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNationalChecksum() : string { @@ -172,7 +160,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBranchCode() : string { @@ -185,7 +172,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAccountType() : string { @@ -198,7 +184,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCurrency() : string { @@ -211,7 +196,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBankCode() : string { @@ -224,7 +208,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAccount() : string { @@ -237,7 +220,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHoldersKennital() : string { @@ -250,7 +232,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getOwnerAccountNumber() : string { @@ -265,7 +246,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBicCode() : string { @@ -289,7 +269,6 @@ class Iban implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function prettyPrint() : string { diff --git a/Datatypes/Location.php b/Stdlib/Base/Location.php similarity index 83% rename from Datatypes/Location.php rename to Stdlib/Base/Location.php index 14148d1be..38d421a78 100644 --- a/Datatypes/Location.php +++ b/Stdlib/Base/Location.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; /** * Location class. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -99,7 +95,6 @@ class Location implements \JsonSerializable, \Serializable * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -109,7 +104,6 @@ class Location implements \JsonSerializable, \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getId() : int { @@ -120,7 +114,6 @@ class Location implements \JsonSerializable, \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getType() : int { @@ -136,7 +129,6 @@ class Location implements \JsonSerializable, \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPostal() : string { @@ -149,7 +141,6 @@ class Location implements \JsonSerializable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setPostal(string $postal) /* : void */ { @@ -160,7 +151,6 @@ class Location implements \JsonSerializable, \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCity() : string { @@ -173,7 +163,6 @@ class Location implements \JsonSerializable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCity(string $city) /* : void */ { @@ -184,7 +173,6 @@ class Location implements \JsonSerializable, \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCountry() : string { @@ -197,7 +185,6 @@ class Location implements \JsonSerializable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCountry(string $country) /* : void */ { @@ -208,7 +195,6 @@ class Location implements \JsonSerializable, \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAddress() : string { @@ -221,7 +207,6 @@ class Location implements \JsonSerializable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAddress(string $address) /* : void */ { @@ -232,7 +217,6 @@ class Location implements \JsonSerializable, \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getState() : string { @@ -245,7 +229,6 @@ class Location implements \JsonSerializable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setState(string $state) /* : void */ { @@ -256,7 +239,6 @@ class Location implements \JsonSerializable, \Serializable * @return float[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getGeo() : array { @@ -269,7 +251,6 @@ class Location implements \JsonSerializable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setGeo(array $geo) /* : void */ { diff --git a/Datatypes/NullLocation.php b/Stdlib/Base/NullLocation.php similarity index 67% rename from Datatypes/NullLocation.php rename to Stdlib/Base/NullLocation.php index 1c3e562a9..060c35d83 100644 --- a/Datatypes/NullLocation.php +++ b/Stdlib/Base/NullLocation.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; /** * Location class. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Datatypes/PhoneType.php b/Stdlib/Base/PhoneType.php similarity index 72% rename from Datatypes/PhoneType.php rename to Stdlib/Base/PhoneType.php index 8ef821e58..f099ce37a 100644 --- a/Datatypes/PhoneType.php +++ b/Stdlib/Base/PhoneType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,15 +13,13 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; /** * Address type enum. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Datatypes/SmartDateTime.php b/Stdlib/Base/SmartDateTime.php similarity index 65% rename from Datatypes/SmartDateTime.php rename to Stdlib/Base/SmartDateTime.php index c098a8553..d11778478 100644 --- a/Datatypes/SmartDateTime.php +++ b/Stdlib/Base/SmartDateTime.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,9 @@ */ declare(strict_types=1); -namespace phpOMS\Datatypes; +namespace phpOMS\Stdlib\Base; + +use phpOMS\Math\Functions\Functions; /** * SmartDateTime. @@ -24,8 +24,6 @@ namespace phpOMS\Datatypes; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -55,6 +53,20 @@ class SmartDateTime extends \DateTime { parent::__construct($time, $timezone); } + + /** + * Create object from DateTime + * + * @param \DateTime $date DateTime to extend + * + * @return SmartDateTime + * + * @since 1.0.0 + */ + public static function createFromDateTime(\Datetime $date) : SmartDateTime + { + return new self($date->format('Y-m-d H:i:s'), $date->getTimezone()); + } /** * Modify datetime in a smart way. @@ -67,7 +79,6 @@ class SmartDateTime extends \DateTime * @return SmartDateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function createModify(int $y, int $m = 0, int $d = 0, int $calendar = CAL_GREGORIAN) : SmartDateTime { @@ -88,7 +99,6 @@ class SmartDateTime extends \DateTime * @return SmartDateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function smartModify(int $y, int $m = 0, int $d = 0, int $calendar = CAL_GREGORIAN) : SmartDateTime { @@ -124,7 +134,6 @@ class SmartDateTime extends \DateTime * @return SmartDateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEndOfMonth() : SmartDateTime { @@ -137,7 +146,6 @@ class SmartDateTime extends \DateTime * @return SmartDateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStartOfMonth() : SmartDateTime { @@ -150,10 +158,10 @@ class SmartDateTime extends \DateTime * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDaysOfMonth() : int { + // todo: maybe ->format('t') is better return cal_days_in_month(CAL_GREGORIAN, (int) $this->format('m'), (int) $this->format('Y')); } @@ -163,7 +171,6 @@ class SmartDateTime extends \DateTime * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFirstDayOfMonth() : int { @@ -176,7 +183,6 @@ class SmartDateTime extends \DateTime * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isLeapYear() : bool { @@ -189,7 +195,6 @@ class SmartDateTime extends \DateTime * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function leapYear(int $year) : bool { @@ -213,10 +218,13 @@ class SmartDateTime extends \DateTime /** * Get day of week * + * @param int $y Year + * @param int $m Month + * @param int $d Day + * * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getDayOfWeek(int $y, int $m, int $d) : int { @@ -228,10 +236,66 @@ class SmartDateTime extends \DateTime $ry = $y - 1 - $ly; $w = $w + $ry; $w = $w + 2 * $ly; - $w = $w + date("z", mktime(0, 0, 0, $m, $d, $y)) + 1;; + $w = $w + date("z", mktime(0, 0, 0, $m, $d, $y)) + 1; $w = ($w - 1) % 7 + 1; - return $w; + return $w === 7 ? 0 : $w; + } + + /** + * Get day of week + * + * @return int + * + * @since 1.0.0 + */ + public function getFirstDayOfWeek() : int + { + return self::getDayOfWeek((int) $this->format('Y'), (int) $this->format('m'), (int) $this->format('d')); } + /** + * Create calendar array + * + * @param int $weekStartsWith Day of the week start (0 = Sunday) + * + * @return array + * + * @since 1.0.0 + */ + public function getMonthCalendar(int $weekStartsWith = 0) : array + { + $days = []; + + // get day of first day in month + $firstDay = $this->getFirstDayOfMonth(); + + // calculate difference to $weekStartsWith + $diffToWeekStart = Functions::mod($firstDay - $weekStartsWith, 7); + $diffToWeekStart = $diffToWeekStart === 0 ? 7 : $diffToWeekStart; + + // get days of previous month + $previousMonth = $this->createModify(0, -1); + $daysPreviousMonth = $previousMonth->getDaysOfMonth(); + + // add difference to $weekStartsWith counting backwards from days of previous month (reorder so that lowest value first) + for($i = $daysPreviousMonth - $diffToWeekStart; $i < $daysPreviousMonth; $i++) { + $days[] = new \DateTime($previousMonth->format('Y') . '-' . $previousMonth->format('m') . '-' . ($i+1)); + } + + // add normal count of current days + $daysMonth = $this->getDaysOfMonth(); + for($i = 1; $i <= $daysMonth; $i++) { + $days[] = new \DateTime($this->format('Y') . '-' . $this->format('m') . '-' . ($i)); + } + + // add remaining days to next month (7*6 - difference+count of current month) + $remainingDays = 42 - $diffToWeekStart - $daysMonth; + $nextMonth = $this->createModify(0, 1); + for($i = 1; $i <= $remainingDays; $i++) { + $days[] = new \DateTime($nextMonth->format('Y') . '-' . $nextMonth->format('m') . '-' . ($i)); + } + + return $days; + } } diff --git a/Stdlib/Collection/Collection.php b/Stdlib/Collection/Collection.php index 8b65563fe..d5b23ab53 100644 --- a/Stdlib/Collection/Collection.php +++ b/Stdlib/Collection/Collection.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Utils\ArrayUtils; * * @category Framework * @package phpOMS\Stdlib - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @param array $data Collection data * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(array $data) { @@ -59,7 +54,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return array Collection array representation * * @since 1.0.0 - * @author Dennis Eichhorn */ public function toArray() : array { @@ -72,7 +66,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function jsonSerialize() { @@ -87,7 +80,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function avg($filter = null) { @@ -102,7 +94,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function sum($filter = null) { @@ -135,7 +126,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() { @@ -152,7 +142,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return Collection[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function chunk(int $size) : array { @@ -172,7 +161,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return Collection * * @since 1.0.0 - * @author Dennis Eichhorn */ public function collapse() : Collection { @@ -211,7 +199,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function contains($find) : bool { @@ -238,7 +225,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function diff($compare) : array { @@ -278,7 +264,6 @@ class Collection implements \Countable, \ArrayAccess, \Iterator, \JsonSerializab * @return Collection * * @since 1.0.0 - * @author Dennis Eichhorn */ public function every(int $n) : Collection { diff --git a/Stdlib/Graph/BinaryTree.php b/Stdlib/Graph/BinaryTree.php index a3dced390..bd8f5f233 100644 --- a/Stdlib/Graph/BinaryTree.php +++ b/Stdlib/Graph/BinaryTree.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Stdlib\Graph; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -53,7 +49,6 @@ class BinaryTree extends Tree * @return Node Left node * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLeft(Node $base) { @@ -71,7 +66,6 @@ class BinaryTree extends Tree * @return Node Right node * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRight(Node $base) { @@ -90,7 +84,6 @@ class BinaryTree extends Tree * @return BinaryTree * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLeft(Node $base, Node $left) : BinaryTree { @@ -114,7 +107,6 @@ class BinaryTree extends Tree * @return BinaryTree * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setRight(Node $base, Node $right) /* : void */ { @@ -134,7 +126,6 @@ class BinaryTree extends Tree * @param \Closure $callback Task to perform on node * * @since 1.0.0 - * @author Dennis Eichhorn */ public function inOrder(Node $node, \Closure $callback) { @@ -151,7 +142,6 @@ class BinaryTree extends Tree * @param Node[] &$order Ordered nodes by horizontal distance * * @since 1.0.0 - * @author Dennis Eichhorn */ private function getVerticalOrder(Node $node, int $horizontalDistance = 0, array &$order) { @@ -179,7 +169,6 @@ class BinaryTree extends Tree * @param \Closure $callback Task to perform on node * * @since 1.0.0 - * @author Dennis Eichhorn */ public function verticalOrder(Node $node, \Closure $callback) { @@ -202,7 +191,6 @@ class BinaryTree extends Tree * @return bool True if tree is symmetric, false if tree is not symmetric * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isSymmetric(Node $node1 = null, Node $node2 = null) : bool { diff --git a/Stdlib/Graph/Edge.php b/Stdlib/Graph/Edge.php index 279d722b8..3ce06ca2d 100644 --- a/Stdlib/Graph/Edge.php +++ b/Stdlib/Graph/Edge.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Stdlib\Graph; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Stdlib/Graph/Graph.php b/Stdlib/Graph/Graph.php index 1cb6b0f54..78fbddada 100644 --- a/Stdlib/Graph/Graph.php +++ b/Stdlib/Graph/Graph.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Stdlib\Graph; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -54,7 +50,6 @@ class Graph * @return Graph * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addNode(Node $node) : Graph { @@ -72,7 +67,6 @@ class Graph * @return Graph * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addNodeRelative(Node $relative, Node $node) : Graph { @@ -88,7 +82,6 @@ class Graph * @return Graph * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setNode($key, Node $node) : Graph { @@ -105,7 +98,6 @@ class Graph * @return Graph * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addEdge(Edge $edge) : Graph { @@ -123,7 +115,6 @@ class Graph * @return Graph * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setEdge($key, Edge $edge) /* : void */ { @@ -140,7 +131,6 @@ class Graph * @return Node * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNode($key) : Node { @@ -153,7 +143,6 @@ class Graph * @return Node[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNodes() : array { @@ -168,7 +157,6 @@ class Graph * @return Edge * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEdge($key) : Edge { @@ -183,7 +171,6 @@ class Graph * @return Edge[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEdgesOfNode($node) : array { @@ -211,7 +198,6 @@ class Graph * @return Node[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNeighbors($node) : array { @@ -241,7 +227,6 @@ class Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDimension() : int { @@ -255,7 +240,6 @@ class Graph * @return Edge[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBridges() : array { @@ -269,7 +253,6 @@ class Graph * @return Tree * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getKruskalMinimalSpanningTree() : Tree { @@ -283,7 +266,6 @@ class Graph * @return Tree * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPrimMinimalSpanningTree() : Tree { @@ -297,7 +279,6 @@ class Graph * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCircle() : array { @@ -310,7 +291,6 @@ class Graph * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFloydWarshallShortestPath() : array { @@ -323,7 +303,6 @@ class Graph * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDijkstraShortestPath() : array { @@ -336,7 +315,6 @@ class Graph * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function depthFirstTraversal() : array { @@ -349,7 +327,6 @@ class Graph * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function breadthFirstTraversal() : array { @@ -362,7 +339,6 @@ class Graph * @return Node[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function longestPath() : array { @@ -378,7 +354,6 @@ class Graph * @return Node[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function longestPathBetweenNodes(Node $node1, Node $node2) : array { @@ -393,7 +368,6 @@ class Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getOrder() : int { @@ -408,7 +382,6 @@ class Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSize() : int { @@ -423,7 +396,6 @@ class Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDiameter() : int { diff --git a/Stdlib/Graph/Node.php b/Stdlib/Graph/Node.php index 7d097db7f..507b2caa3 100644 --- a/Stdlib/Graph/Node.php +++ b/Stdlib/Graph/Node.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Stdlib\Graph; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Stdlib/Graph/Tree.php b/Stdlib/Graph/Tree.php index 7654b3f72..7c6a439af 100644 --- a/Stdlib/Graph/Tree.php +++ b/Stdlib/Graph/Tree.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Stdlib\Graph; * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,7 +38,6 @@ class Tree extends Graph * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -59,7 +54,6 @@ class Tree extends Graph * @return Tree * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addRelativeNode(Node $base, Node $node) : Tree { @@ -77,7 +71,6 @@ class Tree extends Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMaxDepth(Node $node = null) : int { @@ -105,7 +98,6 @@ class Tree extends Graph * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMinDepth(Node $node = null) : int { @@ -136,7 +128,6 @@ class Tree extends Graph * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function levelOrder(Node $node, \Closure $callback) { @@ -156,7 +147,6 @@ class Tree extends Graph * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isLeaf(Node $node) : bool { @@ -172,7 +162,6 @@ class Tree extends Graph * @return Node[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLevelNodes(int $level, Node $node) : array { @@ -199,7 +188,6 @@ class Tree extends Graph * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isFull(int $type) : bool { @@ -225,7 +213,6 @@ class Tree extends Graph * @param \Closure $callback Task to perform on node * * @since 1.0.0 - * @author Dennis Eichhorn */ public function preOrder(Node $node, \Closure $callback) { if(count($this->nodes) === 0) { @@ -248,7 +235,6 @@ class Tree extends Graph * @param \Closure $callback Task to perform on node * * @since 1.0.0 - * @author Dennis Eichhorn */ public function postOrder(Node $node, \Closure $callback) { if(count($this->nodes) === 0) { diff --git a/Stdlib/Map/KeyType.php b/Stdlib/Map/KeyType.php index 1e51e11f9..13f304d68 100644 --- a/Stdlib/Map/KeyType.php +++ b/Stdlib/Map/KeyType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Stdlib\Map; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Account type enum. * * @category Framework * @package phpOMS\Stdlib - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Stdlib/Map/MultiMap.php b/Stdlib/Map/MultiMap.php index 14051a3be..8874296f1 100644 --- a/Stdlib/Map/MultiMap.php +++ b/Stdlib/Map/MultiMap.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Utils\Permutation; * * @category Framework * @package phpOMS\Stdlib - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -72,7 +68,6 @@ class MultiMap implements \Countable * @param int $order Order of the keys is important (only required for multiple keys) * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(int $key = KeyType::SINGLE, int $order = OrderType::LOOSE) { @@ -90,7 +85,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(array $keys, $value, bool $overwrite = true) : bool { @@ -126,7 +120,6 @@ class MultiMap implements \Countable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function garbageCollect() /* : void */ { @@ -153,7 +146,6 @@ class MultiMap implements \Countable * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get($key) { @@ -172,7 +164,6 @@ class MultiMap implements \Countable * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private function getSingle($key) { @@ -187,7 +178,6 @@ class MultiMap implements \Countable * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ private function getMultiple($key) { @@ -219,7 +209,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set($key, $value) : bool { @@ -239,7 +228,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function setMultiple($key, $value) : bool { @@ -267,7 +255,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function setSingle($key, $value) : bool { @@ -288,7 +275,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove($key) : bool { @@ -307,7 +293,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function removeMultiple($key) : bool { @@ -334,7 +319,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function removeSingle($key) : bool { @@ -362,7 +346,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remap($old, $new) : bool { @@ -391,7 +374,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeKey($key) : bool { @@ -412,7 +394,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function removeKeyMultiple($key) : bool { @@ -441,7 +422,6 @@ class MultiMap implements \Countable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function removeKeySingle($key) : bool { @@ -464,7 +444,6 @@ class MultiMap implements \Countable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSiblings($key) : array { @@ -484,7 +463,6 @@ class MultiMap implements \Countable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSiblingsMultiple($key) : array { @@ -503,7 +481,6 @@ class MultiMap implements \Countable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function getSiblingsSingle($key) : array { @@ -528,7 +505,6 @@ class MultiMap implements \Countable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function keys() : array { @@ -541,7 +517,6 @@ class MultiMap implements \Countable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function values() : array { @@ -554,7 +529,6 @@ class MultiMap implements \Countable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function count() : int { diff --git a/Stdlib/Map/OrderType.php b/Stdlib/Map/OrderType.php index 3155a6309..1dd55d46f 100644 --- a/Stdlib/Map/OrderType.php +++ b/Stdlib/Map/OrderType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Stdlib\Map; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Account type enum. * * @category Framework * @package phpOMS\Stdlib - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Stdlib/Queue/PriorityMode.php b/Stdlib/Queue/PriorityMode.php index 8f2274d01..977190f08 100644 --- a/Stdlib/Queue/PriorityMode.php +++ b/Stdlib/Queue/PriorityMode.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Stdlib\Queue; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Account type enum. * * @category Framework * @package phpOMS\Stdlib - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Stdlib/Queue/PriorityQueue.php b/Stdlib/Queue/PriorityQueue.php index 885ffbc81..c2e91e9f3 100644 --- a/Stdlib/Queue/PriorityQueue.php +++ b/Stdlib/Queue/PriorityQueue.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Stdlib\Queue; * * @category Framework * @package phpOMS\Stdlib - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -51,7 +47,6 @@ class PriorityQueue implements \Countable, \Serializable * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -66,7 +61,6 @@ class PriorityQueue implements \Countable, \Serializable * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function insert($data, float $priority = 1.0) : int { @@ -100,7 +94,6 @@ class PriorityQueue implements \Countable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function increaseAll(float $increase = 0.1) /* : void */ { @@ -115,7 +108,6 @@ class PriorityQueue implements \Countable, \Serializable * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function pop() { @@ -130,7 +122,6 @@ class PriorityQueue implements \Countable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function delete(int $id = null) /* : void */ { @@ -145,7 +136,6 @@ class PriorityQueue implements \Countable, \Serializable * Delete last element. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove() { @@ -161,7 +151,6 @@ class PriorityQueue implements \Countable, \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setPriority(int $id, float $priority) /* : void */ { @@ -176,7 +165,6 @@ class PriorityQueue implements \Countable, \Serializable * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPriority(int $id) : float { @@ -207,7 +195,6 @@ class PriorityQueue implements \Countable, \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function unserialize($data) : array { diff --git a/System/File/ContainerInterface.php b/System/File/ContainerInterface.php index c8c746e90..ae3457ae5 100644 --- a/System/File/ContainerInterface.php +++ b/System/File/ContainerInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ interface ContainerInterface * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function created(string $path) : \DateTime; @@ -52,7 +47,6 @@ interface ContainerInterface * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function changed(string $path) : \DateTime; @@ -64,7 +58,6 @@ interface ContainerInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function owner(string $path) : int; @@ -76,7 +69,6 @@ interface ContainerInterface * @return string Permissions (e.g. 0644); * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function permission(string $path) : string; @@ -90,7 +82,6 @@ interface ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function parent(string $path) : string; @@ -102,7 +93,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function create(string $path) : bool; @@ -114,7 +104,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function delete(string $path) : bool; @@ -128,7 +117,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function copy(string $from, string $to, bool $overwrite = false) : bool; @@ -142,7 +130,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function move(string $from, string $to, bool $overwrite = false) : bool; @@ -155,7 +142,6 @@ interface ContainerInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function size(string $path, bool $recursive = true) : int; @@ -167,7 +153,6 @@ interface ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function exists(string $path) : bool; @@ -179,7 +164,6 @@ interface ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function name(string $path) : string; @@ -191,7 +175,6 @@ interface ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function basename(string $path) : string; @@ -204,7 +187,6 @@ interface ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function sanitize(string $path, string $replace = '') : string; @@ -218,7 +200,6 @@ interface ContainerInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCount(bool $recursive = false) : int; @@ -230,7 +211,6 @@ interface ContainerInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSize(bool $recursive = false) : int; @@ -240,7 +220,6 @@ interface ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string; @@ -250,7 +229,6 @@ interface ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPath() : string; @@ -262,7 +240,6 @@ interface ContainerInterface * @return ContainerInterface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getParent() : ContainerInterface; @@ -272,7 +249,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function createNode() : bool; @@ -285,7 +261,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function copyNode(string $to, bool $overwrite = false) : bool; @@ -298,7 +273,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function moveNode(string $to, bool $overwrite = false) : bool; @@ -308,7 +282,6 @@ interface ContainerInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function deleteNode() : bool; @@ -318,7 +291,6 @@ interface ContainerInterface * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCreatedAt() : \DateTime; @@ -328,7 +300,6 @@ interface ContainerInterface * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getChangedAt() : \DateTime; @@ -338,7 +309,6 @@ interface ContainerInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getOwner() : int; @@ -348,7 +318,6 @@ interface ContainerInterface * @return string Permissions (e.g. 0644); * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPermission() : string; @@ -359,7 +328,6 @@ interface ContainerInterface * Sub-sub-resources are only initialized once they are needed. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function index(); } diff --git a/System/File/ContentPutMode.php b/System/File/ContentPutMode.php index f3241131e..1293af244 100644 --- a/System/File/ContentPutMode.php +++ b/System/File/ContentPutMode.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\System\File; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\System - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/File/DirectoryInterface.php b/System/File/DirectoryInterface.php index ebecee064..bf6b52978 100644 --- a/System/File/DirectoryInterface.php +++ b/System/File/DirectoryInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ interface DirectoryInterface extends ContainerInterface, \Iterator, \ArrayAccess * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function count(string $path, bool $recursive = true, array $ignore = []) : int; @@ -56,7 +51,6 @@ interface DirectoryInterface extends ContainerInterface, \Iterator, \ArrayAccess * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNode(string $name); @@ -68,7 +62,6 @@ interface DirectoryInterface extends ContainerInterface, \Iterator, \ArrayAccess * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addNode($file) : bool; } diff --git a/System/File/ExtensionType.php b/System/File/ExtensionType.php index 8efd6a066..0eeb6ce57 100644 --- a/System/File/ExtensionType.php +++ b/System/File/ExtensionType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\System\File; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\System - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/File/FileInterface.php b/System/File/FileInterface.php index c234395ac..3788fa189 100644 --- a/System/File/FileInterface.php +++ b/System/File/FileInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function put(string $path, string $content, int $mode = ContentPutMode::APPEND | ContentPutMode::CREATE) : bool; @@ -58,7 +53,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function set(string $path, string $content) : bool; @@ -73,7 +67,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function append(string $path, string $content) : bool; @@ -88,7 +81,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function prepend(string $path, string $content) : bool; @@ -100,7 +92,6 @@ interface FileInterface extends ContainerInterface * @return string Content of file * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function get(string $path) : string; @@ -112,7 +103,6 @@ interface FileInterface extends ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function extension(string $path) : string; @@ -125,7 +115,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function putContent(string $content, int $mode = ContentPutMode::APPEND | ContentPutMode::CREATE) : bool; @@ -139,7 +128,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setContent(string $content) : bool; @@ -153,7 +141,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function appendContent(string $content) : bool; @@ -167,7 +154,6 @@ interface FileInterface extends ContainerInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function prependContent(string $content) : bool; @@ -177,7 +163,6 @@ interface FileInterface extends ContainerInterface * @return string Content of file * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getContent() : string; @@ -187,7 +172,6 @@ interface FileInterface extends ContainerInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getExtension() : string; } diff --git a/System/File/FileUtils.php b/System/File/FileUtils.php index 48091f70c..089c7e3c5 100644 --- a/System/File/FileUtils.php +++ b/System/File/FileUtils.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index aa0d550d1..62c66da32 100644 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -31,8 +29,6 @@ use phpOMS\System\File\Local\Directory as DirectoryLocal; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php index fd4dd9132..3ec647e02 100644 --- a/System/File/Ftp/File.php +++ b/System/File/Ftp/File.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -32,8 +30,6 @@ use phpOMS\System\File\Local\Directory as DirectoryLocal; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -232,7 +228,6 @@ class File extends FileAbstract implements FileInterface * @return string Returns the directory name of the file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function dirname(string $path) : string { @@ -247,7 +242,6 @@ class File extends FileAbstract implements FileInterface * @return string Returns the directory name of the file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function dirpath(string $path) : string { @@ -340,7 +334,6 @@ class File extends FileAbstract implements FileInterface * @return ContainerInterface * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getParent() : ContainerInterface { @@ -353,7 +346,6 @@ class File extends FileAbstract implements FileInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function createNode() : bool { @@ -369,7 +361,6 @@ class File extends FileAbstract implements FileInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function copyNode(string $to, bool $overwrite = false) : bool { @@ -385,7 +376,6 @@ class File extends FileAbstract implements FileInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function moveNode(string $to, bool $overwrite = false) : bool { @@ -398,7 +388,6 @@ class File extends FileAbstract implements FileInterface * @return bool True on success and false on failure * * @since 1.0.0 - * @author Dennis Eichhorn */ public function deleteNode() : bool { @@ -414,7 +403,6 @@ class File extends FileAbstract implements FileInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function putContent(string $content, int $mode = ContentPutMode::APPEND | ContentPutMode::CREATE) : bool { @@ -431,7 +419,6 @@ class File extends FileAbstract implements FileInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setContent(string $content) : bool { @@ -448,7 +435,6 @@ class File extends FileAbstract implements FileInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function appendContent(string $content) : bool { @@ -465,7 +451,6 @@ class File extends FileAbstract implements FileInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function prependContent(string $content) : bool { @@ -478,7 +463,6 @@ class File extends FileAbstract implements FileInterface * @return string Content of file * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getContent() : string { @@ -491,7 +475,6 @@ class File extends FileAbstract implements FileInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getExtension() : string { diff --git a/System/File/Ftp/FtpStorage.php b/System/File/Ftp/FtpStorage.php index 6656db956..a681391fd 100644 --- a/System/File/Ftp/FtpStorage.php +++ b/System/File/Ftp/FtpStorage.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\System\File\StorageAbstract; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index 1938f1bb6..dd5ee4d7d 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -29,8 +27,6 @@ use phpOMS\Utils\StringUtils; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -60,7 +56,6 @@ class Directory extends FileAbstract implements DirectoryInterface * @param string $filter Filter * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $path, string $filter = '*') { @@ -81,7 +76,6 @@ class Directory extends FileAbstract implements DirectoryInterface * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function list(string $path, string $filter = '*') : array { diff --git a/System/File/Local/File.php b/System/File/Local/File.php index 7271bd188..2da086631 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -29,8 +27,6 @@ use phpOMS\System\File\PathException; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ class File extends FileAbstract implements FileInterface * @param string $path Path * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $path) { @@ -226,7 +221,6 @@ class File extends FileAbstract implements FileInterface * @return string Returns the directory name of the file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function dirname(string $path) : string { @@ -241,7 +235,6 @@ class File extends FileAbstract implements FileInterface * @return string Returns the directory name of the file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function dirpath(string $path) : string { @@ -312,7 +305,6 @@ class File extends FileAbstract implements FileInterface * @return string Returns the directory name of the file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDirName() : string { @@ -325,7 +317,6 @@ class File extends FileAbstract implements FileInterface * @return string Returns the directory path of the file. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDirPath() : string { diff --git a/System/File/Local/FileAbstract.php b/System/File/Local/FileAbstract.php index 57274f2ac..46a81b8ab 100644 --- a/System/File/Local/FileAbstract.php +++ b/System/File/Local/FileAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\System\File\ContainerInterface; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -103,7 +99,6 @@ abstract class FileAbstract implements ContainerInterface * @param string $path Path * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $path) { diff --git a/System/File/Local/LocalStorage.php b/System/File/Local/LocalStorage.php index 52cf714cb..3cce69807 100644 --- a/System/File/Local/LocalStorage.php +++ b/System/File/Local/LocalStorage.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\System\File\StorageAbstract; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/File/PathException.php b/System/File/PathException.php index db9745f60..5962a5a60 100644 --- a/System/File/PathException.php +++ b/System/File/PathException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class PathException extends \UnexpectedValueException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { diff --git a/System/File/PermissionException.php b/System/File/PermissionException.php index 599b9bebd..b42c4f98e 100644 --- a/System/File/PermissionException.php +++ b/System/File/PermissionException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class PermissionException extends \RuntimeException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { diff --git a/System/File/Storage.php b/System/File/Storage.php index 33a434045..6807dbd39 100644 --- a/System/File/Storage.php +++ b/System/File/Storage.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ final class Storage * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -61,16 +56,13 @@ final class Storage * @throws \Exception Throws exception in case of invalid storage * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function env(string $env = 'local') : StorageAbstract { if (isset(self::$registered[$env])) { if(is_string(self::$registered[$env])) { $env = self::$registered[$env]::getInstance(); - } elseif(self::$registered[$env] instanceof StorageAbstract) { - $env = self::$registered[$env]; - } elseif(self::$registered[$env] instanceof ContainerInterface) { + } elseif(self::$registered[$env] instanceof StorageAbstract || self::$registered[$env] instanceof ContainerInterface) { $env = self::$registered[$env]; } else { throw new \Exception('Invalid type'); @@ -79,9 +71,14 @@ final class Storage $stg = $env; $env = ucfirst(strtolower($env)); $env = __NAMESPACE__ . '\\' . $env . '\\' . $env . 'Storage'; - $env = $env::getInstance(); - self::$registered[$stg] = $env; + try { + $env = $env::getInstance(); + + self::$registered[$stg] = $env; + } catch(\Throwable $e) { + throw new \Exception(); + } } return $env; @@ -96,7 +93,6 @@ final class Storage * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function register(string $name, $class) : bool { diff --git a/System/File/StorageAbstract.php b/System/File/StorageAbstract.php index cfa447d7e..fc6793f66 100644 --- a/System/File/StorageAbstract.php +++ b/System/File/StorageAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\System\File; * * @category Framework * @package phpOMS\System\File - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -52,7 +48,6 @@ abstract class StorageAbstract implements DirectoryInterface, FileInterface * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -64,7 +59,6 @@ abstract class StorageAbstract implements DirectoryInterface, FileInterface * @return mixed Storage instance. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getInstance() : StorageAbstract { @@ -81,7 +75,6 @@ abstract class StorageAbstract implements DirectoryInterface, FileInterface * @return int Storage type. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getType() : int { diff --git a/System/MimeType.php b/System/MimeType.php index bcbfa6ce7..1d52aad06 100644 --- a/System/MimeType.php +++ b/System/MimeType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\System; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\System - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/OperatingSystem.php b/System/OperatingSystem.php index 7eb5a80e5..97ee9766b 100644 --- a/System/OperatingSystem.php +++ b/System/OperatingSystem.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\System; * * @category Framework * @package phpOMS\System - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -36,7 +32,6 @@ final class OperatingSystem * @return int|SystemType * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getSystem() : int { diff --git a/System/SystemType.php b/System/SystemType.php index 4cd863a59..a24a98490 100644 --- a/System/SystemType.php +++ b/System/SystemType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\System; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\System - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/System/SystemUtils.php b/System/SystemUtils.php index 07a51fbac..a900baef4 100644 --- a/System/SystemUtils.php +++ b/System/SystemUtils.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\System; * * @category Framework * @package phpOMS\System - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,7 +31,6 @@ class SystemUtils * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -47,7 +42,6 @@ class SystemUtils * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRAM() : int { @@ -79,7 +73,6 @@ class SystemUtils * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getRAMUsage() : int { @@ -106,7 +99,6 @@ class SystemUtils * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCpuUsage() : int { diff --git a/UnhandledHandler.php b/UnhandledHandler.php index c698d221a..414152c13 100644 --- a/UnhandledHandler.php +++ b/UnhandledHandler.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -37,9 +35,8 @@ final class UnhandledHandler * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function exceptionHandler($e) /* : void */ + public static function exceptionHandler(\Throwable $e) /* : void */ { $logger = FileLogger::getInstance(__DIR__ . '/../Logs'); $logger->critical(FileLogger::MSG_FULL, [ @@ -47,11 +44,6 @@ final class UnhandledHandler 'line' => $e->getLine(), 'file' => $e->getFile(), ]); - - echo 'My Exception [' . $e->getCode() . '] ' . $e->getMessage() . '
' - . ' Exception on line ' . $e->getLine() . ' in file ' . $e->getFile() - . ', PHP ' . PHP_VERSION . ' (' . PHP_OS . ')
' - . 'aborting...
'; } /** @@ -65,7 +57,6 @@ final class UnhandledHandler * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function errorHandler(int $errno, string $errstr, string $errfile, int $errline) : bool { @@ -81,25 +72,6 @@ final class UnhandledHandler 'file' => $errfile, ]); - switch ($errno) { - case E_USER_ERROR: - echo 'My ERROR [' . $errno . '] ' . $errstr . '
'; - break; - case E_USER_WARNING: - echo 'My WARNING [' . $errno . '] ' . $errstr . '
'; - break; - case E_USER_NOTICE: - echo 'My NOTICE [' . $errno . '] ' . $errstr . '
'; - break; - default: - echo 'Unknown error type: [' . $errno . '] ' . $errstr . '
'; - break; - } - - echo 'My Error Fatal error on line ' . $errline . ' in file ' . $errfile - . ', PHP ' . PHP_VERSION . ' (' . PHP_OS . '
' - . 'aborting...
'; - error_clear_last(); return true; @@ -107,9 +79,10 @@ final class UnhandledHandler /** * Shutdown handler. + * + * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function shutdownHandler() /* : void */ { @@ -122,11 +95,6 @@ final class UnhandledHandler 'line' => $e['line'], 'file' => $e['file'], ]); - - echo 'My Error unhandled [' . $e['type'] . '] ' . $e['message'] . '
' - . ' Fatal error on line ' . $e['line'] . ' in file ' . $e['file'] - . ', PHP ' . PHP_VERSION . ' (' . PHP_OS . ')
' - . 'aborting...
'; } } } diff --git a/Uri/Http.php b/Uri/Http.php index 5d8de7bbf..b05155738 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -26,8 +24,6 @@ use phpOMS\Utils\StringUtils; * * @category Framework * @package phpOMS/Uri - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -137,7 +133,6 @@ class Http implements UriInterface * @param string $uri Root path for subdirectory * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $uri) { @@ -170,6 +165,8 @@ class Http implements UriInterface parse_str($this->queryString, $this->query); } + $this->query = array_change_key_case($this->query, CASE_LOWER); + $this->fragment = $url['fragment'] ?? ''; $this->base = $this->scheme . '://' . $this->host . $this->rootPath; } @@ -180,7 +177,6 @@ class Http implements UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getCurrent() : string { @@ -202,7 +198,6 @@ class Http implements UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRootPath() : string { @@ -248,7 +243,6 @@ class Http implements UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPass() : string { @@ -263,13 +257,12 @@ class Http implements UriInterface return $this->path; } - public function getPathOffset() : int - { - return substr_count($this->rootPath, '/') - 1; - } - /** - * {@inheritdoc} + * Get path offset. + * + * @return int + * + * @since 1.0.0 */ public function getPathOffset() : int { @@ -288,17 +281,36 @@ class Http implements UriInterface /** * {@inheritdoc} */ - public function getPathElement(int $pos) : string + public function getPathElement(int $pos = null) : string { return explode('/', $this->path)[$pos]; } + public function getPathElements() : array + { + return explode('/', $this->path); + } + /** * {@inheritdoc} */ public function getQuery(string $key = null) /* : ?string */ { - return isset($key) ? $this->query[$key] ?? null : $this->queryString; + if(isset($key)) { + $key = strtolower($key); + + return $this->query[$key] ?? ''; + } + + return $this->queryString; + } + + /** + * {@inheritdoc} + */ + public function getQueryArray() : array + { + return $this->query; } /** @@ -339,7 +351,6 @@ class Http implements UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getUser() : string { diff --git a/Uri/InvalidUriException.php b/Uri/InvalidUriException.php index 3b12131b8..9da6c3316 100644 --- a/Uri/InvalidUriException.php +++ b/Uri/InvalidUriException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Uri; * * @category Framework * @package phpOMS/Uri - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class InvalidUriException extends \UnexpectedValueException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $message, int $code = 0, \Exception $previous = null) { diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index 49e46a677..d75f968dd 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Uri; * * @category Framework * @package phpOMS/Uri - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -45,7 +41,6 @@ class UriFactory * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -59,7 +54,6 @@ class UriFactory * @return null|string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getQuery(string $key) /* : ?string */ { @@ -76,7 +70,6 @@ class UriFactory * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function setQuery(string $key, string $value, bool $overwrite = true) : bool { @@ -95,7 +88,6 @@ class UriFactory * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function clearAll() : bool { @@ -112,7 +104,6 @@ class UriFactory * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function setupUriBuilder(UriInterface $uri) /* : void */ { @@ -126,6 +117,11 @@ class UriFactory self::setQuery('/', $uri->getPath()); self::setQuery(':user', $uri->getUser()); self::setQuery(':pass', $uri->getPass()); + + $data = $uri->getQueryArray(); + foreach($data as $key => $value) { + self::setQuery('?' . $key, $value); + } } /** @@ -136,7 +132,6 @@ class UriFactory * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function clear(string $key) : bool { @@ -157,7 +152,6 @@ class UriFactory * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function clearLike(string $pattern) : bool { @@ -183,7 +177,6 @@ class UriFactory * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function unique(string $url) : string { @@ -209,7 +202,7 @@ class UriFactory $pars[] = $key . '=' . $value; } - return $parts[0] . (empty($pars) ? '' : '?' . implode('&', $pars)); + $url = $parts[0] . (empty($pars) ? '' : '?' . implode('&', $pars)); } return $url; @@ -233,11 +226,10 @@ class UriFactory * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function build(string $uri, array $toMatch = []) /* : ?string */ { - $parsed = preg_replace_callback('(\{[\/#\?@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) { + $parsed = preg_replace_callback('(\{[\/#\?%@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) { $match = substr($match[0], 1, strlen($match[0]) - 2); return $toMatch[$match] ?? self::$uri[$match] ?? $match; diff --git a/Uri/UriInterface.php b/Uri/UriInterface.php index 2a6b6d960..a1e980979 100644 --- a/Uri/UriInterface.php +++ b/Uri/UriInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Uri; * * @category Framework * @package phpOMS/Uri - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ interface UriInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isValid(string $uri) : bool; @@ -49,7 +44,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getScheme() : string; @@ -59,7 +53,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAuthority() : string; @@ -69,7 +62,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getUserInfo() : string; @@ -79,7 +71,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHost() : string; @@ -89,7 +80,6 @@ interface UriInterface * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPort() : int; @@ -99,7 +89,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPath() : string; @@ -111,7 +100,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getPathElement(int $pos) : string; @@ -123,7 +111,6 @@ interface UriInterface * @return string|array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getQuery(string $key = null); @@ -133,7 +120,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFragment() : string; @@ -143,7 +129,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __toString(); @@ -153,7 +138,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBase() : string; @@ -163,7 +147,6 @@ interface UriInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRoute() : string; @@ -175,7 +158,6 @@ interface UriInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(string $uri); } diff --git a/Uri/UriScheme.php b/Uri/UriScheme.php index e9d19850a..f616af2be 100644 --- a/Uri/UriScheme.php +++ b/Uri/UriScheme.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Uri; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Uri scheme. * * @category Framework * @package phpOMS/Uri - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index 6ed1c3412..f5907c521 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,7 +31,6 @@ class ArrayUtils * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -51,9 +46,8 @@ class ArrayUtils * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function unsetArray(string $path, array $data, string $delim) : array + public static function unsetArray(string $path, array $data, string $delim = '/') : array { $nodes = explode($delim, trim($path, $delim)); $prevEl = null; @@ -90,9 +84,8 @@ class ArrayUtils * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function setArray(string $path, array $data, $value, string $delim, bool $overwrite = false) : array + public static function setArray(string $path, array $data, $value, string $delim = '/', bool $overwrite = false) : array { $pathParts = explode($delim, trim($path, $delim)); $current = &$data; @@ -127,7 +120,6 @@ class ArrayUtils * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function inArrayRecursive($needle, array $haystack) : bool { @@ -148,6 +140,16 @@ class ArrayUtils return $found; } + /** + * Check if any of the needles are in the array + * + * @param mixed $needles Needles for search + * @param array $haystack Haystack for search + * + * @return bool + * + * @since 1.0.0 + */ public static function anyInArray(array $needles, array $haystack) : bool { foreach($needles as $needle) { @@ -159,6 +161,27 @@ class ArrayUtils return false; } + /** + * Check if all of the needles are in the array + * + * @param mixed $needles Needles for search + * @param array $haystack Haystack for search + * + * @return bool + * + * @since 1.0.0 + */ + public static function allInArray(array $needles, array $haystack) : bool + { + foreach($needles as $needle) { + if(!in_array($needle, $haystack)) { + return false; + } + } + + return true; + } + /** * Stringify array. * @@ -169,7 +192,6 @@ class ArrayUtils * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function stringify(array $array) : string { @@ -221,7 +243,6 @@ class ArrayUtils * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function arrayToCSV(array $data, string $delimiter = ';', string $enclosure = '"', string $escape = '\\') : string { @@ -246,7 +267,6 @@ class ArrayUtils * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getArg(string $id, array $args) /* : ?string */ { @@ -267,7 +287,6 @@ class ArrayUtils * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function arrayFlatten(array $array) : array { @@ -275,7 +294,7 @@ class ArrayUtils // see collection collapse as alternative?! $flat = []; $stack = array_values($array); - while ($stack) { + while (!empty($stack)) { $value = array_shift($stack); if (is_array($value)) { @@ -298,11 +317,10 @@ class ArrayUtils * @return int|float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function arraySum(array $array, int $start = 0, int $count = 0) { - $count = $count === 0 ? count($array) : $count; + $count = $count === 0 ? count($array) : $start + $count; $sum = 0; $array = array_values($array); @@ -322,7 +340,6 @@ class ArrayUtils * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function arraySumRecursive(array $array) { diff --git a/Utils/Barcode/Aztec.php b/Utils/Barcode/Aztec.php index c8b578772..c54bbc73b 100644 --- a/Utils/Barcode/Aztec.php +++ b/Utils/Barcode/Aztec.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Barcode/C128Abstract.php b/Utils/Barcode/C128Abstract.php index 0da7e9b3a..135f055f1 100644 --- a/Utils/Barcode/C128Abstract.php +++ b/Utils/Barcode/C128Abstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Barcode; -use phpOMS\Datatypes\Exception\InvalidEnumValue; +use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; /** * Code 128 abstract class. * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -133,7 +129,6 @@ abstract class C128Abstract * @todo : add mirror parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $content = '', int $width = 20, int $height = 20, int $orientation = OrientationType::HORIZONTAL) { @@ -149,7 +144,6 @@ abstract class C128Abstract * @param int $height Barcode height * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDimension(int $width, int $height) /* : void */ { @@ -171,7 +165,6 @@ abstract class C128Abstract * @param int $orientation Barcode orientation * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setOrientation(int $orientation) /* : void */ { @@ -188,7 +181,6 @@ abstract class C128Abstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getContent() : string { @@ -201,7 +193,6 @@ abstract class C128Abstract * @param string $content Barcode content * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setContent(string $content) /* : void */ { @@ -214,7 +205,6 @@ abstract class C128Abstract * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get() { @@ -229,7 +219,6 @@ abstract class C128Abstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function generateCodeString() : string { @@ -260,7 +249,6 @@ abstract class C128Abstract * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function createImage(string $codeString, int $codeLength = 20) { diff --git a/Utils/Barcode/C128a.php b/Utils/Barcode/C128a.php index 877a4b9a6..b3d953750 100644 --- a/Utils/Barcode/C128a.php +++ b/Utils/Barcode/C128a.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -93,7 +89,6 @@ class C128a extends C128Abstract * @todo : add mirror parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $content = '', int $size = 20, int $orientation = OrientationType::HORIZONTAL) { @@ -108,7 +103,6 @@ class C128a extends C128Abstract * @todo : add mirror parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setContent(string $content) /* : void */ { diff --git a/Utils/Barcode/C128b.php b/Utils/Barcode/C128b.php index 4aa9ff616..7b2464130 100644 --- a/Utils/Barcode/C128b.php +++ b/Utils/Barcode/C128b.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Barcode/C128c.php b/Utils/Barcode/C128c.php index b66500bec..243b734b6 100644 --- a/Utils/Barcode/C128c.php +++ b/Utils/Barcode/C128c.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -88,7 +84,6 @@ class C128c extends C128Abstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function generateCodeString() : string { diff --git a/Utils/Barcode/C25.php b/Utils/Barcode/C25.php index 9cb3fac68..642e70253 100644 --- a/Utils/Barcode/C25.php +++ b/Utils/Barcode/C25.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -75,7 +71,6 @@ class C25 extends C128Abstract * @todo : add mirror parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $content = '', int $size = 20, int $orientation = OrientationType::HORIZONTAL) { @@ -92,7 +87,6 @@ class C25 extends C128Abstract * @param string $content Barcode content * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setContent(string $content) /* : void */ { @@ -109,7 +103,6 @@ class C25 extends C128Abstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function generateCodeString() : string { diff --git a/Utils/Barcode/C39.php b/Utils/Barcode/C39.php index 0629cde18..c09e3c7ba 100644 --- a/Utils/Barcode/C39.php +++ b/Utils/Barcode/C39.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -74,7 +70,6 @@ class C39 extends C128Abstract * @todo : add mirror parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $content = '', int $size = 20, int $orientation = OrientationType::HORIZONTAL) { @@ -87,7 +82,6 @@ class C39 extends C128Abstract * @param string $content Barcode content * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setContent(string $content) /* : void */ { @@ -100,7 +94,6 @@ class C39 extends C128Abstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function generateCodeString() : string { diff --git a/Utils/Barcode/Codebar.php b/Utils/Barcode/Codebar.php index 2a4a37bb5..841d0f264 100644 --- a/Utils/Barcode/Codebar.php +++ b/Utils/Barcode/Codebar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -75,7 +71,6 @@ class Codebar extends C128Abstract * @todo : add mirror parameter * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $content = '', int $size = 20, int $orientation = OrientationType::HORIZONTAL) { @@ -88,7 +83,6 @@ class Codebar extends C128Abstract * @param string $content Barcode content * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setContent(string $content) /* : void */ { @@ -101,7 +95,6 @@ class Codebar extends C128Abstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function generateCodeString() : string { diff --git a/Utils/Barcode/Datamatrix.php b/Utils/Barcode/Datamatrix.php index 78984bd58..0cd822e88 100644 --- a/Utils/Barcode/Datamatrix.php +++ b/Utils/Barcode/Datamatrix.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Barcode/HIBCC.php b/Utils/Barcode/HIBCC.php index 1dd19af24..3c20394e3 100644 --- a/Utils/Barcode/HIBCC.php +++ b/Utils/Barcode/HIBCC.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Barcode/OrientationType.php b/Utils/Barcode/OrientationType.php index 9c3ae56f4..38bc5ebb1 100644 --- a/Utils/Barcode/OrientationType.php +++ b/Utils/Barcode/OrientationType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Barcode; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Account type enum. * * @category Framework * @package phpOMS\DataStorage\Database - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Barcode/QR.php b/Utils/Barcode/QR.php index 537277a10..d93397a09 100644 --- a/Utils/Barcode/QR.php +++ b/Utils/Barcode/QR.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Barcode; * * @category Log * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/ColorUtils.php b/Utils/ColorUtils.php index a6f3ce7e7..51f9a797c 100644 --- a/Utils/ColorUtils.php +++ b/Utils/ColorUtils.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,9 +38,8 @@ class ColorUtils * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function getRGBGradient(int $value, array $start, array $stop, array $end) + public static function getRGBGradient(int $value, array $start, array $stop, array $end) : array { $diff = []; $gradient = []; @@ -92,7 +87,6 @@ class ColorUtils * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function intToRgb(int $rgbInt) : array { diff --git a/Utils/Compression/CompressionInterface.php b/Utils/Compression/CompressionInterface.php index b2acceefb..9368cd280 100644 --- a/Utils/Compression/CompressionInterface.php +++ b/Utils/Compression/CompressionInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Compression; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ interface CompressionInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function compress(string $source) : string; @@ -50,7 +45,6 @@ interface CompressionInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function decompress(string $compressed) : string; } \ No newline at end of file diff --git a/Utils/Compression/LZW.php b/Utils/Compression/LZW.php index 0e296beb0..d50504208 100644 --- a/Utils/Compression/LZW.php +++ b/Utils/Compression/LZW.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Compression; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/AngleType.php b/Utils/Converter/AngleType.php index a7436f2d4..bae297be5 100644 --- a/Utils/Converter/AngleType.php +++ b/Utils/Converter/AngleType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Speed type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/AreaType.php b/Utils/Converter/AreaType.php index f36286998..d499dbb92 100644 --- a/Utils/Converter/AreaType.php +++ b/Utils/Converter/AreaType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Area type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index dd9b350ad..1c319bb2d 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -29,8 +27,6 @@ use phpOMS\Uri\Http; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -50,7 +46,6 @@ class Currency * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -62,7 +57,6 @@ class Currency * Can be used in order to refresh them. Be careful currency rates only get updated once a day from the ECB website. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function resetCurrencies() /* : void */ { @@ -78,7 +72,6 @@ class Currency * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function fromEurTo(float $value, string $to) : float { @@ -100,7 +93,6 @@ class Currency * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getEcbEuroRates() : array { @@ -135,7 +127,6 @@ class Currency * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function fromToEur(float $value, string $from) : float { @@ -159,7 +150,6 @@ class Currency * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertCurrency(float $value, string $from, string $to) : float { diff --git a/Utils/Converter/EnergyPowerType.php b/Utils/Converter/EnergyPowerType.php index db21c3c8c..caaa22def 100644 --- a/Utils/Converter/EnergyPowerType.php +++ b/Utils/Converter/EnergyPowerType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Speed type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/File.php b/Utils/Converter/File.php index bb757d635..427db21d6 100644 --- a/Utils/Converter/File.php +++ b/Utils/Converter/File.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Converter; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,7 +31,6 @@ class File * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -49,7 +44,6 @@ class File * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function byteSizeToString(int $bytes) : string { @@ -72,7 +66,6 @@ class File * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function kilobyteSizeToString(int $kilobytes) : string { diff --git a/Utils/Converter/FileSizeType.php b/Utils/Converter/FileSizeType.php index 5fa2ee08d..36c68c59e 100644 --- a/Utils/Converter/FileSizeType.php +++ b/Utils/Converter/FileSizeType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * File size type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/Ip.php b/Utils/Converter/Ip.php index 50ec71b73..7c66b7ce9 100644 --- a/Utils/Converter/Ip.php +++ b/Utils/Converter/Ip.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Converter; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/LengthType.php b/Utils/Converter/LengthType.php index a58b23b22..bfda7cd3c 100644 --- a/Utils/Converter/LengthType.php +++ b/Utils/Converter/LengthType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Length type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/Measurement.php b/Utils/Converter/Measurement.php index 93ee74a2a..f9f2e3555 100644 --- a/Utils/Converter/Measurement.php +++ b/Utils/Converter/Measurement.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Converter; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertTemperature(float $value, string $from = TemperatureType::FAHRENHEIT, string $to = TemperatureType::CELSIUS) : float { @@ -115,7 +110,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertWeight(float $value, string $from = WeightType::GRAM, string $to = WeightType::KILOGRAM) : float { @@ -225,7 +219,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertLength(float $value, string $from = LengthType::METERS, string $to = LengthType::KILOMETERS) : float { @@ -377,7 +370,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertArea(float $value, string $from = AreaType::SQUARE_METERS, string $to = AreaType::SQUARE_KILOMETERS) : float { @@ -481,7 +473,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertVolume(float $value, string $from = VolumeType::LITER, string $to = VolumeType::LITER) : float { @@ -735,7 +726,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertSpeed(float $value, string $from = SpeedType::KILOMETERS_PER_HOUR, string $to = SpeedType::KILOMETERS_PER_HOUR) : float { @@ -965,7 +955,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertTime(float $value, string $from = TimeType::SECONDS, string $to = TimeType::HOURS) : float { @@ -1045,7 +1034,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertAngle(float $value, string $from = AngleType::DEGREE, string $to = AngleType::DEGREE) : float { @@ -1131,7 +1119,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertPressure(float $value, string $from = PressureType::PASCALS, string $to = PressureType::BAR) : float { @@ -1233,7 +1220,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertEnergie(float $value, string $from = EnergyPowerType::JOULS, string $to = EnergyPowerType::KILOWATT_HOUERS) : float { @@ -1310,7 +1296,6 @@ class Measurement * @return float * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertFileSize(float $value, string $from = FileSizeType::BYTE, string $to = FileSizeType::MEGABYTE) : float { diff --git a/Utils/Converter/Numeric.php b/Utils/Converter/Numeric.php index c61b5d006..e978da495 100644 --- a/Utils/Converter/Numeric.php +++ b/Utils/Converter/Numeric.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Converter; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -43,7 +39,6 @@ class Numeric * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -59,7 +54,6 @@ class Numeric * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function convertBase(string $numberInput, string $fromBaseInput, string $toBaseInput) : string { @@ -109,7 +103,6 @@ class Numeric * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function arabicToRoman(int $arabic) : string { @@ -136,7 +129,6 @@ class Numeric * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function romanToArabic(string $roman) : int { @@ -162,7 +154,6 @@ class Numeric * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function numericToAlpha(int $number) : string { @@ -184,7 +175,6 @@ class Numeric * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function alphaToNumeric(string $alpha) : int { diff --git a/Utils/Converter/PressureType.php b/Utils/Converter/PressureType.php index fb19f8835..9a8e454a7 100644 --- a/Utils/Converter/PressureType.php +++ b/Utils/Converter/PressureType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Speed type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/SpeedType.php b/Utils/Converter/SpeedType.php index d2cc42457..4f7affa01 100644 --- a/Utils/Converter/SpeedType.php +++ b/Utils/Converter/SpeedType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Speed type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/TemperatureType.php b/Utils/Converter/TemperatureType.php index 3d54b765e..a79f8d6e7 100644 --- a/Utils/Converter/TemperatureType.php +++ b/Utils/Converter/TemperatureType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Temperature type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/TimeType.php b/Utils/Converter/TimeType.php index 0d0d1dba1..781b01711 100644 --- a/Utils/Converter/TimeType.php +++ b/Utils/Converter/TimeType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Time type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/VolumeType.php b/Utils/Converter/VolumeType.php index 7d5513c98..76710d790 100644 --- a/Utils/Converter/VolumeType.php +++ b/Utils/Converter/VolumeType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Volume type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Converter/WeightType.php b/Utils/Converter/WeightType.php index 927f0a109..b0c3ad8f2 100644 --- a/Utils/Converter/WeightType.php +++ b/Utils/Converter/WeightType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\Converter; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Weight type enum. * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/EDIAbstract.php b/Utils/EDI/AnsiX12/EDIAbstract.php index 2aecc8305..b87c14f6d 100644 --- a/Utils/EDI/AnsiX12/EDIAbstract.php +++ b/Utils/EDI/AnsiX12/EDIAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/FunctionalGroupHeader.php b/Utils/EDI/AnsiX12/FunctionalGroupHeader.php index 8e7d2ee3c..283d6405a 100644 --- a/Utils/EDI/AnsiX12/FunctionalGroupHeader.php +++ b/Utils/EDI/AnsiX12/FunctionalGroupHeader.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\EDI\AnsiX12; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/Header.php b/Utils/EDI/AnsiX12/Header.php index 9337825f2..5bb602420 100644 --- a/Utils/EDI/AnsiX12/Header.php +++ b/Utils/EDI/AnsiX12/Header.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\EDI\AnsiX12; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/InterchangeControlHeader.php b/Utils/EDI/AnsiX12/InterchangeControlHeader.php index 3bc81dd69..a06f6c69e 100644 --- a/Utils/EDI/AnsiX12/InterchangeControlHeader.php +++ b/Utils/EDI/AnsiX12/InterchangeControlHeader.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,15 +21,13 @@ namespace phpOMS\Utils\EDI\AnsiX12; * @link https://www.erico.com/public/library/edi/ERICO850_4010.pdf * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ class InterchangeControlHeader { - const COMPONENT_ELEMENT_SEPARATOR = '>'; + /* private */ const COMPONENT_ELEMENT_SEPARATOR = '>'; private $interchangeControlHeader = InterchangeControlHeader::ISA; diff --git a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850.php b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850.php index 88a13d1a5..475e15b0d 100644 --- a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850.php +++ b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Utils\EDI\AnsiX12\EDIAbstract; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Detail.php b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Detail.php index 4280cb007..48c52b9e1 100644 --- a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Detail.php +++ b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Detail.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Heading.php b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Heading.php index 07a78a5e0..6c5b39080 100644 --- a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Heading.php +++ b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Heading.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\EDI\AnsiX12\Purchase; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Summary.php b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Summary.php index 30d397da6..2816de3c7 100644 --- a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Summary.php +++ b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/EDI850Summary.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/TransactionSetHeader.php b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/TransactionSetHeader.php index 3f166448b..7c0bef37c 100644 --- a/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/TransactionSetHeader.php +++ b/Utils/EDI/AnsiX12/Purchase/PurchaseOrder/TransactionSetHeader.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,15 +20,13 @@ namespace phpOMS\Utils\EDI\AnsiX12\Purchase\PurchaseOrder; * * @category Framework * @package phpOMS\Utils\Converter - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ class TransactionSetHeader { - const IDENTIFIER = 'ST'; + /* private */ const IDENTIFIER = 'ST'; private $transactionSetIdentifierCode = 850; diff --git a/Utils/Encoding/Caesar.php b/Utils/Encoding/Caesar.php index 9576a6e6e..07457d4e1 100644 --- a/Utils/Encoding/Caesar.php +++ b/Utils/Encoding/Caesar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Encoding; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Encoding/EncodingInterface.php b/Utils/Encoding/EncodingInterface.php index 1471f0c9b..50eca9533 100644 --- a/Utils/Encoding/EncodingInterface.php +++ b/Utils/Encoding/EncodingInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Encoding; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ interface EncodingInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function encode($source); @@ -50,7 +45,6 @@ interface EncodingInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function decode($decoded); } \ No newline at end of file diff --git a/Utils/Encoding/Gray.php b/Utils/Encoding/Gray.php index 121c59090..449f010f5 100644 --- a/Utils/Encoding/Gray.php +++ b/Utils/Encoding/Gray.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Encoding; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Encoding/Huffman/Dictionary.php b/Utils/Encoding/Huffman/Dictionary.php index 054a1dfad..ece8d031c 100644 --- a/Utils/Encoding/Huffman/Dictionary.php +++ b/Utils/Encoding/Huffman/Dictionary.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Encoding\Huffman; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -60,7 +56,6 @@ final class Dictionary * @param string $source Source to create the dictionary from * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $source = '') { @@ -77,7 +72,6 @@ final class Dictionary * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function generate(string $source) /* : void */ { @@ -113,7 +107,6 @@ final class Dictionary * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ private function fill(string $entry, string $value = '') /* : void */ { @@ -143,7 +136,6 @@ final class Dictionary * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(string $entry, string $value) /* : void */ { @@ -182,7 +174,6 @@ final class Dictionary * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(string $entry) : string { @@ -205,7 +196,6 @@ final class Dictionary * @return null|string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEntry(&$value) /* : ?string */ { diff --git a/Utils/Encoding/Huffman/Huffman.php b/Utils/Encoding/Huffman/Huffman.php index b2185abb0..7ce41d93e 100644 --- a/Utils/Encoding/Huffman/Huffman.php +++ b/Utils/Encoding/Huffman/Huffman.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Encoding\Huffman; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,7 +38,6 @@ final class Huffman * Remove dictionary * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeDictionary() /* : void */ { @@ -55,7 +50,6 @@ final class Huffman * @return Dictionary * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDictionary() : Dictionary { @@ -68,7 +62,6 @@ final class Huffman * @param Dictionary $dictionary Huffman dictionary * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDictionary(Dictionary $dictionary) /* : void */ { @@ -83,7 +76,6 @@ final class Huffman * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function encode(string $source) : string { @@ -122,7 +114,6 @@ final class Huffman * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function decode(string $raw) : string { diff --git a/Utils/Encoding/XorEncoding.php b/Utils/Encoding/XorEncoding.php index 7c84d7774..e34df4c3f 100644 --- a/Utils/Encoding/XorEncoding.php +++ b/Utils/Encoding/XorEncoding.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Encoding; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Excel/Excel.php b/Utils/Excel/Excel.php index bd4a4d5c4..242a5aa3c 100644 --- a/Utils/Excel/Excel.php +++ b/Utils/Excel/Excel.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Git/Author.php b/Utils/Git/Author.php index a9b030ce3..9d8c91b87 100644 --- a/Utils/Git/Author.php +++ b/Utils/Git/Author.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Git; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -77,7 +73,6 @@ class Author * @param string $email Author email * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $name = '', string $email = '') { @@ -91,7 +86,6 @@ class Author * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -104,7 +98,6 @@ class Author * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEmail() : string { @@ -117,7 +110,6 @@ class Author * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCommitCount() : int { @@ -132,7 +124,6 @@ class Author * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCommitCount(int $count) /* : void */ { @@ -147,7 +138,6 @@ class Author * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAdditionCount(int $count) /* : void */ { @@ -160,7 +150,6 @@ class Author * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAdditionCount() : int { @@ -175,7 +164,6 @@ class Author * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setRemovalCount(int $count) /* : void */ { @@ -188,7 +176,6 @@ class Author * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRemovalCount() : int { diff --git a/Utils/Git/Branch.php b/Utils/Git/Branch.php index a075eece7..b19c63367 100644 --- a/Utils/Git/Branch.php +++ b/Utils/Git/Branch.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Git; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ class Branch * @param string $name Branch name * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $name = '') { @@ -57,7 +52,6 @@ class Branch * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -70,7 +64,6 @@ class Branch * @param string $name Branch name * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName(string $name) /* : void */ { diff --git a/Utils/Git/Commit.php b/Utils/Git/Commit.php index 180c53cb5..2248e97c2 100644 --- a/Utils/Git/Commit.php +++ b/Utils/Git/Commit.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Git; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -100,7 +96,6 @@ class Commit * @param string $id Commit hash * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $id = '') { @@ -116,7 +111,6 @@ class Commit * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getId() : string { @@ -131,7 +125,6 @@ class Commit * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addFile(string $path) : bool { @@ -150,7 +143,6 @@ class Commit * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMessage() : string { @@ -163,7 +155,6 @@ class Commit * @param string $message Commit message * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setMessage(string $message) /* : void */ { @@ -176,7 +167,6 @@ class Commit * @return string[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFiles() : array { @@ -191,7 +181,6 @@ class Commit * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeFile(string $path) : bool { @@ -210,7 +199,6 @@ class Commit * @return Author * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAuthor() : Author { @@ -223,7 +211,6 @@ class Commit * @param Author $author Commit author * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAuthor(Author $author) /* : void */ { @@ -236,7 +223,6 @@ class Commit * @return Branch * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBranch() : Branch { @@ -249,7 +235,6 @@ class Commit * @param Branch $branch Commit branch * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setBranch(Branch $branch) /* : void */ { @@ -262,7 +247,6 @@ class Commit * @return Tag * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getTag() : Tag { @@ -275,7 +259,6 @@ class Commit * @param Tag $tag Commit tag * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setTag(Tag $tag) /* : void */ { @@ -288,7 +271,6 @@ class Commit * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDate() : \DateTime { @@ -303,7 +285,6 @@ class Commit * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDate(\DateTime $date) /* : void */ { @@ -316,7 +297,6 @@ class Commit * @return Repository * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRepository() : Repository { @@ -329,7 +309,6 @@ class Commit * @param Repository $repository Commit repository * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setRepository(Repository $repository) /* : void */ { @@ -347,7 +326,6 @@ class Commit * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function addChange(string $path, int $line, string $old, string $new) /* : void */ { diff --git a/Utils/Git/Git.php b/Utils/Git/Git.php index 1fa318a29..9b7cbcc6c 100644 --- a/Utils/Git/Git.php +++ b/Utils/Git/Git.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\System\File\PathException; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -46,7 +42,6 @@ class Git * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function test() : bool { @@ -69,7 +64,6 @@ class Git * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getBin() : string { @@ -84,7 +78,6 @@ class Git * @throws PathException * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function setBin(string $path) /* : void */ { diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index 6457f8c02..6f2be2d1f 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\Utils\StringUtils; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -71,7 +67,6 @@ class Repository * @param string $path Repository path * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $path) { @@ -87,7 +82,6 @@ class Repository * @throws PathException * * @since 1.0.0 - * @author Dennis Eichhorn */ private function setPath(string $path) /* : void */ { @@ -118,7 +112,6 @@ class Repository * @return Branch * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getActiveBranch() : Branch { @@ -139,7 +132,6 @@ class Repository * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBranches() : array { @@ -167,7 +159,6 @@ class Repository * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function run(string $cmd) : array { @@ -208,7 +199,6 @@ class Repository * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseLines(string $lines) : array { @@ -235,7 +225,6 @@ class Repository * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function create(string $source = null, bool $bare = false) { @@ -256,7 +245,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function status() : string { @@ -273,7 +261,6 @@ class Repository * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add($files = '*') : string { @@ -297,7 +284,6 @@ class Repository * @throws \InvalidArgumentException * * @since 1.0.0 - * @author Dennis Eichhorn */ public function rm($files = '*', bool $cached = false) : string { @@ -319,7 +305,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function commit(Commit $commit, $all = true) : string { @@ -336,7 +321,6 @@ class Repository * @throws PathException in case the target is not a valid directory * * @since 1.0.0 - * @author Dennis Eichhorn */ public function cloneTo(string $target) : string { @@ -357,7 +341,6 @@ class Repository * @throws PathException in case the source repository is not valid * * @since 1.0.0 - * @author Dennis Eichhorn */ public function cloneFrom(string $source) : string { @@ -378,7 +361,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function cloneRemote(string $source) : string { @@ -396,7 +378,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function clean(bool $dirs = false, bool $force = false) : string { @@ -412,7 +393,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function createBranch(Branch $branch, bool $force = false) : string { @@ -425,7 +405,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -445,7 +424,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDirectoryPath() : string { @@ -458,7 +436,6 @@ class Repository * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBranchesRemote() : array { @@ -484,7 +461,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function checkout(Branch $branch) : string { @@ -502,7 +478,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function merge(Branch $branch) : string { @@ -515,7 +490,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function fetch() : string { @@ -530,7 +504,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function createTag(Tag $tag) : string { @@ -545,7 +518,6 @@ class Repository * @return Tag[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getTags(string $pattern = '') : array { @@ -569,7 +541,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function push(string $remote, Branch $branch) : string { @@ -587,7 +558,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function pull(string $remote, Branch $branch) : string { @@ -604,7 +574,6 @@ class Repository * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDescription(string $description) /* : void */ { @@ -617,7 +586,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDescription() : string { @@ -632,7 +600,6 @@ class Repository * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function countFiles() : int { @@ -651,7 +618,6 @@ class Repository * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLOC(array $extensions = ['*']) : int { @@ -693,7 +659,6 @@ class Repository * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getContributors(\DateTime $start = null, \DateTime $end = null) : array { @@ -733,7 +698,6 @@ class Repository * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCommitsCount(\DateTime $start = null, \DateTime $end = null) : array { @@ -767,7 +731,6 @@ class Repository * @return array ['added' => ?, 'removed'=> ?] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAdditionsRemovalsByContributor(Author $author, \DateTime $start = null, \DateTime $end = null) : array { @@ -790,7 +753,6 @@ class Repository * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRemote() : string { @@ -807,7 +769,6 @@ class Repository * @return Commit[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCommitsBy(\DateTime $start = null, \DateTime $end = null, Author $author = null) : array { @@ -851,7 +812,6 @@ class Repository * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCommit(string $commit) : Commit { @@ -903,7 +863,6 @@ class Repository * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNewest(int $limit = 1) : Commit { diff --git a/Utils/Git/Tag.php b/Utils/Git/Tag.php index 60a22d862..c850f8c1d 100644 --- a/Utils/Git/Tag.php +++ b/Utils/Git/Tag.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Git; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -52,7 +48,6 @@ class Tag * @param string $name Tag name/version * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $name = '') { @@ -65,7 +60,6 @@ class Tag * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMessage() : string { @@ -78,7 +72,6 @@ class Tag * @param string $message Tag message * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setMessage(string $message) /* : void */ { @@ -91,7 +84,6 @@ class Tag * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { diff --git a/Utils/IO/Csv/CsvDatabaseMapper.php b/Utils/IO/Csv/CsvDatabaseMapper.php index 44db78a49..52ad106ff 100644 --- a/Utils/IO/Csv/CsvDatabaseMapper.php +++ b/Utils/IO/Csv/CsvDatabaseMapper.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/IO/Csv/CsvInterface.php b/Utils/IO/Csv/CsvInterface.php index 63ae0ddf9..909aecc1f 100644 --- a/Utils/IO/Csv/CsvInterface.php +++ b/Utils/IO/Csv/CsvInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/IO/Csv/CsvSettings.php b/Utils/IO/Csv/CsvSettings.php index d65af6511..2e06387be 100644 --- a/Utils/IO/Csv/CsvSettings.php +++ b/Utils/IO/Csv/CsvSettings.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -36,7 +34,6 @@ class CsvSettings * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getFileDelimiter($file, int $checkLines = 2, array $delimiters = [',', '\t', ';', '|', ':']) : string { diff --git a/Utils/IO/Excel/ExcelDatabaseMapper.php b/Utils/IO/Excel/ExcelDatabaseMapper.php index 558d78033..26f7cdfe2 100644 --- a/Utils/IO/Excel/ExcelDatabaseMapper.php +++ b/Utils/IO/Excel/ExcelDatabaseMapper.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/IO/Excel/ExcelInterface.php b/Utils/IO/Excel/ExcelInterface.php index fed8c698d..9d871a5b6 100644 --- a/Utils/IO/Excel/ExcelInterface.php +++ b/Utils/IO/Excel/ExcelInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\IO\Excel; * * @category Framework * @package Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ interface ExcelInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function exportExcel($path); @@ -51,7 +46,6 @@ interface ExcelInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function importExcel($path); } diff --git a/Utils/IO/ExchangeInterface.php b/Utils/IO/ExchangeInterface.php index 7e1702d38..21b16ad88 100644 --- a/Utils/IO/ExchangeInterface.php +++ b/Utils/IO/ExchangeInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -27,8 +25,6 @@ use phpOMS\Utils\IO\Pdf\PdfInterface; * * @category Framework * @package phpOMS\Utils\IO - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/IO/IODatabaseMapper.php b/Utils/IO/IODatabaseMapper.php index f37e9b6d9..eb3eeed37 100644 --- a/Utils/IO/IODatabaseMapper.php +++ b/Utils/IO/IODatabaseMapper.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/IO/Json/InvalidJsonException.php b/Utils/IO/Json/InvalidJsonException.php index 0de462932..53aa67fef 100644 --- a/Utils/IO/Json/InvalidJsonException.php +++ b/Utils/IO/Json/InvalidJsonException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\IO\Json; * * @category Framework * @package phpOMS\Utils\IO\Json - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class InvalidJsonException extends \UnexpectedValueException * @param \Exception Previous exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct($message, $code = 0, \Exception $previous = null) { diff --git a/Utils/IO/Json/JsonInterface.php b/Utils/IO/Json/JsonInterface.php index 566d7a12e..d1bb6d1a5 100644 --- a/Utils/IO/Json/JsonInterface.php +++ b/Utils/IO/Json/JsonInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\IO\Json; * * @category Framework * @package Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ interface JsonInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function exportJson($path); @@ -51,7 +46,6 @@ interface JsonInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function importJson($path); } diff --git a/Utils/IO/Pdf/PdfInterface.php b/Utils/IO/Pdf/PdfInterface.php index cec1a312f..64d278a15 100644 --- a/Utils/IO/Pdf/PdfInterface.php +++ b/Utils/IO/Pdf/PdfInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\IO\Pdf; * * @category Framework * @package Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ interface PdfInterface * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function exportPdf($path); } diff --git a/Utils/IO/Zip/ArchiveInterface.php b/Utils/IO/Zip/ArchiveInterface.php index ebfdc544a..ecf949276 100644 --- a/Utils/IO/Zip/ArchiveInterface.php +++ b/Utils/IO/Zip/ArchiveInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -20,8 +18,6 @@ namespace phpOMS\Utils\IO\Zip; * * @category Framework * @package phpOMS\Utils\IO - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -31,16 +27,15 @@ interface ArchiveInterface /** * Create archive. * - * @param string[] $sources Files and directories to compress + * @param string $sources Files and directories to compress * @param string $destination Output destination * @param bool $overwrite Overwrite if destination is existing * * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function pack(array $sources, string $destination, bool $overwrite = true) : bool + public static function pack($sources, string $destination, bool $overwrite = true) : bool; /** * Unpack archive. @@ -51,7 +46,6 @@ interface ArchiveInterface * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function unpack(string $source, string $destination) : bool; } diff --git a/Utils/IO/Zip/Gz.php b/Utils/IO/Zip/Gz.php index 8b1378917..b131c0541 100644 --- a/Utils/IO/Zip/Gz.php +++ b/Utils/IO/Zip/Gz.php @@ -1 +1,76 @@ - + - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils\IO\Zip; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -34,16 +30,7 @@ class Zip implements ArchiveInterface { /** - * Create zip. - * - * @param string[] $sources Files and directories to compress - * @param string $destination Output destination - * @param bool $overwrite Overwrite if destination is existing - * - * @return bool - * - * @since 1.0.0 - * @author Dennis Eichhorn + * {@inheritdoc} */ public static function pack(array $sources, string $destination, bool $overwrite = true) : bool { @@ -92,6 +79,9 @@ class Zip implements ArchiveInterface return $zip->close(); } + /** + * {@inheritdoc} + */ public static function unpack(string $source, string $destination) : bool { $destination = str_replace('\\', '/', realpath($destination)); diff --git a/Utils/ImageUtils.php b/Utils/ImageUtils.php index b1c3b41f7..0ef014db6 100644 --- a/Utils/ImageUtils.php +++ b/Utils/ImageUtils.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class ImageUtils * @return string Decoded image * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function decodeBase64Image(string $img) : string { diff --git a/Utils/JobQueue/Job.php b/Utils/JobQueue/Job.php index 6132be1d6..50a286a96 100644 --- a/Utils/JobQueue/Job.php +++ b/Utils/JobQueue/Job.php @@ -7,8 +7,6 @@ * @category TBD * } * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ namespace phpOMS\Utils\JobQueue; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/JobQueue/JobQueue.php b/Utils/JobQueue/JobQueue.php index c7f11426a..c75c88701 100644 --- a/Utils/JobQueue/JobQueue.php +++ b/Utils/JobQueue/JobQueue.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Stdlib\Queue\PriorityQueue; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/JsonBuilder.php b/Utils/JsonBuilder.php index b0a1e29f5..dec4a70b2 100644 --- a/Utils/JsonBuilder.php +++ b/Utils/JsonBuilder.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,13 +20,11 @@ namespace phpOMS\Utils; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ -class JsonBuilder implements \Serializable +class JsonBuilder implements \Serializable, \JsonSerializable { /** @@ -43,7 +39,6 @@ class JsonBuilder implements \Serializable * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -55,7 +50,6 @@ class JsonBuilder implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getJson() : array { @@ -72,7 +66,6 @@ class JsonBuilder implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(string $path, $value, bool $overwrite = true) /* : void */ { @@ -87,7 +80,6 @@ class JsonBuilder implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(string $path) /* : void */ { @@ -116,6 +108,11 @@ class JsonBuilder implements \Serializable */ public function unserialize($serialized) { - $this->json = json_decode($serialized); + $this->json = json_decode($serialized, true); + } + + public function jsonSerialize() + { + return $this->getJson(); } } diff --git a/Utils/PDF/Pdf.php b/Utils/PDF/Pdf.php index 4eb73e4c7..ecbf2965d 100644 --- a/Utils/PDF/Pdf.php +++ b/Utils/PDF/Pdf.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/LaTex/Expressions/Product.php b/Utils/Parser/LaTex/Expressions/Product.php index ce8743ba7..d86e7600e 100644 --- a/Utils/Parser/LaTex/Expressions/Product.php +++ b/Utils/Parser/LaTex/Expressions/Product.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/LaTex/Expressions/Sum.php b/Utils/Parser/LaTex/Expressions/Sum.php index 4fe3616de..d920c2edb 100644 --- a/Utils/Parser/LaTex/Expressions/Sum.php +++ b/Utils/Parser/LaTex/Expressions/Sum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/LaTex/Expressions/Trigonometry.php b/Utils/Parser/LaTex/Expressions/Trigonometry.php index 3d28f89ac..f485cec6f 100644 --- a/Utils/Parser/LaTex/Expressions/Trigonometry.php +++ b/Utils/Parser/LaTex/Expressions/Trigonometry.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/LaTex/LaTexParser.php b/Utils/Parser/LaTex/LaTexParser.php index 4065a395a..b1e480b27 100644 --- a/Utils/Parser/LaTex/LaTexParser.php +++ b/Utils/Parser/LaTex/LaTexParser.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/LaTex/Types/Interval.php b/Utils/Parser/LaTex/Types/Interval.php index 5ee143061..9a1004351 100644 --- a/Utils/Parser/LaTex/Types/Interval.php +++ b/Utils/Parser/LaTex/Types/Interval.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/LaTex/Types/MathFunction.php b/Utils/Parser/LaTex/Types/MathFunction.php index 214106437..a78908389 100644 --- a/Utils/Parser/LaTex/Types/MathFunction.php +++ b/Utils/Parser/LaTex/Types/MathFunction.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/LaTex/Types/Variable.php b/Utils/Parser/LaTex/Types/Variable.php index a380564b9..89f1daa42 100644 --- a/Utils/Parser/LaTex/Types/Variable.php +++ b/Utils/Parser/LaTex/Types/Variable.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/Parser/Markdown/Markdown.php b/Utils/Parser/Markdown/Markdown.php index a87da3829..846c617b6 100644 --- a/Utils/Parser/Markdown/Markdown.php +++ b/Utils/Parser/Markdown/Markdown.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\Parser\Markdown; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Parser/Php/ArrayParser.php b/Utils/Parser/Php/ArrayParser.php index b23b91db2..c16bb72d8 100644 --- a/Utils/Parser/Php/ArrayParser.php +++ b/Utils/Parser/Php/ArrayParser.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils\Parser\Php; * * @category Framework * @package phpOMS\Utils\Parser - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class ArrayParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function serializeArray(array $arr) : string { diff --git a/Utils/Parser/Php/ClassParser.php b/Utils/Parser/Php/ClassParser.php index f9c71e1c3..55e1e8485 100644 --- a/Utils/Parser/Php/ClassParser.php +++ b/Utils/Parser/Php/ClassParser.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils\Parser\Php; * * @category Framework * @package phpOMS\Utils\Parser - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -152,7 +148,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function createFile(string $path) /* : void */ { @@ -167,7 +162,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setFinal(bool $final) /* : void */ { @@ -180,7 +174,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isFinal() : bool { @@ -195,7 +188,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAbstract(bool $abstract) /* : void */ { @@ -208,7 +200,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isAbstract() : bool { @@ -221,7 +212,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getType() : string { @@ -238,7 +228,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setType(string $type) /* : void */ { @@ -251,7 +240,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getExtends() : string { @@ -266,7 +254,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setExtends(string $extends) /* : void */ { @@ -279,7 +266,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeExtends() /* : void */ { @@ -292,7 +278,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNamespace() : string { @@ -307,7 +292,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setNamespace(string $namespace) /* : void */ { @@ -320,7 +304,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeNamespace() /* : void */ { @@ -336,7 +319,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addUse(string $namespace, string $as = null) /* : void */ { @@ -355,7 +337,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeUse($id) : bool { @@ -374,7 +355,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -389,7 +369,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName(string $name) /* : void */ { @@ -404,7 +383,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addImplements(string $implements) /* : void */ { @@ -421,7 +399,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addInclude(string $include) /* : void */ { @@ -438,7 +415,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addRequire(string $require) /* : void */ { @@ -456,7 +432,6 @@ class ClassParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addTrait(string $trait, string $as = null) /* : void */ { @@ -475,7 +450,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeTrait($id) : bool { @@ -496,7 +470,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addMember(MemberParser $member) /* : void */ { @@ -511,7 +484,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeMember(string $name) : bool { @@ -532,7 +504,6 @@ class ClassParser * @return MemberParser * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMember(string $name) : MemberParser { @@ -547,7 +518,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addFunction(FunctionParser $function) { @@ -562,7 +532,6 @@ class ClassParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeFunction(string $name) : bool { @@ -583,7 +552,6 @@ class ClassParser * @return FunctionParser * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getFunction(string $name) : FunctionParser { @@ -596,7 +564,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serialize() : string { @@ -632,7 +599,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function serializeRequire(string $keyword, array $source) : string { @@ -654,7 +620,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function serializeNamespace() : string { @@ -674,7 +639,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function serializeUse(array $source) : string { @@ -696,7 +660,6 @@ class ClassParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function serializeClass() : string { diff --git a/Utils/Parser/Php/ClassType.php b/Utils/Parser/Php/ClassType.php index 0d9ad6b18..439e57a20 100644 --- a/Utils/Parser/Php/ClassType.php +++ b/Utils/Parser/Php/ClassType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Utils\Parser\Php; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Database type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\Utils\Parser - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Parser/Php/FunctionParser.php b/Utils/Parser/Php/FunctionParser.php index 18a96622b..649129e58 100644 --- a/Utils/Parser/Php/FunctionParser.php +++ b/Utils/Parser/Php/FunctionParser.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils\Parser\Php; * * @category Framework * @package phpOMS\Utils\Parser - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -102,7 +98,6 @@ class FunctionParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -117,7 +112,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName(string $name) /* : void */ { @@ -132,7 +126,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function seBody(string $body) /* : void */ { @@ -145,7 +138,6 @@ class FunctionParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getBody() : string { @@ -158,7 +150,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeBody() /* : void */ { @@ -171,7 +162,6 @@ class FunctionParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getVisibility() : string { @@ -186,7 +176,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setVisibility(string $visibility) /* : void */ { @@ -201,7 +190,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStatic(bool $static) /* : void */ { @@ -214,7 +202,6 @@ class FunctionParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isStatic() : bool { @@ -229,7 +216,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setFinal(bool $final) /* : void */ { @@ -242,7 +228,6 @@ class FunctionParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isFinal() : bool { @@ -257,7 +242,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAbstract(bool $abstract) /* : void */ { @@ -276,7 +260,6 @@ class FunctionParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isAbstract() : bool { @@ -289,7 +272,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeReturn() /* : void */ { @@ -302,7 +284,6 @@ class FunctionParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getReturn() : string { @@ -317,7 +298,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setReturn(string $return) /* : void */ { @@ -334,7 +314,6 @@ class FunctionParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addParameter(string $name, string $typehint = null, string $default = null) /* : void */ { @@ -356,7 +335,6 @@ class FunctionParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serialize() { @@ -404,7 +382,6 @@ class FunctionParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function addIndent(string $body) : string { diff --git a/Utils/Parser/Php/MemberParser.php b/Utils/Parser/Php/MemberParser.php index ea34e4190..f45cc79af 100644 --- a/Utils/Parser/Php/MemberParser.php +++ b/Utils/Parser/Php/MemberParser.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils\Parser\Php; * * @category Framework * @package phpOMS\Utils\Parser - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -78,7 +74,6 @@ class MemberParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getName() : string { @@ -93,7 +88,6 @@ class MemberParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setName(string $name) /* : void */ { @@ -106,7 +100,6 @@ class MemberParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getVisibility() : string { @@ -121,7 +114,6 @@ class MemberParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setVisibility(string $visibility) /* : void */ { @@ -136,7 +128,6 @@ class MemberParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStatic(bool $static) /* : void */ { @@ -153,7 +144,6 @@ class MemberParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isStatic() : bool { @@ -168,7 +158,6 @@ class MemberParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setConst(bool $const) /* : void */ { @@ -185,7 +174,6 @@ class MemberParser * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function isConst() : bool { @@ -200,7 +188,6 @@ class MemberParser * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDefault($default) /* : void */ { @@ -213,7 +200,6 @@ class MemberParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serialize() : string { @@ -243,7 +229,6 @@ class MemberParser * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function parseVariable($value) : string { diff --git a/Utils/Parser/Php/Visibility.php b/Utils/Parser/Php/Visibility.php index 30582a54f..bb8f9ab18 100644 --- a/Utils/Parser/Php/Visibility.php +++ b/Utils/Parser/Php/Visibility.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,7 +15,7 @@ declare(strict_types=1); namespace phpOMS\Utils\Parser\Php; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Visibility type enum. @@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum; * * @category Framework * @package phpOMS\Utils\Parser - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/Permutation.php b/Utils/Permutation.php index 7da4cb9b3..207530c4f 100644 --- a/Utils/Permutation.php +++ b/Utils/Permutation.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class Permutation * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function permut(array $toPermute, array $result = []) : array { @@ -69,7 +64,6 @@ class Permutation * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isPermutation(string $a, string $b) : bool { @@ -85,7 +79,6 @@ class Permutation * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isPalindrome(string $a, string $filter = 'a-zA-Z0-9') : bool { @@ -105,7 +98,6 @@ class Permutation * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function permutate($toPermute, array $key) { diff --git a/Utils/RnG/Address.php b/Utils/RnG/Address.php index fad29fc32..3078e5e99 100644 --- a/Utils/RnG/Address.php +++ b/Utils/RnG/Address.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/RnG/ArrayRandomize.php b/Utils/RnG/ArrayRandomize.php index 8d93b9d13..02931e988 100644 --- a/Utils/RnG/ArrayRandomize.php +++ b/Utils/RnG/ArrayRandomize.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\RnG; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class ArrayRandomize * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function yates(array $arr) : array { @@ -61,7 +56,6 @@ class ArrayRandomize * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function knuth(array $arr) : array { diff --git a/Utils/RnG/City.php b/Utils/RnG/City.php index eccf12fdd..5f3343a17 100644 --- a/Utils/RnG/City.php +++ b/Utils/RnG/City.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/RnG/DateTime.php b/Utils/RnG/DateTime.php index fb3791953..2c709de10 100644 --- a/Utils/RnG/DateTime.php +++ b/Utils/RnG/DateTime.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\RnG; * * @category Framework * @package Utils\RnG - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -40,7 +36,6 @@ class DateTime * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function generateDateTime(string $start, string $end) : \DateTime { diff --git a/Utils/RnG/DistributionType.php b/Utils/RnG/DistributionType.php index 395efdf65..cc7ff2f5e 100644 --- a/Utils/RnG/DistributionType.php +++ b/Utils/RnG/DistributionType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Utils\RnG; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Distribution type enum. * * @category Framework * @package Utils/RnG - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/RnG/Email.php b/Utils/RnG/Email.php index 28f5a1c16..0756d51e1 100644 --- a/Utils/RnG/Email.php +++ b/Utils/RnG/Email.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/RnG/File.php b/Utils/RnG/File.php index ff6fbbbf4..b892b587c 100644 --- a/Utils/RnG/File.php +++ b/Utils/RnG/File.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ namespace phpOMS\Utils\RnG; * * @category DataStorage * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,71 +34,19 @@ class File * @var array[] * @since 1.0.0 */ - private static $extensions = [['exe', null], - ['dat', null], - ['txt', null], - ['csv', 'txt'], - ['doc', null], - ['docx', 'doc'], - ['mp3', null], - ['mp4', null], - ['avi', null], - ['mpeg', null], - ['wmv', null], - ['ppt', null], - ['xls', null], - ['xlsx', 'xls'], - ['xlsxm', 'xls'], - ['php', null], - ['html', null], - ['tex', null], - ['js', null], - ['c', null], - ['cpp', null], - ['h', null], - ['res', null], - ['ico', null], - ['jpg', null], - ['png', null], - ['gif', null], - ['bmp', null], - ['ttf', null], - ['zip', null], - ['rar', null], - ['7z', null], - ['tar', 'gz'], - ['gz', null], - ['gz', null], - ['sh', null], - ['bat', null], - ['iso', null], - ['css', null], - ['json', null], - ['ini', null], - ['psd', null], - ['pptx', 'ppt'], - ['xml', null], - ['dll', null], - ['wav', null], - ['wma', null], - ['vb', null], - ['tmp', null], - ['tif', null], - ['sql', null], - ['swf', null], - ['svg', null], - ['rpm', null], - ['rss', null], - ['pkg', null], - ['pdf', null], - ['mpg', null], - ['mov', null], - ['jar', null], - ['flv', null], - ['fla', null], - ['deb', null], - ['py', null], - ['pl', null],]; + private static $extensions = [ + ['exe', null], ['dat', null], ['txt', null], ['csv', 'txt'], ['doc', null], ['docx', 'doc'], + ['mp3', null], ['mp4', null], ['avi', null], ['mpeg', null], ['wmv', null], ['ppt', null], + ['xls', null], ['xlsx', 'xls'], ['xlsxm', 'xls'], ['php', null], ['html', null], ['tex', null], + ['js', null], ['c', null], ['cpp', null], ['h', null], ['res', null], ['ico', null], + ['jpg', null], ['png', null], ['gif', null], ['bmp', null], ['ttf', null], ['zip', null], + ['rar', null], ['7z', null], ['tar', 'gz'], ['gz', null], ['gz', null], ['sh', null], + ['bat', null], ['iso', null], ['css', null], ['json', null], ['ini', null], ['psd', null], + ['pptx', 'ppt'], ['xml', null], ['dll', null], ['wav', null], ['wma', null], ['vb', null], + ['tmp', null], ['tif', null], ['sql', null], ['swf', null], ['svg', null], ['rpm', null], + ['rss', null], ['pkg', null], ['pdf', null], ['mpg', null], ['mov', null], ['jar', null], + ['flv', null], ['fla', null], ['deb', null], ['py', null], ['pl', null], + ]; /** * Get a random file extension. @@ -113,7 +57,6 @@ class File * @return false|array * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function generateExtension($source = null, $distribution = DistributionType::UNIFORM) { diff --git a/Utils/RnG/Iban.php b/Utils/RnG/Iban.php index 5cbf9fab8..85056b204 100644 --- a/Utils/RnG/Iban.php +++ b/Utils/RnG/Iban.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/RnG/LinearCongruentialGenerator.php b/Utils/RnG/LinearCongruentialGenerator.php index 65c51b42b..ae777704d 100644 --- a/Utils/RnG/LinearCongruentialGenerator.php +++ b/Utils/RnG/LinearCongruentialGenerator.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\RnG; * * @category Framework * @package phpOMS\Asset - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class LinearCongruentialGenerator * @return \Closure * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function bsd(int $seed) { @@ -55,7 +50,6 @@ class LinearCongruentialGenerator * @return \Closure * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function msvcrt(int $seed) { diff --git a/Utils/RnG/Name.php b/Utils/RnG/Name.php index bc2b3a9ba..ae64cc0cb 100644 --- a/Utils/RnG/Name.php +++ b/Utils/RnG/Name.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\RnG; * * @category Framework * @package Utils\RnG - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -471,8 +467,22 @@ class Name 'Lutz', 'Duarte', 'Kidd', 'Key', 'Cooke', ], ], + 'asian' => [ + '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', + ], + ] ]; + + /** * Get a random string. * @@ -482,12 +492,11 @@ class Name * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function generateName(array $type, string $origin = 'western') : string { - $rndType = rand(0, count($type) - 1); + $rndType = mt_rand(0, count($type) - 1); - return self::$names[$origin][$type[$rndType]][rand(0, count(self::$names[$origin][$type[$rndType]]) - 1)]; + return self::$names[$origin][$type[$rndType]][mt_rand(0, count(self::$names[$origin][$type[$rndType]]) - 1)]; } } diff --git a/Utils/RnG/Numeric.php b/Utils/RnG/Numeric.php index d35fee2b6..0696086c9 100644 --- a/Utils/RnG/Numeric.php +++ b/Utils/RnG/Numeric.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/RnG/Phone.php b/Utils/RnG/Phone.php index c25e5809b..128660d93 100644 --- a/Utils/RnG/Phone.php +++ b/Utils/RnG/Phone.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ namespace phpOMS\Utils\RnG; * * @category Framework * @package Utils\RnG - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -42,7 +38,6 @@ class Phone * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function generatePhone($isInt = true, $layout = ['struct' => '+$1 ($2) $3-$4', 'size' => [null, diff --git a/Utils/RnG/PostalZip.php b/Utils/RnG/PostalZip.php index 146803a45..bf3919bc3 100644 --- a/Utils/RnG/PostalZip.php +++ b/Utils/RnG/PostalZip.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Utils/RnG/StringUtils.php b/Utils/RnG/StringUtils.php index 11fcfd01d..e70c147fd 100644 --- a/Utils/RnG/StringUtils.php +++ b/Utils/RnG/StringUtils.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\RnG; * * @category Framework * @package Utils\RnG - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ class StringUtils * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function generateString(int $min = 10, int $max = 10, string $charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') : string { diff --git a/Utils/RnG/Text.php b/Utils/RnG/Text.php index 57ba6b014..dd9b8016d 100644 --- a/Utils/RnG/Text.php +++ b/Utils/RnG/Text.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\RnG; * * @category Framework * @package RnG - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,184 +33,24 @@ class Text * @var string[] * @since 1.0.0 */ - private static $words_west = ['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', - 'proin', - 'accumsan', - 'sapien', - 'nec', - 'massa', - 'volutpat', - 'venenatis', - 'sed', - 'eu', - 'molestie', - 'lacus', - 'quisque', - 'porttitor', - 'ligula', - 'dui', - 'mollis', - 'tempus', - 'at', - 'magna', - 'vestibulum', - 'turpis', - 'ac', - 'diam', - 'tincidunt', - 'id', - 'condimentum', - 'enim', - 'sodales', - 'in', - 'hac', - 'habitasse', - 'platea', - 'dictumst', - 'aenean', - 'neque', - 'fusce', - 'augue', - 'leo', - 'eget', - 'semper', - 'mattis', - 'tortor', - 'scelerisque', - 'nulla', - 'interdum', - 'tellus', - 'malesuada', - 'rhoncus', - 'porta', - 'sem', - 'aliquet', - 'et', - 'nam', - 'suspendisse', - 'potenti', - 'vivamus', - 'luctus', - 'fringilla', - 'erat', - 'donec', - 'justo', - 'vehicula', - 'ultricies', - 'varius', - 'ante', - 'primis', - 'faucibus', - 'ultrices', - 'posuere', - 'cubilia', - 'curae', - 'etiam', - 'cursus', - 'aliquam', - 'quam', - 'dapibus', - 'nisl', - 'feugiat', - 'egestas', - 'class', - 'aptent', - 'taciti', - 'sociosqu', - 'ad', - 'litora', - 'torquent', - 'per', - 'conubia', - 'nostra', - 'inceptos', - 'himenaeos', - 'phasellus', - 'nibh', - 'pulvinar', - 'vitae', - 'urna', - 'iaculis', - 'lobortis', - 'nisi', - 'viverra', - 'arcu', - 'morbi', - 'pellentesque', - 'metus', - 'commodo', - 'ut', - 'facilisis', - 'felis', - 'tristique', - 'ullamcorper', - 'placerat', - 'aenean', - 'convallis', - 'sollicitudin', - 'integer', - 'rutrum', - 'duis', - 'est', - 'etiam', - 'bibendum', - 'donec', - 'pharetra', - 'vulputate', - 'maecenas', - 'mi', - 'fermentum', - 'consequat', - 'suscipit', - 'aliquam', - 'habitant', - 'senectus', - 'netus', - 'fames', - 'quisque', - 'euismod', - 'curabitur', - 'lectus', - 'elementum', - 'tempor', - 'risus', - 'cras',]; + private static $words_west = [ + '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', + 'proin', 'accumsan', 'sapien', 'nec', 'massa', 'volutpat', 'venenatis', 'sed', 'eu', 'molestie', 'lacus', 'quisque', + 'porttitor', 'ligula', 'dui', 'mollis', 'tempus', 'at', 'magna', 'vestibulum', 'turpis', 'ac', 'diam', 'tincidunt', 'id', + 'condimentum', 'enim', 'sodales', 'in', 'hac', 'habitasse', 'platea', 'dictumst', 'aenean', 'neque', 'fusce', 'augue', + 'leo', 'eget', 'semper', 'mattis', 'tortor', 'scelerisque', 'nulla', 'interdum', 'tellus', 'malesuada', 'rhoncus', 'porta', + 'sem', 'aliquet', 'et', 'nam', 'suspendisse', 'potenti', 'vivamus', 'luctus', 'fringilla', 'erat', 'donec', 'justo', + 'vehicula', 'ultricies', 'varius', 'ante', 'primis', 'faucibus', 'ultrices', 'posuere', 'cubilia', 'curae', 'etiam', + 'cursus', 'aliquam', 'quam', 'dapibus', 'nisl', 'feugiat', 'egestas', 'class', 'aptent', 'taciti', 'sociosqu', 'ad', + 'litora', 'torquent', 'per', 'conubia', 'nostra', 'inceptos', 'himenaeos', 'phasellus', 'nibh', 'pulvinar', 'vitae', + 'urna', 'iaculis', 'lobortis', 'nisi', 'viverra', 'arcu', 'morbi', 'pellentesque', 'metus', 'commodo', 'ut', 'facilisis', + 'felis', 'tristique', 'ullamcorper', 'placerat', 'aenean', 'convallis', 'sollicitudin', 'integer', 'rutrum', 'duis', 'est', + 'etiam', 'bibendum', 'donec', 'pharetra', 'vulputate', 'maecenas', 'mi', 'fermentum', 'consequat', 'suscipit', 'aliquam', + 'habitant', 'senectus', 'netus', 'fames', 'quisque', 'euismod', 'curabitur', 'lectus', 'elementum', 'tempor', 'risus', + 'cras', + ]; /** * Text has random formatting. @@ -248,7 +84,6 @@ class Text * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setFormatting($hasFormatting) /* : void */ { @@ -263,7 +98,6 @@ class Text * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setParagraphs($hasParagraphs) /* : void */ { @@ -276,7 +110,6 @@ class Text * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getSentences() : int { @@ -292,7 +125,6 @@ class Text * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function generateText(int $length, $words = null) : string { @@ -383,7 +215,6 @@ class Text * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generatePunctuation(int $length) : array { @@ -450,7 +281,6 @@ class Text * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generateParagraph(int $length) /* : void */ { @@ -481,7 +311,6 @@ class Text * @return string[] * * @since 1.0.0 - * @author Dennis Eichhorn */ private function generateFormatting(int $length) : array { diff --git a/Utils/StringCompare.php b/Utils/StringCompare.php new file mode 100644 index 000000000..c78fa86db --- /dev/null +++ b/Utils/StringCompare.php @@ -0,0 +1,168 @@ +dictionary = $dictionary; + } + + /** + * Match word against dictionary. + * + * @param string $match Word to match against dictionary + * + * @return string Best match + * + * @since 1.0.0 + */ + public function matchDictionary(string $match) : string + { + $bestScore = PHP_INT_MAX; + $bestMatch = ''; + + foreach($dictionary as $word) { + $score = self::fuzzyMatch($word, $match); + + if($score < $bestScore) { + $bestMatch = $word; + } + } + + return $bestMatch; + } + + /** + * Calculate word match score. + * + * @param string $s1 Word 1 + * @param string $s2 Word 2 + * + * @return int + * + * @since 1.0.0 + */ + public static function valueWords(string $s1, string $s2) : int + { + $words1 = preg_split('/[ _-]/', $s1); + $words2 = preg_split('/[ _-]/', $s2); + $total = 0; + + foreach($words1 as $word1) { + $best = strlen($s2); + + foreach($words2 as $word2) { + $wordDist = levenshtein($word1, $word2); + + if($wordDist < $best) { + $best = $wordDist; + } + + if($wordDist === 0) { + break; + } + } + + $total += $total + $best; + } + + return $total; + } + + /** + * Calculate phrase match score. + * + * @param string $s1 Word 1 + * @param string $s2 Word 2 + * + * @return int + * + * @since 1.0.0 + */ + public static function valuePhrase(string $s1, string $s2) : int + { + return levenshtein($s1, $s2); + } + + /** + * Calculate word length score. + * + * @param string $s1 Word 1 + * @param string $s2 Word 2 + * + * @return int + * + * @since 1.0.0 + */ + public static function valueLength(string $s1, string $s2) : int + { + return abs(strlen($s1) - strlen($s2)); + } + + /** + * Calculate fuzzy match score. + * + * @param string $s1 Word 1 + * @param string $s2 Word 2 + * @param float $prhaseWeight Weighting for phrase score + * @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 + { + $phraseValue = valuePhrase($s1, $s2); + $wordValue = valueWords($s1, $s2); + $lengthValue = valueLength($s1, $s2); + + return min($phraseValue * $phraseWeight, $wordValue * $wordWeight) * $minWeight + + max($phraseValue * $phraseWeight, $wordValue * $wordWeight) * $maxWeight + + $lengthValue * $lengthWeight; + } +} \ No newline at end of file diff --git a/Utils/StringUtils.php b/Utils/StringUtils.php index 39571ef75..a0d175b0e 100644 --- a/Utils/StringUtils.php +++ b/Utils/StringUtils.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils; * * @category Framework * @package phpOMS\Utils - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -39,7 +35,6 @@ class StringUtils * This class is purely static and is preventing any initialization * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -60,7 +55,6 @@ class StringUtils * @return bool The function returns true if any of the needles is part of the haystack, false otherwise. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function contains(string $haystack, array $needles) : bool { @@ -88,7 +82,6 @@ class StringUtils * @return bool The function returns true if any of the needles is part of the haystack, false otherwise. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_contains(string $haystack, array $needles) : bool { @@ -117,7 +110,6 @@ class StringUtils * @return bool The function returns true if any of the needles is at the end of the haystack, false otherwise. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function endsWith(string $haystack, $needles) : bool { @@ -150,7 +142,6 @@ class StringUtils * @return bool The function returns true if any of the needles is at the beginning of the haystack, false otherwise. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function startsWith(string $haystack, $needles) : bool { @@ -179,7 +170,6 @@ class StringUtils * @return bool The function returns true if any of the needles is at the beginning of the haystack, false otherwise. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_startsWith(string $haystack, $needles) : bool { @@ -212,7 +202,6 @@ class StringUtils * @return bool The function returns true if any of the needles is at the end of the haystack, false otherwise. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_endsWith(string $haystack, $needles) : bool { @@ -237,7 +226,6 @@ class StringUtils * @return string Multi byte string with first character as upper case. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_ucfirst(string $string) : string { @@ -256,7 +244,6 @@ class StringUtils * @return string Multi byte string with first character as lower case. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_lcfirst(string $string) : string { @@ -276,11 +263,10 @@ class StringUtils * @return string Trimmed multi byte string. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_trim(string $string, string $charlist = ' ') : string { - if (is_null($charlist)) { + if ($charlist === ' ') { return trim($string); } else { $charlist = str_replace('/', '\/', preg_quote($charlist)); @@ -298,7 +284,6 @@ class StringUtils * @return string Trimmed multi byte string. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_rtrim(string $string, string $charlist = ' ') : string { @@ -320,7 +305,6 @@ class StringUtils * @return string Trimmed multi byte string. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function mb_ltrim(string $string, string $charlist = ' ') : string { @@ -345,7 +329,6 @@ class StringUtils * @return int The amount of repeating occurences at the beginning of the string. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function countCharacterFromStart(string $string, string $character) : int { diff --git a/Utils/TaskSchedule/Cron.php b/Utils/TaskSchedule/Cron.php index 8316b693c..2f8b9d765 100644 --- a/Utils/TaskSchedule/Cron.php +++ b/Utils/TaskSchedule/Cron.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\TaskSchedule; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ class Cron extends SchedulerAbstract * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function run(string $cmd) : array { diff --git a/Utils/TaskSchedule/CronJob.php b/Utils/TaskSchedule/CronJob.php index 41d5f28d8..d2c58a931 100644 --- a/Utils/TaskSchedule/CronJob.php +++ b/Utils/TaskSchedule/CronJob.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\TaskSchedule; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -38,7 +34,6 @@ class CronJob extends TaskAbstract implements \Serializable * @param string $cmd Command to execute * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(Interval $interval = null, $cmd = '') { @@ -57,7 +52,6 @@ class CronJob extends TaskAbstract implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serialize() { @@ -78,7 +72,6 @@ class CronJob extends TaskAbstract implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ private function printValue(array $value) : string { @@ -105,7 +98,6 @@ class CronJob extends TaskAbstract implements \Serializable * @param string $serialized To unserialize * * @since 1.0.0 - * @author Dennis Eichhorn */ public function unserialize($serialized) { diff --git a/Utils/TaskSchedule/Interval.php b/Utils/TaskSchedule/Interval.php index 08c9e3c12..a18d220a0 100644 --- a/Utils/TaskSchedule/Interval.php +++ b/Utils/TaskSchedule/Interval.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\TaskSchedule; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -101,7 +97,6 @@ class Interval implements \Serializable * @param string $interval Interval to parse * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $interval = null) { @@ -118,7 +113,6 @@ class Interval implements \Serializable * @param string $serialized String to unserialize * * @since 1.0.0 - * @author Dennis Eichhorn */ public function unserialize($serialized) { @@ -140,7 +134,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseMinute(string $minute) : array { @@ -155,7 +148,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseHour(string $hour) : array { @@ -170,7 +162,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseDayOfMonth(string $dayOfMonth) : array { @@ -185,7 +176,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseMonth(string $month) : array { @@ -200,7 +190,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseDayOfWeek(string $dayOfWeek) : array { @@ -215,7 +204,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseYear(string $year) : array { @@ -228,7 +216,6 @@ class Interval implements \Serializable * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStart() : \DateTime { @@ -243,7 +230,6 @@ class Interval implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStart(\DateTime $start) /* : void */ { @@ -256,7 +242,6 @@ class Interval implements \Serializable * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEnd() { @@ -271,7 +256,6 @@ class Interval implements \Serializable * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setEnd(\DateTime $end) /* : void */ { @@ -284,7 +268,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMinute() : array { @@ -301,7 +284,6 @@ class Interval implements \Serializable * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setMinute(array $minute, int $step = 0, bool $any = false) /* : void */ { @@ -327,7 +309,6 @@ class Interval implements \Serializable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function validateTime(array $times, int $step, int $lowest, int $highest) : bool { @@ -350,7 +331,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getHour() : array { @@ -367,7 +347,6 @@ class Interval implements \Serializable * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setHour(array $hour, int $step = 0, bool $any = false) /* : void */ { @@ -388,7 +367,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDayOfMonth() : array { @@ -407,7 +385,6 @@ class Interval implements \Serializable * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDayOfMonth(array $dayOfMonth, int $step = 0, bool $any = false, bool $last = false, int $nearest = 0) /* : void */ { @@ -433,7 +410,6 @@ class Interval implements \Serializable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function validateDayOfMonth(array $array) : bool { @@ -459,7 +435,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getDayOfWeek() : array { @@ -477,7 +452,6 @@ class Interval implements \Serializable * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setDayOfWeek(array $dayOfWeek, int $step = 0, bool $any = false, bool $last = false) /* : void */ { @@ -502,7 +476,6 @@ class Interval implements \Serializable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function validateDayOfWeek(array $array) : bool { @@ -525,7 +498,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getMonth() : array { @@ -542,7 +514,6 @@ class Interval implements \Serializable * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setMonth(array $month, int $step = 0, bool $any = false) /* : void */ { @@ -563,7 +534,6 @@ class Interval implements \Serializable * @return array * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getYear() : array { @@ -580,7 +550,6 @@ class Interval implements \Serializable * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setYear(array $year, int $step = 0, bool $any = false) /* : void */ { @@ -604,7 +573,6 @@ class Interval implements \Serializable * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private function validateYear(array $array) : bool { @@ -617,7 +585,6 @@ class Interval implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serialize() { @@ -640,7 +607,6 @@ class Interval implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serializeTime($time, $step) /* : void */ { @@ -664,7 +630,6 @@ class Interval implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serializeDayOfMonth() /* : void */ { @@ -692,7 +657,6 @@ class Interval implements \Serializable * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function serializeDayOfWeek() /* : void */ { diff --git a/Utils/TaskSchedule/InvalidTaskParameterException.php b/Utils/TaskSchedule/InvalidTaskParameterException.php index 82b262332..8a55a9fd2 100644 --- a/Utils/TaskSchedule/InvalidTaskParameterException.php +++ b/Utils/TaskSchedule/InvalidTaskParameterException.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Utils\TaskSchedule; * * @category System * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Utils/TaskSchedule/Schedule.php b/Utils/TaskSchedule/Schedule.php index 9df08d3af..bb67b820a 100644 --- a/Utils/TaskSchedule/Schedule.php +++ b/Utils/TaskSchedule/Schedule.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\TaskSchedule; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ class Schedule extends TaskAbstract implements \Serializable * @param string $cmd Command to execute * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(string $name, string $cmd = '') { diff --git a/Utils/TaskSchedule/SchedulerAbstract.php b/Utils/TaskSchedule/SchedulerAbstract.php index e9015b77a..8a875680a 100644 --- a/Utils/TaskSchedule/SchedulerAbstract.php +++ b/Utils/TaskSchedule/SchedulerAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -23,8 +21,6 @@ use phpOMS\System\File\PathException; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -53,7 +49,6 @@ abstract class SchedulerAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function getBin() : string { @@ -68,7 +63,6 @@ abstract class SchedulerAbstract * @throws PathException * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function setBin(string $path) /* : void */ { @@ -85,7 +79,6 @@ abstract class SchedulerAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function test() : bool { @@ -110,7 +103,6 @@ abstract class SchedulerAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function add(TaskAbstract $task) /* : void */ { @@ -125,7 +117,6 @@ abstract class SchedulerAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function remove(string $id) : bool { @@ -146,7 +137,6 @@ abstract class SchedulerAbstract * @return TaskAbstract|null * * @since 1.0.0 - * @author Dennis Eichhorn */ public function get(string $id) { @@ -159,7 +149,6 @@ abstract class SchedulerAbstract * @return TaskAbstract[] * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAll() : array { @@ -174,7 +163,6 @@ abstract class SchedulerAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function set(TaskAbstract $task) /* : void */ { @@ -187,7 +175,6 @@ abstract class SchedulerAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ abstract public function save() /* : void */; } diff --git a/Utils/TaskSchedule/SchedulerFactory.php b/Utils/TaskSchedule/SchedulerFactory.php index b5f990ace..ef8b6bd5d 100644 --- a/Utils/TaskSchedule/SchedulerFactory.php +++ b/Utils/TaskSchedule/SchedulerFactory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\System\SystemType; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -41,7 +37,6 @@ final class SchedulerFactory * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function create() : SchedulerAbstract { diff --git a/Utils/TaskSchedule/TaskAbstract.php b/Utils/TaskSchedule/TaskAbstract.php index e58dfe510..9ef962f30 100644 --- a/Utils/TaskSchedule/TaskAbstract.php +++ b/Utils/TaskSchedule/TaskAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Utils\TaskSchedule; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -81,7 +77,6 @@ abstract class TaskAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getId() : string { @@ -94,7 +89,6 @@ abstract class TaskAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getCommand() : string { @@ -109,7 +103,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setCommand(string $command) /* : void */ { @@ -122,7 +115,6 @@ abstract class TaskAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRun() : string { @@ -137,7 +129,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setRun(string $run) /* : void */ { @@ -150,7 +141,6 @@ abstract class TaskAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStatus() : string { @@ -165,7 +155,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStatus(string $status) /* : void */ { @@ -178,7 +167,6 @@ abstract class TaskAbstract * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getNextRunTime() { @@ -193,7 +181,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setNextRunTime(\DateTime $nextRunTime) /* : void */ { @@ -206,7 +193,6 @@ abstract class TaskAbstract * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getLastRuntime() { @@ -221,7 +207,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setLastRuntime(\DateTime $lastRunTime) /* : void */ { @@ -234,7 +219,6 @@ abstract class TaskAbstract * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getStart() { @@ -249,7 +233,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setStart(\DateTime $start) /* : void */ { @@ -262,7 +245,6 @@ abstract class TaskAbstract * @return \DateTime * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getEnd() { @@ -277,7 +259,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setEnd(\DateTime $end) /* : void */ { @@ -290,7 +271,6 @@ abstract class TaskAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getAuthor() : string { @@ -305,7 +285,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setAuthor(string $author) /* : void */ { @@ -318,7 +297,6 @@ abstract class TaskAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getComment() : string { @@ -333,7 +311,6 @@ abstract class TaskAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setComment(string $comment) /* : void */ { @@ -346,7 +323,6 @@ abstract class TaskAbstract * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addResult(string $result) { diff --git a/Utils/TaskSchedule/TaskFactory.php b/Utils/TaskSchedule/TaskFactory.php index 7e44d9ba7..ebfba5f41 100644 --- a/Utils/TaskSchedule/TaskFactory.php +++ b/Utils/TaskSchedule/TaskFactory.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -25,8 +23,6 @@ use phpOMS\System\SystemType; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -44,7 +40,6 @@ final class TaskFactory * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function create(string $id = null, string $cmd = '') : TaskAbstract { diff --git a/Utils/TaskSchedule/TaskScheduler.php b/Utils/TaskSchedule/TaskScheduler.php index d5516d32c..8dcc8c25e 100644 --- a/Utils/TaskSchedule/TaskScheduler.php +++ b/Utils/TaskSchedule/TaskScheduler.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Validation\Base\DateTime; * * @category Framework * @package phpOMS\Utils\TaskSchedule - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -50,7 +46,6 @@ class TaskScheduler extends SchedulerAbstract * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ private function run(string $cmd) : string { @@ -87,7 +82,6 @@ class TaskScheduler extends SchedulerAbstract * @return string Normalized string for parsing * * @since 1.0.0 - * @author Dennis Eichhorn */ private function normalize(string $raw) : string { @@ -102,7 +96,6 @@ class TaskScheduler extends SchedulerAbstract * @return TaskAbstract Parsed job * * @since 1.0.0 - * @author Dennis Eichhorn */ private function parseJobList(array $jobData) : TaskAbstract { diff --git a/Utils/TestUtils.php b/Utils/TestUtils.php new file mode 100644 index 000000000..2bbb4f7c5 --- /dev/null +++ b/Utils/TestUtils.php @@ -0,0 +1,95 @@ +hasProperty($name)) { + return false; + } + + $reflectionProperty = $reflectionClass->getProperty($name); + + if (!($accessible = $reflectionProperty->isPublic())) { + $reflectionProperty->setAccessible(true); + } + + $reflectionProperty->setValue($obj, $value); + + if (!$accessible) { + $reflectionProperty->setAccessible(false); + } + + return true; + } + + /** + * Get private object member + * + * @param object $object Object to read + * @param string $name Member name to read + * + * @return mixed Returns the member variable value + * + * @since 1.0.0 + */ + public static function getMember(/* object */ $obj, string $name) + { + $reflectionClass = new \ReflectionClass(get_class($obj)); + + if(!$reflectionClass->hasProperty($name)) { + return null; + } + + $reflectionProperty = $reflectionClass->getProperty($name); + + if (!($accessible = $reflectionProperty->isPublic())) { + $reflectionProperty->setAccessible(true); + } + + $value = $reflectionProperty->getValue($obj); + + if (!$accessible) { + $reflectionProperty->setAccessible(false); + } + + return $value; + } +} diff --git a/Validation/Barcode/Barcode.php b/Validation/Barcode/Barcode.php index b225a6c9a..aa9c1bb55 100644 --- a/Validation/Barcode/Barcode.php +++ b/Validation/Barcode/Barcode.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/Barcode11.php b/Validation/Barcode/Barcode11.php index ea227ca97..adf3bd311 100644 --- a/Validation/Barcode/Barcode11.php +++ b/Validation/Barcode/Barcode11.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/Barcode128.php b/Validation/Barcode/Barcode128.php index 80cd676e8..cf437f923 100644 --- a/Validation/Barcode/Barcode128.php +++ b/Validation/Barcode/Barcode128.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/Barcode25.php b/Validation/Barcode/Barcode25.php index b810adff5..c9b2293c3 100644 --- a/Validation/Barcode/Barcode25.php +++ b/Validation/Barcode/Barcode25.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/Barcode39.php b/Validation/Barcode/Barcode39.php index ee51dec8e..dc1e2a8d6 100644 --- a/Validation/Barcode/Barcode39.php +++ b/Validation/Barcode/Barcode39.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/Barcode93.php b/Validation/Barcode/Barcode93.php index fa1089343..bcc8325ff 100644 --- a/Validation/Barcode/Barcode93.php +++ b/Validation/Barcode/Barcode93.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/BarcodeCodebar.php b/Validation/Barcode/BarcodeCodebar.php index 24277b588..ea3b2dc8d 100644 --- a/Validation/Barcode/BarcodeCodebar.php +++ b/Validation/Barcode/BarcodeCodebar.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/BarcodeDatamatrix.php b/Validation/Barcode/BarcodeDatamatrix.php index 578b93ba7..e0113f396 100644 --- a/Validation/Barcode/BarcodeDatamatrix.php +++ b/Validation/Barcode/BarcodeDatamatrix.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/BarcodeEAN.php b/Validation/Barcode/BarcodeEAN.php index f3bf49e89..9605072cf 100644 --- a/Validation/Barcode/BarcodeEAN.php +++ b/Validation/Barcode/BarcodeEAN.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/BarcodeMSI.php b/Validation/Barcode/BarcodeMSI.php index e98a1a05a..04561456f 100644 --- a/Validation/Barcode/BarcodeMSI.php +++ b/Validation/Barcode/BarcodeMSI.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Barcode/QrCode.php b/Validation/Barcode/QrCode.php index e59c127c3..2fdda33da 100644 --- a/Validation/Barcode/QrCode.php +++ b/Validation/Barcode/QrCode.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 diff --git a/Validation/Base/DateTime.php b/Validation/Base/DateTime.php index c53284a51..8f0e8cdb8 100644 --- a/Validation/Base/DateTime.php +++ b/Validation/Base/DateTime.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ use phpOMS\Validation\ValidatorAbstract; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ abstract class DateTime extends ValidatorAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -46,7 +41,7 @@ abstract class DateTime extends ValidatorAbstract /** * {@inheritdoc} */ - public static function isValid($value) : bool + public static function isValid($value, array $constraints = null) : bool { return (bool) strtotime($value); } diff --git a/Validation/Base/BIC.php b/Validation/Finance/BIC.php similarity index 69% rename from Validation/Base/BIC.php rename to Validation/Finance/BIC.php index 9a6b70a4a..5802fa04c 100644 --- a/Validation/Base/BIC.php +++ b/Validation/Finance/BIC.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Finance; use phpOMS\Validation\ValidatorAbstract; @@ -24,8 +22,6 @@ use phpOMS\Validation\ValidatorAbstract; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ class BIC extends ValidatorAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -46,7 +41,7 @@ class BIC extends ValidatorAbstract /** * {@inheritdoc} */ - public static function isValid($value) : bool + public static function isValid($value, array $constraints = null) : bool { return (bool) preg_match('/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i', $value); } diff --git a/Validation/Base/CreditCard.php b/Validation/Finance/CreditCard.php similarity index 84% rename from Validation/Base/CreditCard.php rename to Validation/Finance/CreditCard.php index 488512f96..4ed2c178f 100644 --- a/Validation/Base/CreditCard.php +++ b/Validation/Finance/CreditCard.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Finance; use phpOMS\Validation\ValidatorAbstract; @@ -24,8 +22,6 @@ use phpOMS\Validation\ValidatorAbstract; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ abstract class CreditCard extends ValidatorAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -46,7 +41,7 @@ abstract class CreditCard extends ValidatorAbstract /** * {@inheritdoc} */ - public static function isValid($value) : bool + public static function isValid($value, array $constraints = null) : bool { $value = preg_replace('/\D/', '', $value); @@ -82,7 +77,6 @@ abstract class CreditCard extends ValidatorAbstract * @return bool Returns true if the number is a valid credit card and false if it isn't. * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function luhnTest(string $num) : bool { diff --git a/Validation/Base/Iban.php b/Validation/Finance/Iban.php similarity index 87% rename from Validation/Base/Iban.php rename to Validation/Finance/Iban.php index 291ddc8a5..9095b3b87 100644 --- a/Validation/Base/Iban.php +++ b/Validation/Finance/Iban.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Finance; use phpOMS\Validation\ValidatorAbstract; @@ -25,8 +23,6 @@ use phpOMS\Validation\ValidatorAbstract; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ abstract class Iban extends ValidatorAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -49,9 +44,8 @@ abstract class Iban extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function isValid($value) : bool + public static function isValid($value, array $constraints = null) : bool { $value = str_replace(' ', '', strtolower($value)); $enumName = 'C_' . strtoupper(substr($value, 0, 2)); @@ -100,7 +94,6 @@ abstract class Iban extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function validateZeros(string $iban, string $layout) : bool { @@ -129,7 +122,6 @@ abstract class Iban extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function validateNumeric(string $iban, string $layout) : bool { @@ -157,7 +149,6 @@ abstract class Iban extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ private static function validateChecksum(string $iban) : bool { diff --git a/Validation/Base/IbanEnum.php b/Validation/Finance/IbanEnum.php similarity index 94% rename from Validation/Base/IbanEnum.php rename to Validation/Finance/IbanEnum.php index 917da45e9..3d2f2098e 100644 --- a/Validation/Base/IbanEnum.php +++ b/Validation/Finance/IbanEnum.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Finance; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Iban layout definition. * * @category Framework * @package phpOMS\Localization - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -58,7 +54,7 @@ class IbanEnum extends Enum /* public */ const C_GR = 'GRkk bbbs sssc cccc cccc cccc ccc'; /* public */ const C_GL = 'GLkk bbbb cccc cccc cc'; /* public */ const C_GT = 'GTkk bbbb mmtt cccc cccc cccc cccc'; - /* public */ const C_HU = 'HUkk bbbs sssk cccc cccc cccc cccx'; + /* public */ const C_HU = 'HUkk bbbs sssx cccc cccc cccc cccx'; /* public */ const C_IS = 'ISkk bbbb sscc cccc iiii iiii ii'; /* public */ const C_IE = 'IEkk aaaa bbbb bbcc cccc cc'; /* public */ const C_IL = 'ILkk bbbn nncc cccc cccc ccc'; diff --git a/Validation/Base/IbanErrorType.php b/Validation/Finance/IbanErrorType.php similarity index 72% rename from Validation/Base/IbanErrorType.php rename to Validation/Finance/IbanErrorType.php index e12201f89..9d54d9f6a 100644 --- a/Validation/Base/IbanErrorType.php +++ b/Validation/Finance/IbanErrorType.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,17 +13,15 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Finance; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * Iban error type enum. * * @category Framework * @package phpOMS\Datatypes - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 diff --git a/Validation/ModelValidationTrait.php b/Validation/ModelValidationTrait.php index 4d1850cf8..3bdc9c26b 100644 --- a/Validation/ModelValidationTrait.php +++ b/Validation/ModelValidationTrait.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -38,7 +36,6 @@ trait ModelValidationTrait * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setForce($var, $name) /* : void */ { @@ -60,7 +57,6 @@ trait ModelValidationTrait * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function isValid($var, $name) : bool { @@ -70,7 +66,6 @@ trait ModelValidationTrait } /** @noinspection PhpUndefinedFieldInspection */ - return Validator::isValid($var, self::$validation[$name]); } @@ -85,7 +80,6 @@ trait ModelValidationTrait * @throws \Exception * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function setValidation($var, $name) /* : void */ { diff --git a/Validation/Base/Email.php b/Validation/Network/Email.php similarity index 73% rename from Validation/Base/Email.php rename to Validation/Network/Email.php index 679e5a863..f474ac3e0 100644 --- a/Validation/Base/Email.php +++ b/Validation/Network/Email.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Network; use phpOMS\Validation\ValidatorAbstract; @@ -24,8 +22,6 @@ use phpOMS\Validation\ValidatorAbstract; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ class Email extends ValidatorAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -46,7 +41,7 @@ class Email extends ValidatorAbstract /** * {@inheritdoc} */ - public static function isValid(string $value) : bool + public static function isValid($value, array $constraints = null) : bool { if (filter_var($value, FILTER_VALIDATE_EMAIL) === false) { self::$msg = 'Invalid Email by filter_var standards'; diff --git a/Validation/Base/Hostname.php b/Validation/Network/Hostname.php similarity index 69% rename from Validation/Base/Hostname.php rename to Validation/Network/Hostname.php index 69794ae29..5d64b4c3b 100644 --- a/Validation/Base/Hostname.php +++ b/Validation/Network/Hostname.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Network; use phpOMS\Validation\ValidatorAbstract; @@ -24,8 +22,6 @@ use phpOMS\Validation\ValidatorAbstract; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ abstract class Hostname extends ValidatorAbstract * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct() { @@ -46,7 +41,7 @@ abstract class Hostname extends ValidatorAbstract /** * {@inheritdoc} */ - public static function isValid($value) : bool + public static function isValid($value, array $constraints = null) : bool { return filter_var(gethostbyname($value), FILTER_VALIDATE_IP) !== false; } diff --git a/Validation/Base/Ip.php b/Validation/Network/Ip.php similarity index 69% rename from Validation/Base/Ip.php rename to Validation/Network/Ip.php index fdc00dfc3..4a1788b9a 100644 --- a/Validation/Base/Ip.php +++ b/Validation/Network/Ip.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -15,7 +13,7 @@ */ declare(strict_types=1); -namespace phpOMS\Validation\Base; +namespace phpOMS\Validation\Network; use phpOMS\Validation\ValidatorAbstract; @@ -24,29 +22,26 @@ use phpOMS\Validation\ValidatorAbstract; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ -abstract class Ip extends ValidatorAbstract +class Ip extends ValidatorAbstract { /** * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ - public function __construct() + private function __construct() { } /** * {@inheritdoc} */ - public static function isValid($value) : bool + public static function isValid($value, array $constraints = null) : bool { return filter_var($value, FILTER_VALIDATE_IP) !== false; } diff --git a/Validation/Validator.php b/Validation/Validator.php index fbb2cf45f..ecb079c71 100644 --- a/Validation/Validator.php +++ b/Validation/Validator.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -38,11 +36,11 @@ final class Validator extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function isValid($var, array $constraints) : bool + public static function isValid($var, array $constraints = null) : bool { 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); @@ -63,7 +61,6 @@ final class Validator extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function isType($var, $constraint) : bool { @@ -90,7 +87,6 @@ final class Validator extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function hasLength(string $var, int $min = 0, int $max = PHP_INT_MAX) : bool { @@ -112,7 +108,6 @@ final class Validator extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function contains(string $var, $substr) : bool { @@ -128,7 +123,6 @@ final class Validator extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function matches(string $var, string $pattern) : bool { @@ -145,7 +139,6 @@ final class Validator extends ValidatorAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function hasLimit($var, $min = 0, $max = PHP_INT_MAX) : bool { diff --git a/Validation/ValidatorAbstract.php b/Validation/ValidatorAbstract.php index 7a9aeac77..4f4ef5d85 100644 --- a/Validation/ValidatorAbstract.php +++ b/Validation/ValidatorAbstract.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,13 +20,11 @@ namespace phpOMS\Validation; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ -abstract class ValidatorAbstract +abstract class ValidatorAbstract implements ValidatorInterface { /** @@ -62,4 +58,10 @@ abstract class ValidatorAbstract { return self::$error; } + + public static function resetError() /* : void */ + { + self::$error = 0; + self::$msg = ''; + } } diff --git a/Validation/ValidatorInterface.php b/Validation/ValidatorInterface.php index 3e74c1f3c..33589fdfb 100644 --- a/Validation/ValidatorInterface.php +++ b/Validation/ValidatorInterface.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -22,8 +20,6 @@ namespace phpOMS\Validation; * * @category Validation * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -35,13 +31,13 @@ interface ValidatorInterface * Check if value is valid. * * @param mixed $value Value to validate + * @param array $constraints Constraints for validation * * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function isValid($value); + public static function isValid($value, array $constraints = null); /** * Get most recent error string. @@ -49,7 +45,15 @@ interface ValidatorInterface * @return string * * @since 1.0.0 - * @author Dennis Eichhorn */ - public static function getMessage(); + public static function getMessage() : string; + + /** + * Get most recent error code. + * + * @return int + * + * @since 1.0.0 + */ + public static function getErrorCode() : int; } diff --git a/Version/Version.php b/Version/Version.php index 53af6b114..e202faf5d 100644 --- a/Version/Version.php +++ b/Version/Version.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -24,8 +22,6 @@ namespace phpOMS\Version; * * @category Version * @package Framework - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -37,7 +33,6 @@ class Version * Constructor. * * @since 1.0.0 - * @author Dennis Eichhorn */ private function __construct() { @@ -52,7 +47,6 @@ class Version * @return int * * @since 1.0.0 - * @author Dennis Eichhorn */ public static function compare(string $ver1, string $ver2) : int { diff --git a/Version/info.json b/Version/info.json deleted file mode 100644 index 3ae0f6919..000000000 --- a/Version/info.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "framework": "1.0.0", - "db": "1.0.0", - "db_mysql": "5.0.27", - "db_sqlite": "3.0.0", - "php": "5.4.0", - "fontawesome": "4.1.0", - "dthree": "3.4.11", - "jquery": "2.1.1" -} \ No newline at end of file diff --git a/Views/View.php b/Views/View.php index ef8e19c70..678ce9b3e 100644 --- a/Views/View.php +++ b/Views/View.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -21,14 +19,14 @@ use phpOMS\ApplicationAbstract; use phpOMS\Localization\Localization; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; +use phpOMS\Module\Exception\InvalidModuleException; +use phpOMS\Module\Exception\InvalidThemeException; /** * List view. * * @category Framework * @package phpOMS/Views - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 @@ -83,14 +81,13 @@ class View extends ViewAbstract * @param ResponseAbstract $response Request * * @since 1.0.0 - * @author Dennis Eichhorn */ public function __construct(ApplicationAbstract $app, RequestAbstract $request, ResponseAbstract $response) { $this->app = $app; $this->request = $request; $this->response = $response; - $this->l11n = $response->getL11n(); + $this->l11n = $response->getHeader()->getL11n(); } /** @@ -99,7 +96,6 @@ class View extends ViewAbstract * @return mixed * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getData(string $id) { @@ -113,7 +109,6 @@ class View extends ViewAbstract * @return void * * @since 1.0.0 - * @author Dennis Eichhorn */ public function setData(string $id, $data) /* : void */ { @@ -128,7 +123,6 @@ class View extends ViewAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function removeData(string $id) : bool { @@ -148,7 +142,6 @@ class View extends ViewAbstract * @return bool * * @since 1.0.0 - * @author Dennis Eichhorn */ public function addData(string $id, $data) : bool { @@ -170,10 +163,10 @@ class View extends ViewAbstract * * @return string * - * @throws \Exception + * @throws InvalidModuleException Throws this exception if no data for the defined module could be found. + * @throws InvalidTemplateException Throws this exception if no data for the defined theme could be found. * * @since 1.0.0 - * @author Dennis Eichhorn */ protected function getText(string $translation, string $module = null, string $theme = null) : string { @@ -181,7 +174,7 @@ class View extends ViewAbstract $match = '/Modules/'; if (($start = strripos($this->template, $match)) === false) { - throw new \Exception('Unknown Module'); + throw new InvalidModuleException($module); } $start = $start + strlen($match); @@ -193,7 +186,7 @@ class View extends ViewAbstract $match = '/Theme/'; if (($start = strripos($this->template, $match)) === false) { - throw new \Exception('Unknown Theme'); + throw new InvalidThemeException($theme); } $start = $start + strlen($match); @@ -204,11 +197,26 @@ class View extends ViewAbstract return $this->app->l11nManager->getText($this->l11n->getLanguage(), $module, $theme, $translation); } + /** + * Get translation. + * + * @param string $translation Text + * @param string $module Module name + * @param string $theme Theme name + * + * @return string + * + * @since 1.0.0 + */ + protected function getHtml(string $translation, string $module = null, string $theme = null) : string + { + return htmlspecialchars($this->getText($translation, $module, $theme)); + } + /** * @return RequestAbstract * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getRequest() : RequestAbstract { @@ -219,7 +227,6 @@ class View extends ViewAbstract * @return ResponseAbstract * * @since 1.0.0 - * @author Dennis Eichhorn */ public function getResponse() : ResponseAbstract { diff --git a/Views/ViewAbstract.php b/Views/ViewAbstract.php index 9a6362266..cf962f605 100644 --- a/Views/ViewAbstract.php +++ b/Views/ViewAbstract.php @@ -6,7 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 @@ -24,7 +23,6 @@ use phpOMS\System\File\PathException; * * @category Framework * @package phpOMS/Views - * @author OMS Development Team * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com @@ -52,8 +50,7 @@ abstract class ViewAbstract implements \Serializable /** * Constructor. * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function __construct() { @@ -67,8 +64,7 @@ abstract class ViewAbstract implements \Serializable * * @return int * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ private static function viewSort(array $a, array $b) : int { @@ -84,8 +80,7 @@ abstract class ViewAbstract implements \Serializable * * @return string * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function getTemplate() : string { @@ -99,8 +94,7 @@ abstract class ViewAbstract implements \Serializable * * @return void * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function setTemplate(string $template) /* : void */ { @@ -110,8 +104,7 @@ abstract class ViewAbstract implements \Serializable /** * @return View[] * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function getViews() : array { @@ -123,8 +116,7 @@ abstract class ViewAbstract implements \Serializable * * @return false|View * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function getView($id) { @@ -142,8 +134,7 @@ abstract class ViewAbstract implements \Serializable * * @return bool * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function removeView(string $id) : bool { @@ -165,8 +156,7 @@ abstract class ViewAbstract implements \Serializable * * @return void * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function editView(string $id, View $view, $order = null) /* : void */ { @@ -183,10 +173,9 @@ abstract class ViewAbstract implements \Serializable * * @return void * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ - public function addView(string $id, View $view, int $order = 0, bool $overwrite = true) : bool + public function addView(string $id, View $view, int $order = 0, bool $overwrite = true) : bool { if ($overwrite || !isset($this->views[$id])) { $this->views[$id] = $view; @@ -206,8 +195,7 @@ abstract class ViewAbstract implements \Serializable * * @return string|array * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function serialize() { @@ -223,8 +211,7 @@ abstract class ViewAbstract implements \Serializable * * @return array * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function toArray() : array { @@ -244,29 +231,35 @@ abstract class ViewAbstract implements \Serializable /** * Get view/template response. * - * @return string + * @return string|array * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ - public function render(...$data) : string + public function render(...$data) { - $path = __DIR__ . '/../..' . $this->template . '.tpl.php'; + $ob = ''; + + + $path = __DIR__ . '/../..' . $this->template . '.tpl.php'; if (!file_exists($path)) { throw new PathException($path); } - ob_start(); - /** @noinspection PhpIncludeInspection */ - $data = include $path; - $ob = ob_get_clean(); + try { + ob_start(); + /** @noinspection PhpIncludeInspection */ + $data = include $path; + $ob = ob_get_clean(); - if (is_array($data)) { - return $data; + if (is_array($data)) { + return $data; + } + } catch(\Throwable $e) { + $ob = ''; + } finally { + return $ob; } - - return $ob; } /** @@ -276,8 +269,7 @@ abstract class ViewAbstract implements \Serializable * * @return void * - * @since 1.0.0 - * @author Dennis Eichhorn + * @since 1.0.0 */ public function unserialize($raw) { diff --git a/Views/ViewLayout.php b/Views/ViewLayout.php index 7cfc79040..8cd5411ce 100644 --- a/Views/ViewLayout.php +++ b/Views/ViewLayout.php @@ -6,8 +6,6 @@ * * @category TBD * @package TBD - * @author OMS Development Team - * @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 @@ -17,15 +15,13 @@ declare(strict_types=1); namespace phpOMS\Views; -use phpOMS\Datatypes\Enum; +use phpOMS\Stdlib\Base\Enum; /** * View layout enum. * * @category Framework * @package phpOMS\Socket - * @author OMS Development Team - * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0