Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance PHPDoc #463

Draft
wants to merge 17 commits into
base: 4.6
Choose a base branch
from
Draft

Enhance PHPDoc #463

wants to merge 17 commits into from

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Dec 12, 2024

🎫 Issue IBX-XXXXX

Description:

  • Add missing summaries (discovered during Enhance PHP API REF metadata documentation-developer#2575). A summary is the first line of a docblock. It can't have advanced formatting as it won't be rendered.
  • Type array keys to avoid generic array<string|int, rendering.
  • Use triple-backticks to have code blocks instead of <code> rendered as a single line.
  • TODO: Use class name instead of self to have a link (to the current page, debatable, it could also be $this).
  • Reword some descriptions.

Previews:

  • Ibexa\Contracts\Core\FieldType\Generic\ValidationError\ConstraintViolationAdapter
    • Before has not rendered @see tags in its introduction and <meta name="description".
    • TODO: [After]
  • Ibexa\Contracts\Core\Limitation\Target\Builder\VersionBuilder
    • Before has not rendered @see tags in its introduction.
    • TODO: [After]
  • Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion::getSpecifications()
    • Before, misses links to properties and constants, and has an example rendered as a single line.
    • TODO: [After] has links and and a proper code block.
  • Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\DateMetadata
    • Before has an example rendered as a single line.
    • TODO: [After] has well rendered example and a link from DateMetadata::TRASHED to TrashService::findTrashItems()
  • Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\UserMetadata
    • Before has two one-line examples, a typo in a quoted constant, a lack of links.
    • TODO: [After]
  • Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications
    • Before
    • TODO: [After]: description is reworded and a link to Criterion::getSpecifications() is added.
  • Ibexa\Contracts\Core\Search\Capable
    • Before had a not rendered @see in its summary.
    • TODO: [After] had a new summary, and the link is in its description.

For QA:

Documentation:

Don't use advanced format in summary, it won't be rendered.
Don't use advanced format in summary, it won't be rendered.

Define array key type, or it will be rendered as array<string|int, …>

phpDocumentor don't seem to understand self.
@@ -53,12 +55,12 @@ class DateMetadata extends Criterion implements TrashCriterion, FilteringCriteri
];

/**
* Creates a new DateMetadata criterion on $metadata.
* Creates a new DateMetadata criterion.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find such property in the contracts namespace. (I may haven't look well enough in the namespace.) It might not be in this contracts namespace, and hidden by abstraction. If no link can be made to it, it probably don't worth being mentioned.

Copy link

sonarcloud bot commented Dec 13, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants