for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* PHP Billing Library
*
* @link https://github.com/hiqdev/php-billing
* @package php-billing
* @license BSD-3-Clause
* @copyright Copyright (c) 2017-2020, HiQDev (http://hiqdev.com/)
*/
namespace hiqdev\php\billing\formula;
use Exception;
use Throwable;
* Class FormulaEngineException.
* @author Dmytro Naumenko <[email protected]>
class FormulaEngineException extends Exception
{
* @var string
private $formula;
public static function fromException(Throwable $previous, string $formula, string $message = null): FormulaEngineException
if ($message !== null) {
$message .= ': ';
}
$message .= $previous->getMessage();
$exception = new static($message . ' : ' . $formula, 0, $previous);
$exception->formula = $formula;
return $exception;
public static function create(string $formula, string $message)
$exception = new static($message . ' : ' . $formula);
public function getFormula(): ?string
return $this->formula;