Skip to content

Commit 787b486

Browse files
committed
Improve tag formatting and fix some typos
1 parent 2e8b4eb commit 787b486

117 files changed

Lines changed: 182 additions & 438 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/Writerside/topics/phpdoc/tags/abstract-tag.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ documentation.
2020
> * @method void handle(Event $event)
2121
> * @abstract
2222
> */
23-
> abstract class Listener
24-
> {
25-
> }
23+
> abstract class Listener {}
2624
> ```
2725
2826
> With a description explaining what implementers must provide.
2927
> ```php
3028
> /**
31-
> * @abstract Subclasses must return the
32-
> * storage backend to use.
29+
> * @abstract Subclasses must return the storage backend to use.
3330
> */
3431
> protected function makeStorage(): Storage
3532
> ```

docs/Writerside/topics/phpdoc/tags/access-tag.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ appears in generated documentation.
2222
> * @property string $token
2323
> * @access private
2424
> */
25-
> class Session
26-
> {
27-
> }
25+
> class Session {}
2826
> ```
2927
3028
> With a description explaining the reasoning.
3129
> ```php
3230
> /**
33-
> * @access protected Only subclasses should
34-
> * read the raw buffer.
31+
> * @access protected Only subclasses should read the raw buffer.
3532
> */
3633
> ```
3734

docs/Writerside/topics/phpdoc/tags/api-tag.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,15 @@ releases without a deprecation notice.
1717
> /**
1818
> * @api
1919
> */
20-
> final class Mailer
21-
> {
22-
> }
20+
> final class Mailer {}
2321
> ```
2422
2523
> With a description explaining the guarantee.
2624
> ```php
2725
> /**
28-
> * @api Stable since 2.0; changes follow
29-
> * semantic versioning.
26+
> * @api Stable since 2.0; changes follow semantic versioning.
3027
> */
31-
> public function send(
32-
> Message $message,
33-
> ): bool
28+
> public function send(Message $message): bool
3429
> ```
3530
3631
Parsing an `@api` tag produces an `ApiTag` instance. Being a pure marker, it

docs/Writerside/topics/phpdoc/tags/author-tag.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ Parsing an `@author` tag produces an `AuthorTag` instance exposing:
3636
final class AuthorTag extends Tag
3737
{
3838
public function __construct(
39+
string $name,
3940
public readonly string $author,
4041
public readonly ?string $email = null,
42+
?DescriptionInterface $description = null,
4143
) {
44+
parent::__construct($name, $description);
4245
}
4346
}
4447
```
4548
46-
Every tag also carries `$name` and an optional `$description` inherited
47-
from the base `Tag` class, omitted above for brevity.
48-
4949
Multiple `@author` tags may appear on the same element when several people
5050
share responsibility for it; each one is parsed independently.
5151

docs/Writerside/topics/phpdoc/tags/category-tag.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ module, `@category` places that module within a wider organizational scheme.
2424
> With additional context about the grouping.
2525
> ```php
2626
> /**
27-
> * @category Database Drivers and connection
28-
> * pooling for relational stores.
27+
> * @category Database Drivers and connection pooling for
28+
> * relational stores.
2929
> */
3030
> ```
3131

docs/Writerside/topics/phpdoc/tags/coding-standards-tag.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ suffix folded into the description. See
1919
need to recognize it yourself.
2020
</note>
2121

22-
Associated with PHP_CodeSniffer; this exact tag spelling could not be
23-
confirmed in PHP_CodeSniffer's own documentation.
22+
Associated with PHP_CodeSniffer.

docs/Writerside/topics/phpdoc/tags/copyright-tag.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ without having to parse a separate license header.
1717
> /**
1818
> * @copyright 2024 Acme Corp
1919
> */
20-
> final class Mailer
21-
> {
22-
> }
20+
> final class Mailer {}
2321
> ```
2422
2523
> A range of years, used on a file that has been maintained over time.
2624
> ```php
2725
> /**
28-
> * @copyright 2018-2024 Acme Corp.
29-
> * All rights reserved.
26+
> * @copyright 2018-2024 Acme Corp. All rights reserved.
3027
> */
3128
> ```
3229

docs/Writerside/topics/phpdoc/tags/deprecated-tag.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,29 @@ deprecated and what to use in its place.
1616
> /**
1717
> * @deprecated 2.0 Use Mailer::send() instead.
1818
> */
19-
> public function dispatch(
20-
> Message $message,
21-
> ): bool
19+
> public function dispatch(Message $message): bool
2220
> ```
2321
2422
> Without a version, just explaining the reason.
2523
> ```php
2624
> /**
27-
> * @deprecated No longer needed now that
28-
> * transport is chosen
25+
> * @deprecated No longer needed now that transport is chosen
2926
> * automatically.
3027
> */
31-
> public function withTransport(
32-
> Transport $transport,
33-
> ): static
28+
> public function withTransport(Transport $transport): static
3429
> ```
3530
3631
Parsing a `@deprecated` tag produces a `DeprecatedTag` instance exposing
3732
`$version` — the version since which the element is deprecated, or `null`
3833
when none was given — alongside the inherited `$description`.
3934
4035
```php
41-
final class DeprecatedTag extends VersionedTag
42-
{
43-
public function __construct(
44-
public readonly ?string $version = null,
45-
) {
46-
}
47-
}
36+
final class DeprecatedTag extends VersionedTag {}
4837
```
4938
39+
`VersionedTag` itself declares the `$version` property (and the
40+
constructor that fills it in) — `DeprecatedTag` adds nothing of its own.
41+
5042
<note>
5143
IDEs and static analyzers commonly treat <code>@deprecated</code> as more
5244
than documentation: every call site of the annotated element is typically

docs/Writerside/topics/phpdoc/tags/example-tag.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,16 @@ reused across several tags that each highlight a different part of it.
2020
> /**
2121
> * @example docs/examples/mailer-basic.php
2222
> */
23-
> public function send(
24-
> Message $message,
25-
> ): bool
23+
> public function send(Message $message): bool
2624
> ```
2725
2826
> Narrowed to the lines that show the relevant usage.
2927
> ```php
3028
> /**
31-
> * @example docs/examples/mailer-retry.php 12 8
32-
> * Configuring a retry policy.
29+
> * @example docs/examples/mailer-retry.php 12 8 Configuring a
30+
> * retry policy.
3331
> */
34-
> public function withRetries(
35-
> int $attempts,
36-
> ): static
32+
> public function withRetries(int $attempts): static
3733
> ```
3834
3935
Parsing an `@example` tag produces an `ExampleTag` instance exposing:

docs/Writerside/topics/phpdoc/tags/extends-tag.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ hierarchy.
1818
> /**
1919
> * @extends Collection<User>
2020
> */
21-
> final class UserCollection extends Collection
22-
> {
23-
> }
21+
> final class UserCollection extends Collection {}
2422
> ```
2523
2624
> Forwarding a still-open type parameter to a further subclass.
@@ -29,9 +27,7 @@ hierarchy.
2927
> * @template T
3028
> * @extends Repository<T>
3129
> */
32-
> abstract class BaseRepository extends Repository
33-
> {
34-
> }
30+
> abstract class BaseRepository extends Repository {}
3531
> ```
3632
3733
Parsing an `@extends` tag produces a tag exposing `$type` — the parsed

0 commit comments

Comments
 (0)