for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FigTree\Exceptions;
use DomainException as PHPDomainException;
use FigTree\Exceptions\Concerns\HasSeverity;
use FigTree\Exceptions\Contracts\{
SevereExceptionInterface,
LocatableExceptionInterface,
};
/**
* Exception thrown if a value does not adhere to a defined valid data domain.
*/
class DomainException extends PHPDomainException implements SevereExceptionInterface, LocatableExceptionInterface
{
use HasSeverity;
* If required, set the file and line where the Exception was thrown.
*
* @param string $file
* @param int $line
* @return $this
public function onFileLine(string $file, int $line): LocatableExceptionInterface
if (file_exists($file)) {
$this->file = $file;
$this->line = max(0, $line);
}
return $this;