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

[PHPDoc] Improved ContentService doc for API reference #379

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

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Jun 7, 2024

🎫 Issue N/A

Description:

Format PHPDoc (capitalize description except @thows, trailing period, etc.)
Enhance a bit (add few @see, etc.)

[⚠️ Outdated] Preview rendering in PHP API Reference: https://ez-systems-developer-documentation--2413.com.readthedocs.build/en/2413/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html
Compare with current 4.6.7: https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html

TODO: Rebuild the preview after last changes.

For QA:

Documentation:

@adriendupuis adriendupuis force-pushed the improved_contentservice_phpdoc branch from 0700fc8 to f33c2e7 Compare June 21, 2024 13:20
@adriendupuis adriendupuis changed the base branch from main to 4.6 June 21, 2024 13:20
@adamwojs
Copy link
Member

@adriendupuis Could you please address issues reported by phpstan?

src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the content or version with the given id and languages does not exist
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException If the user has no access to read content and in case of un-published content: read versions
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the content or version with the given id and languages doesn't exist.
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions".
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions".
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content" or in case of unpublished content - "read versions".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@konradoboza I'm a bit surprised by this usage of dashes. I'll check if it's regular grammar.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not 100% sure if it's better. It's not a biggie to me tbh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions".
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of unpublished content, "read versions".

* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException - if the content or version with the given remote id does not exist
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException If the user has no access to read content and in case of un-published content: read versions
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the content or version with the given remote id doesn't exist.
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions".
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions".
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content" or in case of unpublished content - "read versions".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions".
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of unpublished content, "read versions".

src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
*
* @param \Ibexa\Contracts\Core\Repository\Values\User\User $user The user to load drafts for, if defined, otherwise drafts for current-user
* @param \Ibexa\Contracts\Core\Repository\Values\User\User|null $user The user to load drafts for, if defined; otherwise drafts for current user.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @param \Ibexa\Contracts\Core\Repository\Values\User\User|null $user The user to load drafts for, if defined; otherwise drafts for current user.
* @param \Ibexa\Contracts\Core\Repository\Values\User\User|null $user The user to load drafts for, if defined. Otherwise - drafts for current user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
* @param \Ibexa\Contracts\Core\Repository\Values\User\User|null $user The user to load drafts for, if defined; otherwise drafts for current user.
* @param \Ibexa\Contracts\Core\Repository\Values\User\User|null $user The user to load drafts for. If `null`, the current user's drafts are loaded.

src/contracts/Repository/ContentService.php Outdated Show resolved Hide resolved
@konradoboza konradoboza requested a review from a team June 28, 2024 09:53
@alongosz alongosz changed the title Improves ContentService PHPDoc [PHPDoc] Improved ContentService doc for API reference Jul 1, 2024
@alongosz
Copy link
Member

alongosz commented Jul 9, 2024

@adriendupuis this one needs rebase. Are all prior review remarks resolved and is it ready for another round of review?

Copy link

sonarcloud bot commented Jul 11, 2024

@adriendupuis adriendupuis marked this pull request as draft September 13, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants