Skip to content

Commit 6d17876

Browse files
committed
refactor(core)!: move #[Priority] to tempest/support
1 parent 9d11469 commit 6d17876

73 files changed

Lines changed: 79 additions & 78 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/1-essentials/01-routing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ use Tempest\Router\HttpMiddlewareCallable;
498498
use Tempest\Http\Request;
499499
use Tempest\Http\Response;
500500
use Tempest\Discovery\SkipDiscovery;
501-
use Tempest\Core\Priority;
501+
use Tempest\Support\Priority;
502502

503503
#[SkipDiscovery]
504504
#[Priority(Priority::LOW)]
@@ -518,17 +518,17 @@ final readonly class ValidateWebhook implements HttpMiddleware
518518

519519
### Middleware priority
520520

521-
All middleware classes are sorted based on their priority. By default, each middleware has the "normal" priority, which can be overridden using the {b`#[Tempest\Core\Priority]`} attribute:
521+
All middleware classes are sorted based on their priority. By default, each middleware has the "normal" priority, which can be overridden using the {b`#[Tempest\Support\Priority]`} attribute:
522522

523523
```php
524-
use Tempest\Core\Priority;
524+
use Tempest\Support\Priority;
525525

526526
#[Priority(Priority::HIGH)]
527527
final readonly class ValidateWebhook implements HttpMiddleware
528528
{ /* … */ }
529529
```
530530

531-
Priority is defined using an integer. However, for consistency reasons, it is recommended to use of the built-in {b`Tempest\Core\Priority`} constants.
531+
Priority is defined using an integer. However, for consistency reasons, it is recommended to use of the built-in {b`Tempest\Support\Priority`} constants.
532532

533533
### Middleware discovery
534534

docs/1-essentials/03-database.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ Dynamic database connections should be registered within the application's entry
11441144
```php
11451145
use Tempest\Container\Container;
11461146
use Tempest\Router\HttpMiddleware;
1147-
use Tempest\Core\Priority;
1147+
use Tempest\Support\Priority;
11481148

11491149
#[Priority(Priority::HIGHEST)]
11501150
final class ConnectTenantMiddleware implements HttpMiddleware

docs/1-essentials/04-console-commands.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ After adding or removing commands, regenerate the metadata:
282282
### Available commands
283283

284284
| Command | Description |
285-
|------------------------|--------------------------------------------------------------------------|
285+
| ---------------------- | ------------------------------------------------------------------------ |
286286
| `completion:install` | Install the completion script and generate metadata. |
287287
| `completion:generate` | Regenerate the completion metadata JSON. |
288288
| `completion:show` | Output the completion script to stdout (useful for custom installation). |
@@ -325,17 +325,17 @@ Middleware classes will be autowired by the container, so you can use the constr
325325

326326
#### Middleware priority
327327

328-
All console middleware classes get sorted based on their priority. By default, each middleware gets the normal priority, but you can override it using the {b`#[Tempest\Core\Priority]`} attribute:
328+
All console middleware classes get sorted based on their priority. By default, each middleware gets the normal priority, but you can override it using the {b`#[Tempest\Support\Priority]`} attribute:
329329

330330
```php app/InspireMiddleware.php
331-
use Tempest\Core\Priority;
331+
use Tempest\Support\Priority;
332332

333333
#[Priority(Priority::HIGH)]
334334
final readonly class InspireMiddleware implements ConsoleMiddleware
335335
{ /* … */ }
336336
```
337337

338-
Note that priority is defined using an integer. However, the {b`Tempest\Core\Priority`} class provides a few constants with predefined priorities: `Priority::FRAMEWORK`, `Priority::HIGHEST`, `Priority::HIGH`, `Priority::NORMAL`, `Priority::LOW`, `Priority::LOWEST`.
338+
Note that priority is defined using an integer. However, the {b`Tempest\Support\Priority`} class provides a few constants with predefined priorities: `Priority::FRAMEWORK`, `Priority::HIGHEST`, `Priority::HIGH`, `Priority::NORMAL`, `Priority::LOW`, `Priority::LOWEST`.
339339

340340
#### Middleware discovery
341341

docs/2-features/08-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ final readonly class EventLoggerMiddleware implements EventBusMiddleware
138138
All event bus middleware classes get sorted based on their priority. By default, each middleware gets the "normal" priority, but you can override it using the `#[Priority]` attribute:
139139

140140
```php
141-
use Tempest\Core\Priority;
141+
use Tempest\Support\Priority;
142142

143143
#[Priority(Priority::HIGH)]
144144
final readonly class EventLoggerMiddleware implements EventBusMiddleware

docs/2-features/10-command-bus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class MyCommandBusMiddleware implements CommandBusMiddleware
211211
All command bus middleware classes get sorted based on their priority. By default, each middleware gets the "normal" priority, but you can override it using the `#[Priority]` attribute:
212212

213213
```php
214-
use Tempest\Core\Priority;
214+
use Tempest\Support\Priority;
215215

216216
#[Priority(Priority::HIGH)]
217217
final readonly class MyCommandBusMiddleware implements CommandBusMiddleware

docs/2-features/14-exception-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ final class NotFoundExceptionRenderer implements ExceptionRenderer
196196
```
197197

198198
:::info
199-
Exception renderers are automatically [discovered](../4-internals/02-discovery.md) and checked in {b`#[Tempest\Core\Priority]`} order.
199+
Exception renderers are automatically [discovered](../4-internals/02-discovery.md) and checked in {b`#[Tempest\Support\Priority]`} order.
200200
:::
201201

202202
## Testing

packages/command-bus/src/AsyncCommandMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Tempest\CommandBus;
66

7-
use Tempest\Core\Priority;
87
use Tempest\Reflection\ClassReflector;
8+
use Tempest\Support\Priority;
99
use Tempest\Support\Random;
1010

1111
#[Priority(Priority::FRAMEWORK)]

packages/console/src/Middleware/ConsoleExceptionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Tempest\Console\Exceptions\ConsoleException;
1111
use Tempest\Console\ExitCode;
1212
use Tempest\Console\Initializers\Invocation;
13-
use Tempest\Core\Priority;
13+
use Tempest\Support\Priority;
1414

1515
#[Priority(Priority::FRAMEWORK - 9)]
1616
final readonly class ConsoleExceptionMiddleware implements ConsoleMiddleware

packages/console/src/Middleware/HelpMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Tempest\Console\ExitCode;
1313
use Tempest\Console\GlobalFlags;
1414
use Tempest\Console\Initializers\Invocation;
15-
use Tempest\Core\Priority;
15+
use Tempest\Support\Priority;
1616

1717
#[Priority(Priority::FRAMEWORK)]
1818
final readonly class HelpMiddleware implements ConsoleMiddleware

packages/console/src/Middleware/InvalidCommandMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Tempest\Console\Exceptions\InvalidCommandException;
1313
use Tempest\Console\ExitCode;
1414
use Tempest\Console\Initializers\Invocation;
15-
use Tempest\Core\Priority;
15+
use Tempest\Support\Priority;
1616

1717
#[Priority(Priority::FRAMEWORK - 7)]
1818
final readonly class InvalidCommandMiddleware implements ConsoleMiddleware

0 commit comments

Comments
 (0)