diff --git a/composer.json b/composer.json index 50df9b8..d6e803b 100644 --- a/composer.json +++ b/composer.json @@ -1,25 +1,31 @@ { - "name": "malico/mobile-cm-php", - "description": "Get Telephone number's Mobile Network", - "license": "MIT", - "archive": { - "exclude": [ - "tests" - ] - }, - "authors": [ - { - "name": "Malico", - "email": "hi@malico.me" - } - ], - "autoload": { - "psr-4": { - "Malico\\MobileCM\\": "src/" - } - }, - "minimum-stability": "dev", - "require-dev": { - "pestphp/pest": "1.x-dev" - } + "name": "malico/mobile-cm-php", + "description": "Get Telephone number's Mobile Network", + "license": "MIT", + "archive": { + "exclude": [ + "tests" + ] + }, + "authors": [ + { + "name": "Malico", + "email": "hi@malico.me" + } + ], + "scripts": { + "test": [ + "php7.4 ./vendor/bin/pest", + "php8.0 ./vendor/bin/pest" + ] + }, + "autoload": { + "psr-4": { + "Malico\\MobileCM\\": "src/" + } + }, + "minimum-stability": "dev", + "require-dev": { + "pestphp/pest": "1.x-dev" + } } diff --git a/src/Network.php b/src/Network.php index 6830568..5c4a8b3 100644 --- a/src/Network.php +++ b/src/Network.php @@ -41,7 +41,7 @@ class Network * * @return bool */ - protected static function validLength($tel) : bool + protected static function validLength($tel): bool { $len = strlen($tel); @@ -60,7 +60,7 @@ protected static function validLength($tel) : bool * * @return bool */ - protected static function checkNumber(string | int $tel, $key) + protected static function checkNumber(string $tel, $key) { $tel = \str_replace(' ', '', (string) $tel); @@ -81,11 +81,11 @@ protected static function checkNumber(string | int $tel, $key) /** * Check if Number is Orange. * - * @param string | int $tel + * @param string $tel * * @return bool */ - public static function isOrange(string | int $tel) : bool + public static function isOrange(string $tel): bool { return self::checkNumber($tel, 'orange'); } @@ -93,11 +93,11 @@ public static function isOrange(string | int $tel) : bool /** * Check if Number is MTN. * - * @param string | int $tel + * @param string $tel * * @return bool */ - public static function isMTN(string | int $tel) : bool + public static function isMTN(string $tel): bool { return self::checkNumber($tel, 'mtn'); } @@ -105,11 +105,11 @@ public static function isMTN(string | int $tel) : bool /** * Check if Number is Nexttel. * - * @param string | int $tel + * @param string $tel * * @return bool */ - public static function isNexttel(string | int $tel) : bool + public static function isNexttel(string $tel): bool { return self::checkNumber($tel, 'nexttel'); } @@ -117,11 +117,11 @@ public static function isNexttel(string | int $tel) : bool /** * Check if Number is Camtel. * - * @param string | int $tel + * @param string $tel * * @return bool */ - public static function isCamtel(string | int $tel) : bool + public static function isCamtel(string $tel): bool { return self::checkNumber($tel, 'camtel'); } @@ -129,11 +129,11 @@ public static function isCamtel(string | int $tel) : bool /** * Match Number to Operator. * - * @param string | int $tel + * @param string $tel * * @return bool */ - public static function check($tel) : string | null + public static function check($tel): string { foreach (self::OPERATOR_PREFIXES as $key => $value) { if (self::checkNumber($tel, $key)) {