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

VersionSorter::sort()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 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