/** * Checks if file is modified by some other user * * @param FileInterface $entity * @param string $hash * @throws FileHashChangedException */ protected function checksum(FileInterface $entity) { $currentHash = $this->fileManager->checksumTemporaryFileByName($entity->getName()); if ($entity->getHash() !== $currentHash) { throw new FileHashChangedException($entity->getName()); } }