AzineContactSorter::compare()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
rs 10
ccs 0
cts 0
cp 0
cc 1
nc 1
nop 2
crap 2
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
The expression return strnatcasecmp($a->lastName, $b->lastName) returns the type integer which is incompatible with the documented return type Azine\HybridAuthBundle\Entity\UserContact.
Loading history...
20
    }
21
}
22