Conditions | 4 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function boot() |
||
17 | { |
||
18 | Validator::extend('youtube_url', function ($attribute, $value, $parameters, $validator) { |
||
19 | |||
20 | $urlParts = [ |
||
21 | 'scheme', |
||
22 | 'host', |
||
23 | 'path', |
||
24 | 'query', |
||
25 | ]; |
||
26 | |||
27 | if ($url = parse_url($value)) { |
||
28 | if (count(array_diff($urlParts, array_keys($url))) == 0) { |
||
29 | return $url['host'] === 'youtube.com' || $url['host'] === 'www.youtube.com'; |
||
30 | } |
||
31 | } |
||
32 | return false; |
||
33 | }); |
||
34 | |||
35 | view()->composer('layouts.side_nav', 'LearnParty\Http\Composers\SideNavComposer'); |
||
36 | } |
||
37 | |||
48 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.