| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | function backpack_avatar_url($user) |
||
| 29 | { |
||
| 30 | switch (config('backpack.base.avatar_type')) { |
||
| 31 | case 'gravatar': |
||
| 32 | return Gravatar::fallback('https://placehold.it/160x160/00a65a/ffffff/&text='.Auth::user()->name[0])->get($user->email); |
||
| 33 | break; |
||
|
|
|||
| 34 | |||
| 35 | case 'placehold': |
||
| 36 | return 'https://placehold.it/160x160/00a65a/ffffff/&text='.$user->name[0]; |
||
| 37 | break; |
||
| 38 | |||
| 39 | default: |
||
| 40 | return $user->{config('backpack.base.avatar_type')}; |
||
| 41 | break; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.