setName(null); } else { parent::__construct($name, $namespace); } } /** * @deprecated */ public function setClass(): static { trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED); $this->type = self::TYPE_CLASS; return $this; } public function isClass(): bool { return $this->type === self::TYPE_CLASS; } /** * @deprecated create object using 'new Nette\PhpGenerator\InterfaceType' */ public function setInterface(): static { trigger_error(__METHOD__ . "() is deprecated, create object using 'new Nette\\PhpGenerator\\InterfaceType'", E_USER_DEPRECATED); $this->type = self::TYPE_INTERFACE; return $this; } public function isInterface(): bool { return $this->type === self::TYPE_INTERFACE; } /** * @deprecated create object using 'new Nette\PhpGenerator\TraitType' */ public function setTrait(): static { trigger_error(__METHOD__ . "() is deprecated, create object using 'new Nette\\PhpGenerator\\TraitType'", E_USER_DEPRECATED); $this->type = self::TYPE_TRAIT; return $this; } public function isTrait(): bool { return $this->type === self::TYPE_TRAIT; } /** * @deprecated create object using 'new Nette\PhpGenerator\InterfaceType' or 'TraitType' */ public function setType(string $type): static { $upper = ucfirst($type); trigger_error(__METHOD__ . "() is deprecated, create object using 'new Nette\\PhpGenerator\\{$upper}Type'", E_USER_DEPRECATED); if (!in_array($type, [self::TYPE_CLASS, self::TYPE_INTERFACE, self::TYPE_TRAIT], true)) { throw new Nette\InvalidArgumentException('Argument must be class|interface|trait.'); } $this->type = $type; return $this; } /** * @deprecated */ public function getType(): string { return $this->type; } public function setFinal(bool $state = true): static { $this->final = $state; return $this; } public function isFinal(): bool { return $this->final; } public function setAbstract(bool $state = true): static { $this->abstract = $state; return $this; } public function isAbstract(): bool { return $this->abstract; } public function setReadOnly(bool $state = true): static { $this->readOnly = $state; return $this; } public function isReadOnly(): bool { return $this->readOnly; } public function setExtends(?string $name): static { if ($name) { $this->validateNames([$name]); } $this->extends = $name; return $this; } public function getExtends(): ?string { return $this->extends; } /** * @param string[] $names */ public function setImplements(array $names): static { $this->validateNames($names); $this->implements = $names; return $this; } /** * @return string[] */ public function getImplements(): array { return $this->implements; } public function addImplement(string $name): static { $this->validateNames([$name]); $this->implements[] = $name; return $this; } public function removeImplement(string $name): static { $this->implements = array_diff($this->implements, [$name]); return $this; } public function addMember(Method|Property|Constant|TraitUse $member): static { $name = $member->getName(); [$type, $n] = match (true) { $member instanceof Constant => ['consts', $name], $member instanceof Method => ['methods', strtolower($name)], $member instanceof Property => ['properties', $name], $member instanceof TraitUse => ['traits', $name], }; if (isset($this->$type[$n])) { throw new Nette\InvalidStateException("Cannot add member '$name', because it already exists."); } $this->$type[$n] = $member; return $this; } /** * @throws Nette\InvalidStateException */ public function validate(): void { $name = $this->getName(); if ($name === null && ($this->abstract || $this->final)) { throw new Nette\InvalidStateException('Anonymous class cannot be abstract or final.'); } elseif ($this->abstract && $this->final) { throw new Nette\InvalidStateException("Class '$name' cannot be abstract and final at the same time."); } } public function __clone() { $clone = fn($item) => clone $item; $this->consts = array_map($clone, $this->consts); $this->methods = array_map($clone, $this->methods); $this->properties = array_map($clone, $this->properties); $this->traits = array_map($clone, $this->traits); } } __halt_compiler();----SIGNATURE:----rXXfXTtuulzXKW5jt3riU8Uaj0HPUe3XP8yARYmz89EjGVJVcWEriBfi+oxuNHY90F3zwSkZU4ILMRwwLDfOMAaMzBwfWyjTxhPitSw8u2YNuDzUfznMFkgMqXVgLwwtb3vjNt7udz2Rb9fZxEK29muQRvgl8xeRLlR3W90jQVy5UXml5ylc/7cFLTPE9pN+SBk9vCN/EShemVhhe5ih2ukUGsacuqIqEfH1e3ghISWaw7RkxZfRJD7tETdXKK5wcS31lN/p0ZO0G4YpDt5NvXgZ5KMNWKRurphU/Auh56ICYby+2M+w/7ctOyZG7Z1k1Fz8jDrX5GzamFctZAoaPvp0um7g1dP6K/5YQjYfm3wELdLousOOMoUyi4ib48GbeEybR3pOzeuk77tYZGLTFs5181nLYc/fzWipwaasBSM8XznRLvkdjLKZyCJaauVF3ZjsmcQO67gqsf2RY6xkObZ4Rr7L1yYbgH7bgTTCjkA4MnUNM6Og3zlJcy4CedFMG+g6Gf4ttqATXR7WU8OOjE1+h+BLnCL25lN4bfPug0Kzfwa857wbs8oi4B55i65hbMRmwiRzlrEBkw5m8qAJToIIXqNlA/HYXRvZi5PExvqDvz82SQTJl6RCUma9vH7zyZc8Nqasn/jHElVHZOs/Cf8pv8KjuTecKXE/IwDr59s=----ATTACHMENT:----MTI1NDAwMjA1MDU3MzUxMiAxMTgxOTA1ODU4NTQ2Mzc5IDE4NzQ3MTk5MzU0NTAwOTU=