src/lib/Phine/Exception/Exception.php
public static function createUsingFormat($format)
    {
        $previous = null;

        if (1 < func_num_args()) {
            $args = array_slice(func_get_args(), 1);

            // extract $previous exception
            if (end($args) instanceof \Exception) {
                $previous = array_pop($args);
            }

            if ($args) {
                $format = vsprintf($format, $args);
            }
        }

        return new static($format, 0, $previous);
    }
public static function createUsingFormat($format)
    {
        $previous = null;

        if (1 < func_num_args()) {
            $args = array_slice(func_get_args(), 1);

            // extract $previous exception
            if (end($args) instanceof \Exception) {
                $previous = array_pop($args);
            }

            if ($args) {
                $format = vsprintf($format, $args);
            }
        }

        return new static($format, 0, $previous);
    }
public static function createUsingFormat ( $ format ) { $ previous = null ; if ( 1 < func_num_args ( ) ) { $ args = array_slice ( func_get_args ( ) , 1 ) ; // extract $previous exception if ( end ( $ args ) instanceof \ Exception ) { $ previous = array_pop ( $ args ) ; } if ( $ args ) { $ format = vsprintf ( $ format , $ args ) ; } } return new static ( $ format , 0 , $ previous ) ; }
Creates a new exception using a formatted message.

A new exception is created after formatting the given arguments using
`vsprintf()`. If the last argument is an instance of the `Exception`
class, it will be used as the `$previous` exception in the new one
that is created.

@param string     $format    The message format.
@param mixed      $value,... A value to format.
@param \Exception $previous  A previous exception.

@return Exception The new exception.
Creates a new exception using a formatted message .