Skip to content

Commit

Permalink
Match doc of exception handler contract and its implementations (#30920)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Dec 24, 2019
1 parent 7924520 commit 61ea9fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Contracts/Debug/ExceptionHandler.php
Expand Up @@ -11,6 +11,8 @@ interface ExceptionHandler
*
* @param \Exception $e
* @return void
*
* @throws \Exception
*/
public function report(Exception $e);

Expand All @@ -28,6 +30,8 @@ public function shouldReport(Exception $e);
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception
*/
public function render($request, Exception $e);

Expand Down
8 changes: 5 additions & 3 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Expand Up @@ -93,7 +93,7 @@ public function __construct(Container $container)
* Report or log an exception.
*
* @param \Exception $e
* @return mixed
* @return void
*
* @throws \Exception
*/
Expand Down Expand Up @@ -178,11 +178,13 @@ protected function context()
}

/**
* Render an exception into a response.
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception
*/
public function render($request, Exception $e)
{
Expand Down
Expand Up @@ -82,10 +82,12 @@ public function __construct($originalHandler, $except = [])
}

/**
* Report the given exception.
* Report or log an exception.
*
* @param \Exception $e
* @return void
*
* @throws \Exception
*/
public function report(Exception $e)
{
Expand All @@ -104,13 +106,12 @@ public function shouldReport(Exception $e)
}

/**
* Render the given exception.
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return mixed
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @throws \Exception
*/
public function render($request, Exception $e)
Expand All @@ -131,7 +132,7 @@ public function render($request, Exception $e)
}

/**
* Render the exception for the console.
* Render an exception to the console.
*
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Exception $e
Expand Down

0 comments on commit 61ea9fc

Please sign in to comment.