1 | <?php |
||
10 | trait Reauthenticates |
||
11 | { |
||
12 | /** |
||
13 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
14 | */ |
||
15 | public function getReauthenticate() |
||
19 | |||
20 | /** |
||
21 | * Handle the reauthentication request to the application. |
||
22 | * |
||
23 | * @param \Illuminate\Http\Request $request |
||
24 | * |
||
25 | * @return \Illuminate\Http\Response |
||
26 | */ |
||
27 | public function postReauthenticate(Request $request) |
||
44 | |||
45 | /** |
||
46 | * Get the failed login message. |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | protected function getFailedLoginMessage() |
||
56 | } |
||
57 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.