mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Doctrine\Migrations;
|
||||
|
||||
use Doctrine\Migrations\Version\Comparator;
|
||||
use Doctrine\Migrations\Version\Version;
|
||||
|
||||
use function strcmp;
|
||||
use function explode;
|
||||
use function strcmp;
|
||||
|
||||
/**
|
||||
* Compare Version classes names from different namespaces and order them.
|
||||
@@ -15,18 +22,15 @@ use function explode;
|
||||
*/
|
||||
final class VersionComparator implements Comparator
|
||||
{
|
||||
public function compare(Version $a, Version $b): int
|
||||
{
|
||||
return strcmp($this->getNumber($a), $this->getNumber($b));
|
||||
}
|
||||
|
||||
private function getNumber(Version $version): string
|
||||
{
|
||||
$names = explode("\\", (string) $version);
|
||||
$names = explode('\\', (string) $version);
|
||||
|
||||
return end($names);
|
||||
}
|
||||
|
||||
public function compare(Version $a, Version $b): int
|
||||
{
|
||||
$q = strcmp($this->getNumber($a), $this->getNumber($b));
|
||||
|
||||
return $q;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user