Yeelight /
cloud2
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Created by PhpStorm. |
||
| 4 | * User: sheldon |
||
| 5 | * Date: 18-3-27 |
||
| 6 | * Time: 下午5:30. |
||
| 7 | */ |
||
| 8 | |||
| 9 | namespace Yeelight\Exceptions; |
||
| 10 | |||
| 11 | use Illuminate\Support\MessageBag; |
||
| 12 | use Illuminate\Support\ViewErrorBag; |
||
| 13 | |||
| 14 | class BackendHandler |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Render exception. |
||
| 18 | * |
||
| 19 | * @param \Exception $exception |
||
| 20 | * |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | public static function renderException(\Exception $exception) |
||
| 24 | { |
||
| 25 | $error = new MessageBag([ |
||
| 26 | 'type' => get_class($exception), |
||
| 27 | 'message' => $exception->getMessage(), |
||
| 28 | 'file' => $exception->getFile(), |
||
| 29 | 'line' => $exception->getLine(), |
||
| 30 | ]); |
||
| 31 | |||
| 32 | $errors = new ViewErrorBag(); |
||
| 33 | $errors->put('exception', $error); |
||
| 34 | |||
| 35 | return view('backend.partials.exception', compact('errors'))->render(); |
||
|
0 ignored issues
–
show
|
|||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Flash a error message to content. |
||
| 40 | * |
||
| 41 | * @param string $title |
||
| 42 | * @param string $message |
||
| 43 | * |
||
| 44 | * @return mixed |
||
| 45 | */ |
||
| 46 | public static function error($title = '', $message = '') |
||
| 47 | { |
||
| 48 | $error = new MessageBag(compact('title', 'message')); |
||
| 49 | |||
| 50 | return session()->flash('error', $error); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.