| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function __construct(User $user = null) |
||
| 19 | { |
||
| 20 | if (is_null($user)) { |
||
| 21 | return; |
||
| 22 | } |
||
| 23 | |||
| 24 | if ($user->hasFees()) { |
||
| 25 | $this->problems[] = sprintf('Brukeren har %d,- i utestående gebyr i Alma.', $user->fees); |
||
| 26 | } |
||
| 27 | if (count($user->blocks)) { |
||
| 28 | $msgs = array_values(array_map( |
||
| 29 | function ($b) { |
||
| 30 | return Arr::get($b, 'block_description.desc'); |
||
| 31 | }, |
||
| 32 | $user->blocks |
||
| 33 | )); |
||
| 34 | $this->problems[] = sprintf( |
||
| 35 | 'Brukeren har følgende merknader: <ul><li>%s</li></ul>', |
||
| 36 | implode('</li><li>', $msgs) |
||
| 37 | ); |
||
| 70 |