@@ -28,11 +28,9 @@ public function __construct(string $name, OptionsResolver $resolver)
2828 /**
2929 * Adds allowed types for this option.
3030 *
31- * @return $this
32- *
3331 * @throws AccessException If called from a lazy option or normalizer
3432 */
35- public function allowedTypes (string ...$ types ): self
33+ public function allowedTypes (string ...$ types ): static
3634 {
3735 $ this ->resolver ->setAllowedTypes ($ this ->name , $ types );
3836
@@ -44,11 +42,9 @@ public function allowedTypes(string ...$types): self
4442 *
4543 * @param mixed ...$values One or more acceptable values/closures
4644 *
47- * @return $this
48- *
4945 * @throws AccessException If called from a lazy option or normalizer
5046 */
51- public function allowedValues (mixed ...$ values ): self
47+ public function allowedValues (mixed ...$ values ): static
5248 {
5349 $ this ->resolver ->setAllowedValues ($ this ->name , $ values );
5450
@@ -58,11 +54,9 @@ public function allowedValues(mixed ...$values): self
5854 /**
5955 * Sets the default value for this option.
6056 *
61- * @return $this
62- *
6357 * @throws AccessException If called from a lazy option or normalizer
6458 */
65- public function default (mixed $ value ): self
59+ public function default (mixed $ value ): static
6660 {
6761 $ this ->resolver ->setDefault ($ this ->name , $ value );
6862
@@ -83,10 +77,8 @@ public function define(string $option): self
8377 * @param string $package The name of the composer package that is triggering the deprecation
8478 * @param string $version The version of the package that introduced the deprecation
8579 * @param string|\Closure $message The deprecation message to use
86- *
87- * @return $this
8880 */
89- public function deprecated (string $ package , string $ version , string |\Closure $ message = 'The option "%name%" is deprecated. ' ): self
81+ public function deprecated (string $ package , string $ version , string |\Closure $ message = 'The option "%name%" is deprecated. ' ): static
9082 {
9183 $ this ->resolver ->setDeprecated ($ this ->name , $ package , $ version , $ message );
9284
@@ -96,11 +88,9 @@ public function deprecated(string $package, string $version, string|\Closure $me
9688 /**
9789 * Sets the normalizer for this option.
9890 *
99- * @return $this
100- *
10191 * @throws AccessException If called from a lazy option or normalizer
10292 */
103- public function normalize (\Closure $ normalizer ): self
93+ public function normalize (\Closure $ normalizer ): static
10494 {
10595 $ this ->resolver ->setNormalizer ($ this ->name , $ normalizer );
10696
@@ -110,11 +100,9 @@ public function normalize(\Closure $normalizer): self
110100 /**
111101 * Marks this option as required.
112102 *
113- * @return $this
114- *
115103 * @throws AccessException If called from a lazy option or normalizer
116104 */
117- public function required (): self
105+ public function required (): static
118106 {
119107 $ this ->resolver ->setRequired ($ this ->name );
120108
@@ -124,11 +112,9 @@ public function required(): self
124112 /**
125113 * Sets an info message for an option.
126114 *
127- * @return $this
128- *
129115 * @throws AccessException If called from a lazy option or normalizer
130116 */
131- public function info (string $ info ): self
117+ public function info (string $ info ): static
132118 {
133119 $ this ->resolver ->setInfo ($ this ->name , $ info );
134120
0 commit comments