public function update($name, $isReference) { if ($this->name === $name && $this->isReference === $isReference) { return $this; } return new self($name, $isReference); }