refactoring for dependency injection and testability.

This commit is contained in:
Taylor Otwell
2011-08-25 22:53:05 -05:00
parent 0b86c94551
commit 1e7850d9ba
75 changed files with 1441 additions and 1461 deletions

View File

@@ -11,6 +11,13 @@ class Examiner {
*/
public $exception;
/**
* The file manager instance.
*
* @var File
*/
private $file;
/**
* Human-readable error levels and descriptions.
*
@@ -35,12 +42,14 @@ class Examiner {
/**
* Create a new exception examiner instance.
*
* @param Exception $e
* @param Exception $exception
* @param File $file
* @return void
*/
public function __construct($e)
public function __construct($exception, File $file)
{
$this->exception = $e;
$this->exception = $exception;
$this->file = $file;
}
/**
@@ -80,7 +89,7 @@ class Examiner {
*/
public function context()
{
return File::snapshot($this->exception->getFile(), $this->exception->getLine());
return $this->file->snapshot($this->exception->getFile(), $this->exception->getLine());
}
/**