Conditions | 3 |
Paths | 1 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php namespace Arcanedev\Breadcrumbs\Entities; |
||
58 | 28 | private function order() |
|
59 | { |
||
60 | 28 | $count = $this->count(); |
|
61 | |||
62 | $this->map(function (BreadcrumbItem $crumb, $key) use ($count) { |
||
63 | 28 | $crumb->resetPosition(); |
|
64 | |||
65 | 28 | if ($key === 0) |
|
66 | 28 | $crumb->setFirst(); |
|
67 | |||
68 | 28 | if ($key === ($count - 1)) |
|
69 | 28 | $crumb->setLast(); |
|
70 | |||
71 | 28 | return $crumb; |
|
72 | 28 | }); |
|
73 | |||
74 | 28 | return $this; |
|
75 | } |
||
76 | } |
||
77 |