Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function gate(callable $callback) |
||
16 | { |
||
17 | $di = $this->app['di']; |
||
18 | |||
19 | if(!method_exists(policy(),Route::getRouteControllerMethod())){ |
||
20 | $directly = true; |
||
21 | } |
||
22 | |||
23 | if(isset($directly) || $di(policy(),Route::getRouteControllerMethod())){ |
||
24 | return call_user_func($callback); |
||
25 | } |
||
26 | |||
27 | exception()->badMethodCall('policy error'); |
||
28 | } |
||
29 | } |