Skip to content

Commit d8f30dd

Browse files
authored
Merge pull request #272 from bozhinov/master
* no need for ctype ext
2 parents 70a8c9a + 752c5d4 commit d8f30dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/MenuStyle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public function getDisabledItemText(string $text) : string
307307
*/
308308
private function getForegroundColourCode(bool $bright = false) : string
309309
{
310-
if (!ctype_digit($this->fg)) {
310+
if (!is_numeric($this->fg)) {
311311
$fgCode = (int)self::$availableForegroundColors[$this->fg];
312312
$fgCode += ($bright ? 60 : 0);
313313
} else {
@@ -326,7 +326,7 @@ private function getForegroundColourCode(bool $bright = false) : string
326326
*/
327327
private function getBackgroundColourCode(bool $bright = false) : string
328328
{
329-
if (!ctype_digit($this->bg)) {
329+
if (!is_numeric($this->bg)) {
330330
$bgCode = (int)self::$availableBackgroundColors[$this->bg];
331331
$bgCode += ($bright ? 60 : 0);
332332
} else {
@@ -809,7 +809,7 @@ public function getBorderColour() : string
809809

810810
public function getBorderColourCode() : string
811811
{
812-
if (!ctype_digit($this->borderColour)) {
812+
if (!is_numeric($this->borderColour)) {
813813
$borderColourCode = self::$availableBackgroundColors[$this->borderColour];
814814
} else {
815815
$borderColourCode = sprintf("48;5;%s", $this->borderColour);

src/Util/ColourUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public static function map256To8(int $colourCode) : string
309309
*/
310310
public static function validateColour(Terminal $terminal, string $colour, string $fallback = null) : string
311311
{
312-
if (!ctype_digit($colour)) {
312+
if (!is_numeric($colour)) {
313313
return self::validateColourName($colour);
314314
}
315315

0 commit comments

Comments
 (0)