1<?php declare(strict_types=1); 2 3namespace ILIAS\MainMenu\Storage\Revision; 4 5use DateTimeImmutable; 6use ILIAS\MainMenu\Storage\Identification\ResourceIdentification; 7use ILIAS\MainMenu\Storage\Information\FileInformation; 8use ILIAS\MainMenu\Storage\Information\Information; 9 10/** 11 * Class NullRevision 12 * 13 * @author Fabian Schmid <fs@studer-raimann.ch> 14 */ 15class NullRevision implements Revision 16{ 17 18 /** 19 * @var ResourceIdentification 20 */ 21 private $identification; 22 23 24 /** 25 * NullRevision constructor. 26 * 27 * @param ResourceIdentification $identification 28 */ 29 public function __construct(ResourceIdentification $identification) 30 { 31 $this->identification = $identification; 32 } 33 34 35 /** 36 * @inheritDoc 37 */ 38 public function getIdentification() : ResourceIdentification 39 { 40 return $this->identification; 41 } 42 43 44 /** 45 * @inheritDoc 46 */ 47 public function getVersionNumber() : int 48 { 49 return 0; 50 } 51 52 53 /** 54 * @inheritDoc 55 */ 56 public function getCreationDate() : DateTimeImmutable 57 { 58 return new DateTimeImmutable(); 59 } 60 61 62 /** 63 * @inheritDoc 64 */ 65 public function getInformation() : Information 66 { 67 return new FileInformation(); 68 } 69 70 71 public function setInformation(Information $information) 72 { 73 } 74 75 76 public function setUnavailable() : void 77 { 78 // do nothing 79 } 80 81 82 /** 83 * @inheritDoc 84 */ 85 public function isAvailable() : bool 86 { 87 return false; 88 } 89} 90