Completed
Branch master (657555)
by Julien
02:11
created

VersionSorter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A sort() 0 11 1
1
<?php
2
3
/*
4
 * This file is part of semver/semver.
5
 *
6
 * (c) SemVer <https://github.com/git-pull-request>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace SemVer\SemVer;
15
16
/**
17
 * Sort multiple Version objects.
18
 */
19
final class VersionSorter
0 ignored issues
show
Coding Style introduced by
VersionSorter does not seem to conform to the naming convention (Utils?$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
20
{
21
    /**
22
     * @param array $versions
23
     *
24
     * @return array
25
     */
26
    public static function sort(array $versions) : array
27
    {
28
        usort(
29
            $versions,
30
            function (Version $a, Version $b) {
31
                return VersionComparator::compare($a, $b);
32
            }
33
        );
34
35
        return $versions;
36
    }
37
}
38