for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FigTree\Exceptions;
use OutOfRangeException as PHPOutOfRangeException;
use FigTree\Exceptions\Concerns\HasSeverity;
use FigTree\Exceptions\Contracts\{
SevereExceptionInterface,
LocatableExceptionInterface,
};
/**
* Exception thrown when an illegal index was requested. This represents errors that should be detected at compile time.
*/
class OutOfRangeException extends PHPOutOfRangeException 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;