Returns all versions known to the manager.
public getKnownVersions ( ) : string[] | ||
Résultat | string[] | The known version strings |
/** * Creates the converter. * * @param JsonConverter $innerConverter The decorated converter * @param string $currentVersion The version that the decorated * converter is compatible with * @param MigrationManager $migrationManager The manager for migrating JSON data */ public function __construct(JsonConverter $innerConverter, $currentVersion, MigrationManager $migrationManager) { $this->innerConverter = $innerConverter; $this->migrationManager = $migrationManager; $this->currentVersion = $currentVersion; $this->knownVersions = $this->migrationManager->getKnownVersions(); if (!in_array($currentVersion, $this->knownVersions, true)) { $this->knownVersions[] = $currentVersion; usort($this->knownVersions, 'version_compare'); } }
public function testGetKnownVersionsWithoutMigrations() { $this->manager = new MigrationManager(array(), $this->versioner); $this->assertSame(array(), $this->manager->getKnownVersions()); }