-
Notifications
You must be signed in to change notification settings - Fork 82
[v5] Fixed invalid code sample includes #2967
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
base: 5.0
Are you sure you want to change the base?
Conversation
code_samples/ change report
|
adriendupuis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few highlight offsets and unneeded new lines.
Few $output->writeln are not really necessary and narrow the example to CLI, but some are really important to fastly illustrate properties and/or looping; could be debated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The #tab-order section is to be fixed too.
https://doc.ibexa.co/en/4.6/administration/back_office/back_office_tabs/back_office_tabs/#tab-order
https://doc.ibexa.co/en/5.0/administration/back_office/back_office_tabs/back_office_tabs/#tab-order doesn't display the getOrder function
[[= include_file('code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php', 37, 41) =]]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While in this file, I would also fix this weird indent in ## Exception handling section's example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong highlight, two much new line feeds, and maybe an unneeded capital (I can't make a nice suggestion for some "deleted lines" reason):
You can also use it to request other content-related value objects from various services:
``` php hl_lines="14"
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 0, 5) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 21, 23) =]]
// ...
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 42, 44) =]][[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 50, 58) =]]
[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 113, 116) =]]
```
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 58, 60) =]] | ||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 49, 55) =]] | ||
|
|
||
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 60, 63) =]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The $output->writeln doesn't worth it. It unnecessarily contextualize the example as being in a CLI command.
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 60, 63) =]] | |
| [[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 60, 62) =]] |
| ``` php | ||
| [[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 59, 65) =]][[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 72, 76) =]] | ||
| [[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 63, 69) =]] | ||
| [[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 75, 80) =]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem, no need for the $output->writeln
| [[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 75, 80) =]] | |
| [[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 77, 80) =]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While in this file, in ### Combining independent CriteriaI would rename $locationBId for a more distinguishable variable name where B is more visible.
new LocationId($locationBId),- eventually
new LocationId($BLocationId),, - or even
new LocationId($BId),as we know it's a location ID.
| [[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 4, 6) =]] | ||
| [[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 35, 42) =]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| [[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 4, 6) =]] | |
| [[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 35, 42) =]] | |
| [[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 4, 6) =]]//… | |
| [[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 35, 42) =]] |
|
|
||
| ``` php | ||
| [[= include_file('code_samples/front/embed_content/src/Controller/RelationController.php', 2, 9) =]] | ||
| [[= include_file('code_samples/front/embed_content/src/Controller/RelationController.php', 0, 10) =]][[= include_file('code_samples/front/embed_content/src/Controller/RelationController.php', 16, 18) =]][[= include_file('code_samples/front/embed_content/src/Controller/RelationController.php', 37, 40) =]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprising at first but good idea to have what's look like a real complete PHP file! 👍
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 7, 9) =]][[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 10, 16) =]] | ||
|
|
||
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 40, 46) =]] | ||
| // ... | ||
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 41, 48) =]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two much new lines.
```php
[[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 0, 4) =]]
// ...
[[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 7, 9) =]][[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 10, 16) =]]
// ...
[[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php', 41, 48) =]]
```
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php', 6, 23) =]] | ||
| // ... | ||
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php', 56, 57) =]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php', 6, 23) =]] | |
| // ... | |
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php', 56, 57) =]] | |
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php', 6, 23) =]]// ... | |
| [[= include_file('code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php', 56, 57) =]] |
This PR fixes the wrong file includes in different files of the doc (after I've broken them when upgrading the code to v5).