| 1 | <?php |
||
| 2 | |||
| 3 | namespace Azine\HybridAuthBundle\Services; |
||
| 4 | |||
| 5 | use Azine\HybridAuthBundle\Entity\UserContact; |
||
| 6 | |||
| 7 | class AzineContactSorter implements ContactSorter |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * In this default implementation, all the contacts are sorted in |
||
| 11 | * alphabetic order by their lastName. |
||
| 12 | * |
||
| 13 | * @param UserContact $a |
||
| 14 | * |
||
| 15 | 1 | * @return UserContact $b |
|
| 16 | 1 | */ |
|
| 17 | public function compare(UserContact $a, UserContact $b) |
||
| 18 | { |
||
| 19 | return strnatcasecmp($a->lastName, $b->lastName); |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 20 | } |
||
| 21 | } |
||
| 22 |