/** * {@inheritdoc} * * @param Migrated $versions * * @return int * * @throws StorageException */ public function saveCollection(Migrated $versions) { $ids = array_map(function (VersionInterface $v) { return $v->getId(); }, $versions->toArray()); $contents = implode("\n", $ids); $result = $this->file->put($contents); if ($result === false) { throw new StorageException(sprintf('Could not write to file "%s".', $this->file->getPath())); } return (bool) $result; }