extension = $extension; } /** * @param string $namespace * @return string */ public function generateClassName(string $namespace) : string { return $namespace . '\\Version' . $this->generateVersionNumber(); } /** * @return string */ private function generateVersionNumber() : string { $now = new DateTimeImmutable('now', new DateTimeZone('UTC')); $version = $now->format(self::VERSION_FORMAT); $intHash = (string) crc32($this->extension->getId()); $intHash = substr($intHash,0,4); return $version.$intHash.'_'.$this->extension->getId(); } }