@@ -46,6 +46,7 @@ private function __construct(
4646 *
4747 * @return self<ServerRequest, Response>
4848 */
49+ #[\NoDiscard]
4950 public static function http (OperatingSystem $ os , Environment $ env ): self
5051 {
5152 return new self (Application \Http::of ($ os , $ env ));
@@ -56,6 +57,7 @@ public static function http(OperatingSystem $os, Environment $env): self
5657 *
5758 * @return self<CliEnv, Attempt<CliEnv>>
5859 */
60+ #[\NoDiscard]
5961 public static function cli (OperatingSystem $ os , Environment $ env ): self
6062 {
6163 return new self (Application \Cli::of ($ os , $ env ));
@@ -67,6 +69,7 @@ public static function cli(OperatingSystem $os, Environment $env): self
6769 *
6870 * @return self<CliEnv, Attempt<CliEnv>>
6971 */
72+ #[\NoDiscard]
7073 public static function asyncHttp (OperatingSystem $ os ): self
7174 {
7275 return new self (Application \Async \Http::of ($ os ));
@@ -79,6 +82,7 @@ public static function asyncHttp(OperatingSystem $os): self
7982 *
8083 * @return self<I, O>
8184 */
85+ #[\NoDiscard]
8286 public function mapEnvironment (callable $ map ): self
8387 {
8488 return new self ($ this ->app ->mapEnvironment ($ map ));
@@ -91,6 +95,7 @@ public function mapEnvironment(callable $map): self
9195 *
9296 * @return self<I, O>
9397 */
98+ #[\NoDiscard]
9499 public function mapOperatingSystem (callable $ map ): self
95100 {
96101 return new self ($ this ->app ->mapOperatingSystem ($ map ));
@@ -101,6 +106,7 @@ public function mapOperatingSystem(callable $map): self
101106 *
102107 * @return self<I, O>
103108 */
109+ #[\NoDiscard]
104110 public function map (Middleware $ map ): self
105111 {
106112 /** @psalm-suppress ImpureMethodCall Mutation free to force the user to use the returned object */
@@ -114,6 +120,7 @@ public function map(Middleware $map): self
114120 *
115121 * @return self<I, O>
116122 */
123+ #[\NoDiscard]
117124 public function service (Service $ name , callable $ definition ): self
118125 {
119126 return new self ($ this ->app ->service ($ name , $ definition ));
@@ -126,6 +133,7 @@ public function service(Service $name, callable $definition): self
126133 *
127134 * @return self<I, O>
128135 */
136+ #[\NoDiscard]
129137 public function command (callable $ command ): self
130138 {
131139 return new self ($ this ->app ->command ($ command ));
@@ -138,6 +146,7 @@ public function command(callable $command): self
138146 *
139147 * @return self<I, O>
140148 */
149+ #[\NoDiscard]
141150 public function mapCommand (callable $ map ): self
142151 {
143152 return new self ($ this ->app ->mapCommand ($ map ));
@@ -150,6 +159,7 @@ public function mapCommand(callable $map): self
150159 *
151160 * @return self<I, O>
152161 */
162+ #[\NoDiscard]
153163 public function route (Http \Route \Reference |callable $ handle ): self
154164 {
155165 if ($ handle instanceof Http \Route \Reference) {
@@ -166,6 +176,7 @@ public function route(Http\Route\Reference|callable $handle): self
166176 *
167177 * @return self<I, O>
168178 */
179+ #[\NoDiscard]
169180 public function routes (string $ routes ): self
170181 {
171182 $ self = $ this ;
@@ -184,6 +195,7 @@ public function routes(string $routes): self
184195 *
185196 * @return self<I, O>
186197 */
198+ #[\NoDiscard]
187199 public function mapRoute (callable $ map ): self
188200 {
189201 return new self ($ this ->app ->mapRoute ($ map ));
@@ -196,6 +208,7 @@ public function mapRoute(callable $map): self
196208 *
197209 * @return self<I, O>
198210 */
211+ #[\NoDiscard]
199212 public function routeNotFound (callable $ handle ): self
200213 {
201214 return new self ($ this ->app ->routeNotFound ($ handle ));
@@ -208,6 +221,7 @@ public function routeNotFound(callable $handle): self
208221 *
209222 * @return self<I, O>
210223 */
224+ #[\NoDiscard]
211225 public function recoverRouteError (callable $ recover ): self
212226 {
213227 return new self ($ this ->app ->recoverRouteError ($ recover ));
@@ -218,6 +232,7 @@ public function recoverRouteError(callable $recover): self
218232 *
219233 * @return O
220234 */
235+ #[\NoDiscard]
221236 public function run (CliEnv |ServerRequest $ input ): Attempt |Response
222237 {
223238 return $ this ->app ->run ($ input );
0 commit comments