Open SamMousa opened 2 weeks ago
I guess this requires a bit more massaging:
When looking at the getting started guide, an implementation of a Bug
class is iterated over and extended several times. This is an issue for automatic analysis since we never have a proper full implementation of the Bug
class.
One solution that is simple is to always number classes and reference the version explicitly. So we know if we're using Bug3
. We then also need to make sure that we properly repeat code instead of using shorthands like:
class Bug
{
// ... (previous code)
This is something I cannot decide on my own being new to the project. I'd love to hear what you think on how to standardize code samples that get iterated over in guides.
I think we should:
doctrine/doctrine-website
to phpDocumentor/guides
rather than doctrine/rst-parser
, which does not support literalinclude
, at least not in a version that is releasedliteralinclude
It should be way more robust.
If you want to help with that, please join us at https://app.slack.com/client/TA33F5Y6L/CERGRHPGD
This implements what was discussed in https://github.com/doctrine/orm/issues/11494.
It works roughly as follows:
.rst
files in thedocs/
folder.<?php
.Locally you can improve existing blocks by looking for issues in the baseline. Alternatively you can edit the
docs/extract.php
and remove hashes from the$badBlocks
array, this will lead to new errors for you to solve. Extract blocks locally by doingphp docs/extract.php docs/extracted_blocks
. Then runvendor/bin/phpstan -b phpstan-docs.neon
.Of course, before executing anything locally, read the source of
docs/extract.php
.