diff --git a/Datatypes/AddressType.php b/Datatypes/AddressType.php index bef7a8cf1..0938c5ae9 100644 --- a/Datatypes/AddressType.php +++ b/Datatypes/AddressType.php @@ -35,4 +35,6 @@ abstract class AddressType extends Enum /* public */ const SHIPPING = 3; /* public */ const BILLING = 4; /* public */ const WORK = 5; + /* public */ const CONTRACT = 6; + /* public */ const OTHER = 7; } diff --git a/Datatypes/Enum.php b/Datatypes/Enum.php index a83f067b5..9db193d39 100644 --- a/Datatypes/Enum.php +++ b/Datatypes/Enum.php @@ -140,4 +140,17 @@ abstract class Enum return defined('static::' . $name); } + /** + * Count enum variables + * + * @return int + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public static function count() : int + { + return count(self::getConstants()); + } + } diff --git a/Utils/ColorUtils.php b/Utils/ColorUtils.php index 654434161..a6f3ce7e7 100644 --- a/Utils/ColorUtils.php +++ b/Utils/ColorUtils.php @@ -84,9 +84,19 @@ class ColorUtils return $gradient; } + /** + * Convert int to rgb + * + * @param int $rgbInt Value to convert + * + * @return array + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public static function intToRgb(int $rgbInt) : array { - $rgb = []; + $rgb = ['r' => 0, 'g' => 0, 'b' => 0]; $rgb['b'] = $rgbInt & 255; $rgb['g'] = ($rgbInt >> 8) & 255; diff --git a/Utils/RnG/Country.php b/Utils/RnG/Country.php deleted file mode 100644 index 43213144f..000000000 --- a/Utils/RnG/Country.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\Utils\RnG; - -class Country -{ -} diff --git a/Utils/RnG/Currency.php b/Utils/RnG/Currency.php deleted file mode 100644 index 956453f34..000000000 --- a/Utils/RnG/Currency.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\Utils\RnG; - -class Currency -{ -}