mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix folder name
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Doctrine\Migrations;
|
||||
|
||||
use Doctrine\Migrations\Version\Comparator;
|
||||
use Doctrine\Migrations\Version\Version;
|
||||
|
||||
use function strcmp;
|
||||
use function explode;
|
||||
|
||||
/**
|
||||
* Compare Version classes names from different namespaces and order them.
|
||||
*
|
||||
* Version are compared on the date's class.
|
||||
*/
|
||||
final class VersionComparator implements Comparator
|
||||
{
|
||||
private function getNumber(Version $version): string
|
||||
{
|
||||
$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