Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/1-essentials/01-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ use Tempest\Router\HttpMiddlewareCallable;
use Tempest\Http\Request;
use Tempest\Http\Response;
use Tempest\Discovery\SkipDiscovery;
use Tempest\Core\Priority;
use Tempest\Support\Priority;

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

### Middleware priority

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:
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:

```php
use Tempest\Core\Priority;
use Tempest\Support\Priority;

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

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

### Middleware discovery

Expand Down
2 changes: 1 addition & 1 deletion docs/1-essentials/03-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ Dynamic database connections should be registered within the application's entry
```php
use Tempest\Container\Container;
use Tempest\Router\HttpMiddleware;
use Tempest\Core\Priority;
use Tempest\Support\Priority;

#[Priority(Priority::HIGHEST)]
final class ConnectTenantMiddleware implements HttpMiddleware
Expand Down
8 changes: 4 additions & 4 deletions docs/1-essentials/04-console-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ After adding or removing commands, regenerate the metadata:
### Available commands

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

#### Middleware priority

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:
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:

```php app/InspireMiddleware.php
use Tempest\Core\Priority;
use Tempest\Support\Priority;

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

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`.
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`.

#### Middleware discovery

Expand Down
2 changes: 1 addition & 1 deletion docs/2-features/08-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ final readonly class EventLoggerMiddleware implements EventBusMiddleware
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:

```php
use Tempest\Core\Priority;
use Tempest\Support\Priority;

#[Priority(Priority::HIGH)]
final readonly class EventLoggerMiddleware implements EventBusMiddleware
Expand Down
2 changes: 1 addition & 1 deletion docs/2-features/10-command-bus.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class MyCommandBusMiddleware implements CommandBusMiddleware
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:

```php
use Tempest\Core\Priority;
use Tempest\Support\Priority;

#[Priority(Priority::HIGH)]
final readonly class MyCommandBusMiddleware implements CommandBusMiddleware
Expand Down
2 changes: 1 addition & 1 deletion docs/2-features/14-exception-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ final class NotFoundExceptionRenderer implements ExceptionRenderer
```

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

## Testing
Expand Down
2 changes: 1 addition & 1 deletion packages/command-bus/src/AsyncCommandMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Tempest\CommandBus;

use Tempest\Core\Priority;
use Tempest\Reflection\ClassReflector;
use Tempest\Support\Priority;
use Tempest\Support\Random;

#[Priority(Priority::FRAMEWORK)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Tempest\Console\Exceptions\ConsoleException;
use Tempest\Console\ExitCode;
use Tempest\Console\Initializers\Invocation;
use Tempest\Core\Priority;
use Tempest\Support\Priority;

#[Priority(Priority::FRAMEWORK - 9)]
final readonly class ConsoleExceptionMiddleware implements ConsoleMiddleware
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/Middleware/HelpMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Tempest\Console\ExitCode;
use Tempest\Console\GlobalFlags;
use Tempest\Console\Initializers\Invocation;
use Tempest\Core\Priority;
use Tempest\Support\Priority;

#[Priority(Priority::FRAMEWORK)]
final readonly class HelpMiddleware implements ConsoleMiddleware
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Tempest\Console\Exceptions\InvalidCommandException;
use Tempest\Console\ExitCode;
use Tempest\Console\Initializers\Invocation;
use Tempest\Core\Priority;
use Tempest\Support\Priority;

#[Priority(Priority::FRAMEWORK - 7)]
final readonly class InvalidCommandMiddleware implements ConsoleMiddleware
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/Middleware/OverviewMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use Tempest\Console\ExitCode;
use Tempest\Console\Initializers\Invocation;
use Tempest\Core\AppConfig;
use Tempest\Core\Priority;
use Tempest\Discovery\DiscoveryCache;
use Tempest\Support\Priority;

use function Tempest\Support\arr;
use function Tempest\Support\str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use Tempest\Console\ConsoleMiddlewareCallable;
use Tempest\Console\ExitCode;
use Tempest\Console\Initializers\Invocation;
use Tempest\Core\Priority;
use Tempest\Support\Arr\ImmutableArray;
use Tempest\Support\Priority;
use Tempest\Support\Str\ImmutableString;
use Throwable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Tempest\Console\Initializers\Invocation;
use Tempest\Console\Input\ConsoleArgumentDefinition;
use Tempest\Console\Input\ConsoleInputArgument;
use Tempest\Core\Priority;
use Tempest\Support\Priority;

use function Tempest\Support\arr;

Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/Stubs/CommandBusMiddlewareStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use Tempest\CommandBus\CommandBusMiddleware;
use Tempest\CommandBus\CommandBusMiddlewareCallable;
use Tempest\Core\Priority;
use Tempest\Discovery\SkipDiscovery;
use Tempest\Support\Priority;

#[SkipDiscovery]
#[Priority(Priority::NORMAL)]
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/Stubs/ConsoleMiddlewareStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use Tempest\Console\ExitCode;
use Tempest\Console\HasConsole;
use Tempest\Console\Initializers\Invocation;
use Tempest\Core\Priority;
use Tempest\Discovery\SkipDiscovery;
use Tempest\Support\Priority;

#[SkipDiscovery]
#[Priority(Priority::NORMAL)]
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/Stubs/EventBusMiddlewareStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Tempest\Console\Stubs;

use Tempest\Core\Priority;
use Tempest\Discovery\SkipDiscovery;
use Tempest\EventBus\EventBusMiddleware;
use Tempest\EventBus\EventBusMiddlewareCallable;
use Tempest\Support\Priority;

#[SkipDiscovery]
#[Priority(Priority::NORMAL)]
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/Stubs/HttpMiddlewareStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace Tempest\Console\Stubs;

use Tempest\Core\Priority;
use Tempest\Discovery\SkipDiscovery;
use Tempest\Http\Request;
use Tempest\Http\Response;
use Tempest\Router\HttpMiddleware;
use Tempest\Router\HttpMiddlewareCallable;
use Tempest\Support\Priority;

#[SkipDiscovery]
#[Priority(Priority::NORMAL)]
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Generator;
use IteratorAggregate;
use Tempest\Reflection\ClassReflector;
use Tempest\Support\Priority;
use Traversable;

use function Tempest\Support\arr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tempest\Database\Casters;

use Tempest\Core\Priority;
use Tempest\Database\DatabaseContext;
use Tempest\Mapper\Attributes\Context;
use Tempest\Mapper\Caster;
Expand All @@ -15,6 +14,7 @@
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Arr;
use Tempest\Support\Json;
use Tempest\Support\Priority;

use function Tempest\Mapper\map;

Expand Down
2 changes: 1 addition & 1 deletion packages/database/src/Casters/PrimaryKeyCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace Tempest\Database\Casters;

use Tempest\Core\Priority;
use Tempest\Database\PrimaryKey;
use Tempest\Mapper\Caster;
use Tempest\Mapper\DynamicCaster;
use Tempest\Reflection\PropertyReflector;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

#[Priority(Priority::HIGHEST)]
final readonly class PrimaryKeyCaster implements Caster, DynamicCaster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use BackedEnum;
use JsonSerializable;
use Tempest\Core\Priority;
use Tempest\Database\DatabaseContext;
use Tempest\Mapper\Attributes\Context;
use Tempest\Mapper\DynamicSerializer;
Expand All @@ -17,6 +16,7 @@
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Arr;
use Tempest\Support\Json;
use Tempest\Support\Priority;
use UnitEnum;

#[Priority(Priority::HIGHEST)]
Expand Down
2 changes: 1 addition & 1 deletion packages/database/src/Serializers/DateTimeSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Tempest\Database\Serializers;

use DateTimeInterface as NativeDateTimeInterface;
use Tempest\Core\Priority;
use Tempest\Database\DatabaseContext;
use Tempest\DateTime\DateTime;
use Tempest\DateTime\DateTimeInterface;
Expand All @@ -16,6 +15,7 @@
use Tempest\Mapper\Serializer;
use Tempest\Reflection\PropertyReflector;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

#[Priority(Priority::HIGH)]
#[Context(DatabaseContext::class)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Tempest\Database\Serializers;

use DateTimeInterface as NativeDateTimeInterface;
use Tempest\Core\Priority;
use Tempest\Database\RawSqlDatabaseContext;
use Tempest\DateTime\DateTime;
use Tempest\DateTime\DateTimeInterface;
Expand All @@ -16,6 +15,7 @@
use Tempest\Mapper\Serializer;
use Tempest\Reflection\PropertyReflector;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

#[Priority(Priority::HIGH)]
#[Context(RawSqlDatabaseContext::class)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
namespace Tempest\Database\Serializers;

use BackedEnum;
use Tempest\Core\Priority;
use Tempest\Database\RawSqlDatabaseContext;
use Tempest\Mapper\Attributes\Context;
use Tempest\Mapper\DynamicSerializer;
use Tempest\Mapper\Exceptions\ValueCouldNotBeSerialized;
use Tempest\Mapper\Serializer;
use Tempest\Reflection\PropertyReflector;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;
use UnitEnum;

#[Priority(Priority::NORMAL)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Tempest\Database\Serializers;

use Tempest\Core\Priority;
use Tempest\Database\RawSqlDatabaseContext;
use Tempest\Mapper\Attributes\Context;
use Tempest\Mapper\DynamicSerializer;
use Tempest\Mapper\Exceptions\ValueCouldNotBeSerialized;
use Tempest\Mapper\Serializer;
use Tempest\Reflection\PropertyReflector;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

#[Priority(Priority::NORMAL)]
#[Context(RawSqlDatabaseContext::class)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
namespace Tempest\Database\Serializers;

use Stringable;
use Tempest\Core\Priority;
use Tempest\Database\RawSqlDatabaseContext;
use Tempest\Mapper\Attributes\Context;
use Tempest\Mapper\DynamicSerializer;
use Tempest\Mapper\Exceptions\ValueCouldNotBeSerialized;
use Tempest\Mapper\Serializer;
use Tempest\Reflection\PropertyReflector;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

#[Priority(Priority::NORMAL)]
#[Context(RawSqlDatabaseContext::class)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace Tempest\Generation\TypeScript;

use Tempest\Core\Priority;
use Tempest\Discovery\Discovery;
use Tempest\Discovery\DiscoveryLocation;
use Tempest\Discovery\IsDiscovery;
use Tempest\Reflection\ClassReflector;
use Tempest\Support\Priority;

use function Tempest\Support\arr;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace Tempest\Generation\TypeScript\TypeResolvers;

use Tempest\Core\Priority;
use Tempest\Generation\TypeScript\TypeNodes\SymbolTypeNode;
use Tempest\Generation\TypeScript\TypeNodes\TypeNode;
use Tempest\Generation\TypeScript\TypeResolver;
use Tempest\Generation\TypeScript\TypeScriptGenerator;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

/**
* Resolves references to PHP classes and interfaces into TypeScript type references.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Tempest\Generation\TypeScript\TypeResolvers;

use DateTimeInterface as NativeDateTimeInterface;
use Tempest\Core\Priority;
use Tempest\DateTime\DateTimeInterface;
use Tempest\Generation\TypeScript\TypeNodes\PrimitiveTypeNode;
use Tempest\Generation\TypeScript\TypeNodes\TypeNode;
use Tempest\Generation\TypeScript\TypeResolver;
use Tempest\Generation\TypeScript\TypeScriptGenerator;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

#[Priority(Priority::HIGH)]
final class DateTimeTypeResolver implements TypeResolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Tempest\Generation\TypeScript\TypeResolvers;

use BackedEnum;
use Tempest\Core\Priority;
use Tempest\Generation\TypeScript\TypeNodes\LiteralTypeNode;
use Tempest\Generation\TypeScript\TypeNodes\TypeNode;
use Tempest\Generation\TypeScript\TypeResolver;
use Tempest\Generation\TypeScript\TypeScriptGenerator;
use Tempest\Reflection\TypeReflector;
use Tempest\Support\Priority;

#[Priority(Priority::LOW)]
final class EnumCaseTypeResolver implements TypeResolver
Expand Down
Loading
Loading