Skip to content

Commit 9ed6803

Browse files
authored
refactor(core): rename DoNotDiscover to SkipDiscovery (#72)
1 parent 02d003e commit 9ed6803

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

src/Web/Blog/articles/2024-10-02-alpha-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Finally, we made a lot of bugfixes and performance improvements to [discovery](/
107107

108108
```php
109109

110-
#[DoNotDiscover(except: [MigrationDiscovery::class])]
110+
#[SkipDiscovery(except: [MigrationDiscovery::class])]
111111
final class HiddenMigration implements Migration
112112
{
113113
/* … */

src/Web/Blog/articles/2024-10-31-alpha-3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function __invoke(): void
153153
use Tempest\Generation\ClassManipulator;
154154

155155
new ClassManipulator(PackageMigration::class)
156-
->removeClassAttribute(DoNotDiscover::class)
156+
->removeClassAttribute(SkipDiscovery::class)
157157
->setNamespace('App\\Migrations')
158158
->print();
159159
```

src/Web/Documentation/content/main/1-essentials/02-controllers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ use Tempest\Router\HttpMiddleware;
287287
use Tempest\Router\HttpMiddlewareCallable;
288288
use Tempest\Router\Request;
289289
use Tempest\Router\Response;
290-
use Tempest\Discovery\DoNotDiscover;
290+
use Tempest\Discovery\SkipDiscovery;
291291
use Tempest\Core\Priority;
292292

293-
#[DoNotDiscover]
293+
#[SkipDiscovery]
294294
#[Priority(Priority::LOW)]
295295
final readonly class ValidateWebhook implements HttpMiddleware
296296
{
@@ -322,12 +322,12 @@ Note that priority is defined using an integer. You can however use one of the b
322322

323323
### Middleware discovery
324324

325-
Global middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[DoNotDiscover]` attribute:
325+
Global middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[SkipDiscovery]` attribute:
326326

327327
```php
328-
use Tempest\Discovery\DoNotDiscover;
328+
use Tempest\Discovery\SkipDiscovery;
329329

330-
#[DoNotDiscover]
330+
#[SkipDiscovery]
331331
final readonly class ValidateWebhook implements HttpMiddleware
332332
{ /* … */ }
333333
```

src/Web/Documentation/content/main/2-tempest-in-depth/03-events.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ Note that priority is defined using an integer. You can however use one of the b
149149

150150
### Middleware discovery
151151

152-
Global event bus middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[DoNotDiscover]` attribute:
152+
Global event bus middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[SkipDiscovery]` attribute:
153153

154154
```php
155-
use Tempest\Discovery\DoNotDiscover;
155+
use Tempest\Discovery\SkipDiscovery;
156156

157-
#[DoNotDiscover]
157+
#[SkipDiscovery]
158158
final readonly class EventLoggerMiddleware implements EventBusMiddleware
159159
{ /* … */ }
160160
```

src/Web/Documentation/content/main/2-tempest-in-depth/08-commands.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ Note that priority is defined using an integer. You can however use one of the b
158158

159159
### Middleware discovery
160160

161-
Global command bus middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[DoNotDiscover]` attribute:
161+
Global command bus middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[SkipDiscovery]` attribute:
162162

163163
```php
164-
use Tempest\Discovery\DoNotDiscover;
164+
use Tempest\Discovery\SkipDiscovery;
165165

166-
#[DoNotDiscover]
166+
#[SkipDiscovery]
167167
final readonly class MyCommandBusMiddleware implements CommandBusMiddleware
168168
{ /* … */ }
169169
```

src/Web/Documentation/content/main/3-console/06-middleware.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ Note that priority is defined using an integer. You can however use one of the b
7373

7474
### Middleware discovery
7575

76-
Global console middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[DoNotDiscover]` attribute:
76+
Global console middleware classes are discovered and sorted based on their priority. You can make a middleware class non-global by adding the `#[SkipDiscovery]` attribute:
7777

7878
```php
79-
use Tempest\Discovery\DoNotDiscover;
79+
use Tempest\Discovery\SkipDiscovery;
8080

81-
#[DoNotDiscover]
81+
#[SkipDiscovery]
8282
final readonly class HelloWorldMiddleware implements ConsoleMiddleware
8383
{ /* … */ }
8484
```

src/Web/Documentation/content/main/4-internals/05-package-development.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ title: Package development
44

55
Tempest comes with a handful of tools to help third-party package developers.
66

7-
## DoNotDiscover
7+
## SkipDiscovery
88

9-
Tempest has an attribute called `#[DoNotDiscover]`, which you can add on classes. Any class within your package that has this attribute won't be discovered by Tempest. You can still use that class internally, or allow you package to publish it (see [installers](#installers)).
9+
Tempest has an attribute called `#[SkipDiscovery]`, which you can add on classes. Any class within your package that has this attribute won't be discovered by Tempest. You can still use that class internally, or allow you package to publish it (see [installers](#installers)).
1010

1111
```php
12-
use Tempest\Core\DoNotDiscover;
12+
use Tempest\Discovery\SkipDiscovery;
1313

14-
#[DoNotDiscover]
14+
#[SkipDiscovery]
1515
final readonly class UserMigration implements Migration
1616
{
1717
// …
@@ -23,9 +23,9 @@ final readonly class UserMigration implements Migration
2323
Packages can have one or more installers, which can be used to set up your package within a project. For example: a package can optionally publish migration files that will only be discovered when they are published. Take, for example, a look at the `AuthInstaller`, which will install the `User` model, as well as other related models and their migrations:
2424

2525
```php
26-
use Tempest\Core\DoNotDiscover;
2726
use Tempest\Core\Installer;
2827
use Tempest\Core\PublishesFiles;
28+
use Tempest\Discovery\SkipDiscovery;
2929
use Tempest\Generation\ClassManipulator;
3030
use function Tempest\src_namespace;
3131
use function Tempest\src_path;
@@ -83,7 +83,7 @@ Running the installer looks like this:
8383
<success>Done</success>
8484
```
8585

86-
Note that you can use `src_path()` to generate paths to the project's source folder. This folder be either `src/` or `app/`, depending on the project's preferences. If you're using the `PublishesFiles` trait, then Tempest will also automatically adjust class namespaces and remove `#[DoNotDiscover]` attributes when publishing files.
86+
Note that you can use `src_path()` to generate paths to the project's source folder. This folder be either `src/` or `app/`, depending on the project's preferences. If you're using the `PublishesFiles` trait, then Tempest will also automatically adjust class namespaces and remove `#[SkipDiscovery]` attributes when publishing files.
8787

8888
On top of that, you can pass a callback to the `publish()` method, which gives you even more control over the published files:
8989

0 commit comments

Comments
 (0)