public function format($my_number = '', $my_format = '')
    {
        if (empty($my_number)) {
            return NULL;
        }
        try {
            $phoneNumber = new PhoneNumber();
            $phoneNumber->setDebugStatus($this->DEBUG);
            $phoneNumber->setLoggerPath($this->loggerPath);
            $phoneNumber->__construct();
            $result = $phoneNumber->format(trim($my_number), trim($my_format));
            $this->_debug->info(__FUNCTION__, 'Result: ' . $result);

            return $result;
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            if (function_exists('log_message')) {
                log_message('error', $message);
            }
            $this->_debug->error(__FUNCTION__, $message);

            return $my_number;
        }
    }
public function format($my_number = '', $my_format = '')
    {
        if (empty($my_number)) {
            return NULL;
        }
        try {
            $phoneNumber = new PhoneNumber();
            $phoneNumber->setDebugStatus($this->DEBUG);
            $phoneNumber->setLoggerPath($this->loggerPath);
            $phoneNumber->__construct();
            $result = $phoneNumber->format(trim($my_number), trim($my_format));
            $this->_debug->info(__FUNCTION__, 'Result: ' . $result);

            return $result;
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            if (function_exists('log_message')) {
                log_message('error', $message);
            }
            $this->_debug->error(__FUNCTION__, $message);

            return $my_number;
        }
    }
public function format ( $ my_number = '' , $ my_format = '' ) { if ( empty ( $ my_number ) ) { return NULL ; } try { $ phoneNumber = new PhoneNumber ( ) ; $ phoneNumber -> setDebugStatus ( $ this -> DEBUG ) ; $ phoneNumber -> setLoggerPath ( $ this -> loggerPath ) ; $ phoneNumber -> __construct ( ) ; $ result = $ phoneNumber -> format ( trim ( $ my_number ) , trim ( $ my_format ) ) ; $ this -> _debug -> info ( __FUNCTION__ , 'Result: ' . $ result ) ; return $ result ; } catch ( \ Exception $ e ) { $ message = 'Error File: ' . $ e -> getFile ( ) . ' - Line: ' . $ e -> getLine ( ) . ' - Code: ' . $ e -> getCode ( ) . ' - Message: ' . $ e -> getMessage ( ) ; if ( function_exists ( 'log_message' ) ) { log_message ( 'error' , $ message ) ; } $ this -> _debug -> error ( __FUNCTION__ , $ message ) ; return $ my_number ; } }
Function format - Format Phone Number

@author: 713uk13m <dev@nguyenanhung.com>
@time  : 9/28/18 13:40

@param string $my_number
@param string $my_format

@return mixed|null|string
@throws \Exception
Function format - Format Phone Number