Applied fixes from StyleCI

This commit is contained in:
Sujit Prasad
2016-02-24 10:17:53 -05:00
committed by StyleCI Bot
parent 5063ce6185
commit 915bb9d084
4 changed files with 23 additions and 100 deletions

View File

@@ -4,7 +4,6 @@ namespace App\Exceptions;
// controller
use App\Http\Controllers\Common\PhpMailController;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
@@ -19,11 +18,11 @@ class Handler extends ExceptionHandler
'Symfony\Component\HttpKernel\Exception\HttpException',
];
/**
* Create a new controller instance.
* constructor to check
* 1. php mailer
* 1. php mailer.
*
* @return void
*/
public function __construct(PhpMailController $PhpMailController)
@@ -31,7 +30,6 @@ class Handler extends ExceptionHandler
$this->PhpMailController = $PhpMailController;
}
/**
* Report or log an exception.
*
@@ -50,7 +48,7 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
@@ -58,7 +56,6 @@ class Handler extends ExceptionHandler
{
if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
} elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
}
@@ -71,10 +68,11 @@ class Handler extends ExceptionHandler
// checking if the application is installed
if (\Config::get('database.install') == 1) {
// checking if the error log send to Ladybirdweb is enabled or not
if(\Config::get('app.ErrorLog') == '%1%') {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario'=>'error-report'], $template_variables = ['e' => $e]);
if (\Config::get('app.ErrorLog') == '%1%') {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario' => 'error-report'], $template_variables = ['e' => $e]);
}
}
return response()->view('errors.500', []);
}
}
@@ -95,8 +93,10 @@ class Handler extends ExceptionHandler
}
/**
* function to generate oops error page
* function to generate oops error page.
*
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
protected function renderExceptionWithWhoops(Exception $e)