getKnownVersions() public method

Returns all versions known to the manager.
public getKnownVersions ( ) : string[]
return string[] The known version strings
Esempio n. 1
0
 /**
  * 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');
     }
 }
Esempio n. 2
0
 public function testGetKnownVersionsWithoutMigrations()
 {
     $this->manager = new MigrationManager(array(), $this->versioner);
     $this->assertSame(array(), $this->manager->getKnownVersions());
 }