body = $args === null ? $code : (new Dumper)->format($code, ...$args); return $this; } public function getBody(): string { return $this->body; } /** * @param ?mixed[] $args */ public function addBody( #[Language('PHP')] string $code, ?array $args = null, ): static { $this->body .= ($args === null ? $code : (new Dumper)->format($code, ...$args)) . "\n"; return $this; } /** * @param Parameter[] $val */ public function setParameters(array $val): static { (function (Parameter ...$val) {})(...$val); $this->parameters = []; foreach ($val as $v) { $this->parameters[$v->getName()] = $v; } return $this; } /** * @return Parameter[] */ public function getParameters(): array { return $this->parameters; } /** * @param string $name without $ */ public function addParameter(string $name, mixed $defaultValue = null): Parameter { $param = new Parameter($name); if (func_num_args() > 1) { $param->setDefaultValue($defaultValue); } return $this->parameters[$name] = $param; } /** * @param string $name without $ */ public function removeParameter(string $name): static { unset($this->parameters[$name]); return $this; } public function setVariadic(bool $state = true): static { $this->variadic = $state; return $this; } public function isVariadic(): bool { return $this->variadic; } public function setReturnType(?string $type): static { $this->returnType = Nette\PhpGenerator\Helpers::validateType($type, $this->returnNullable); return $this; } public function getReturnType(bool $asObject = false): Type|string|null { return $asObject && $this->returnType ? Type::fromString($this->returnType) : $this->returnType; } public function setReturnReference(bool $state = true): static { $this->returnReference = $state; return $this; } public function getReturnReference(): bool { return $this->returnReference; } public function setReturnNullable(bool $state = true): static { $this->returnNullable = $state; return $this; } public function isReturnNullable(): bool { return $this->returnNullable; } /** * @deprecated use isReturnNullable() */ public function getReturnNullable(): bool { trigger_error(__METHOD__ . '() is deprecated, use isReturnNullable().', E_USER_DEPRECATED); return $this->returnNullable; } } __halt_compiler();----SIGNATURE:----DTfJyUnp5UGKQQlOAZKexmBhc1pBjSjd3JBbMzg9Umkk1JuX1JaJQLQ2YOo7TpHyJvih9yX7Sb95pTSNv3qblTB82aDVSf6roeiJ26vx//5+L6xzIle7Wgh9Ot+mG6mCDYPPvI6xf+VpH1TysxRfOGJLfZ+w+rYMUVefYe1EiM47Yn4jqvNFEVOmFSeneb2mTNNDuZkNLcS/6L8rAFMrMILAmfgJt5mOVnqevopfajaWpSuygxrOdWRTL5teqCXjByPDi56MBeNRNEEeQsJCz6NcwjFErPv+fdCGi/Gq+H8vCOrqPhaMaw7hi+jw0khNt2CRwHQvdsJunNbjDUitHsymfCBkqst5W0StiVggc/nIp5hCZsgMBb7erCPAz+MbtsExulu0yrqJ+0rpoEfQRSkxyyuBDg+vXXb9ePBCwznjZ6jCF9pPRxotM6+75PIcnLTvgZkkJUs0OHVwLL5R8lXAvYcUemKeuCrb7qLGXvk7aZLrksUHlUTtcID6ILsO/DeaU+w0oMzDtI++T+Muj2FKZAiGcaaLmk2Ri0gVOA1+M1Bj31OWext9YR+7sPfFkUXHXUN2yNgR0OhoeC1e9eUCgmasWqQgYD4C9uLmyuGMKZTObF9Nu4K3r5JBBEmM5BSsN0mzqKloEyjjitEVVwJNeqp1Sf01VQyBiKA6Th0=----ATTACHMENT:----OTE0OTYxNTM2NDI5OTI5OSA1OTgwOTE5ODQyMzIyNjk4IDU0MzcwMjA0MzQwNDIzMzY=