AzineContactSorter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 2
b 0
f 0
dl 0
loc 13
rs 10
ccs 2
cts 2
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A compare() 0 3 1
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