Since $counter is declared private, accessing it with static will lead to errors in possible sub-classes; you can either use self, or increase the visibility of $counter to at least protected.
Loading history...
29
}
30
31
173
return $this->id;
32
}
33
34
/**
35
* Set the ID of the widget.
36
*
37
* @return static
38
*/
39
1
public function id(string $value): static
40
{
41
1
$new = clone $this;
42
1
$new->id = $value;
43
44
1
return $new;
45
}
46
47
/**
48
* Counter used to generate {@see id} for widgets.
49
*/
50
162
public static function counter(int $value): void
51
{
52
162
self::$counter = $value;
53
}
54
55
/**
56
* The prefix to the automatically generated widget IDs.
57
*
58
* @return static
59
* {@see getId()}
60
*/
61
1
public function autoIdPrefix(string $value): static
62
{
63
1
$new = clone $this;
64
1
$new->autoIdPrefix = $value;
65
66
1
return $new;
67
}
68
69
1
public function withDarkTheme(bool $darkTheme = true): static