public function getCardType()
    {
        $number = str_replace(
            [' ', '-'],
            '',
            $this->number
        );

        foreach (static::$cardTypes as $type => $regex) {
            if (1 === preg_match($regex, $this->number)) {
                return $type;
            }
        }

        return 'Unknown';
    }
public function getCardType()
    {
        $number = str_replace(
            [' ', '-'],
            '',
            $this->number
        );

        foreach (static::$cardTypes as $type => $regex) {
            if (1 === preg_match($regex, $this->number)) {
                return $type;
            }
        }

        return 'Unknown';
    }
public function getCardType ( ) { $ number = str_replace ( [ ' ' , '-' ] , '' , $ this -> number ) ; foreach ( static :: $ cardTypes as $ type => $ regex ) { if ( 1 === preg_match ( $ regex , $ this -> number ) ) { return $ type ; } } return 'Unknown' ; }
Gets a card's type based on the BIN

@return string
Gets a card s type based on the BIN