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:----tSWHj8Mxrt2cNKqi08hXBPZ5PCTit3O8q1MMm1k3n+uwiW1MHaEIPUYGEitnncGZ8um5oNejQLE05hwrPs/ddeGxc0LL/eua0ICBMDwOQ5fi/mpfqDnnlqkUGgrvjhgqR6dSm/EKPLx8fVfNRQJ/BtWww2vYM5sMSfujalwpoJT8nZ0pK7PEIw8115h21XXr0Yb60rYFsmvmWa+dKwJI+hNN+wz5i5tigIBHOh3sqnqoTbLFqZssCNt6u2lo84qZf0PH9Rfes6anhVwmT7y1scwV1TWTurdAZ97J5dwjt+BPqMy7gc7hbP9/SB+vB4u655ae1BgapyOsnPub4iaU8HhBLZ+WfQhOR7cC+jx2+2ABrkhUipiVOQV0Frf7zm/8JDUv8dxIF8D/31cx2Awst3R+I5kOTmB/93Vk/5dv0xAyAeQ17k0znKdqHgP2BVQVlSdpNnrvtEByVfijeh9DV685g2+c1Ga5Ri0bCGREUXT8G13Ll+6x4ZdrV8+XEIFauCW64hW6OHx7BtiPIlEFA12RrTASOin67nTHU+kyA/6N6GcA5sqY0gQzFJs4Hkj+LB3HIwhjnA6O821Fci9Mxw8Q7iN70SZMgLyfSVc/dgiPEyiJ9fKQ26LrsAYbUp3RYvrhLAs6ndfmCpD9tje6VDIT6K0t7OsYBXqGd1qrLa4=----ATTACHMENT:----MzU3Mjk0MTk4MTM4OTIwNiA4NTg1MzM1MjMxODM3Mjk1IDkwMDM2MTgyMTk0MjMyNTU=