id = $id; $this->public = $public; $this->private = 2 > \func_num_args(); $this->deprecated = \false; } public function isPublic() { return $this->public; } public function setPublic($boolean) { $this->public = (bool) $boolean; $this->private = \false; return $this; } public function setPrivate($boolean) { $this->private = (bool) $boolean; return $this; } public function isPrivate() { return $this->private; } public function setDeprecated($status = \true, $template = null) { if (null !== $template) { if (\preg_match('#[\\r\\n]|\\*/#', $template)) { throw new InvalidArgumentException('Invalid characters found in deprecation template.'); } if (!\str_contains($template, '%alias_id%')) { throw new InvalidArgumentException('The deprecation template must contain the "%alias_id%" placeholder.'); } $this->deprecationTemplate = $template; } $this->deprecated = (bool) $status; return $this; } public function isDeprecated() : bool { return $this->deprecated; } public function getDeprecationMessage(string $id) : string { return \str_replace('%alias_id%', $id, $this->deprecationTemplate ?: self::DEFAULT_DEPRECATION_TEMPLATE); } public function __toString() { return $this->id; } }