for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the box project.
*
* (c) Kevin Herrera <[email protected]>
* Théo Fidry <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace KevinGH\Box\Exception;
/**
* Provides additional functional to the Exception class.
* @author Kevin Herrera <[email protected]>
class Exception extends \Exception implements ExceptionInterface
{
* Creates a new exception using a format and values.
* @param string $format the format
* @param mixed $value,... The value(s).
* @return Exception the exception
public static function create($format, $value = null)
if (0 < func_num_args()) {
$format = vsprintf($format, array_slice(func_get_args(), 1));
}
return new static($format);
* Creates an exception for the last error message.
public static function lastError()
$error = error_get_last();
return new static($error['message']);