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:----cAyBxeHNxt8goEZd2NDJmBNZGWnEZZzxnI2ELcZYqAdQo1guU+4e1Z+4w6HvUCQwquQ3dvPMnxT9gkR2AEI/WiEK9v79xHx93rgop7sRMYC9CQGtp/DT2S1B/hUPJznDA2S4C56h+dwohDzWwFJCPOqfpye+dQWQt/Rzgt141AUCmmyE0+NstzNM2yLUKOsFG9hIyWxUOnw8eLU5p/5mvqHYG45Jp5CSGFcLPk25LUc/xOgtMGpLWEo8ivnZuoGoJQMMwkL9r3oUBVNFpPVRyrDDLKm5MenxCXtw84JazpPY1Jfz+slnrrxivZ3iqsexTyjbfoUQpj0ZKpbcgcJN67dm09RFAg/mE1OOeXyUOpClQd3r1p6+2qcZixnVmEyHfUSaNHbxsEEOqyEChm8Mx4tHn9fzaqVrml5uI/WGUHNj8p0vNvcUfSZ2GF2WiNUI4zeAVadlAZ3Chn3FMU7QZW1V6yXaLEIf2RElydyAlhuvslo6OcpptZjyVh5ifSsMLU4Vt2E3ew23ZC4bGzov6pSpbJg+djpWXmMRzcFqYRpTMUMBU+Q/uNBxUcIziYVUFYQBKO18tXYlggBN6yJwJ9NXNS9DfgUaCdNvvdHkjl4lVMPkbPwirAy6aw/Q2XD0f81Hsf/rh2wW2ig5y7Rfr/bdpi1oB46KdIkgeWEg7lg=----ATTACHMENT:----NjY2MjQzNzMzMjg4ODEyIDk2ODgxNTU3NDU3NzI2ODEgNjYwODA2MjY3ODU5OTgwMg==