/** * Convert raw object into immutable Tag. * * @param string $body Raw body of the commit. * @param int $size Size of the body, optional. * @param string $hash SHA-1 hash of the full commit including header, optional. * @return Tag */ public static function fromRaw($body, $size = false, $hash = false) { list($headers, $message) = Commit::messageParser($body); return new self($headers['object'][0], $headers['type'][0], $headers['tag'][0], $headers['tagger'][0], $message, $size, $hash); }