diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 00000000..369a011a --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,17 @@ +# https://docs.github.com/en/actions + +name: "Documentation" + +on: # yamllint disable-line rule:truthy + push: + branches: + - "6.x" + workflow_dispatch: null + +jobs: + run: + name: "Documentation" + uses: "phpDocumentor/.github/.github/workflows/documentation.yml@main" + with: + deploy: true + component: "reflection-docblock" diff --git a/.gitignore b/.gitignore index 62394e1a..581a7f0c 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ vendor/ # By default the phpunit.xml.dist is provided; you can override this using a local config file phpunit.xml .phpunit.result.cache + +.phpdoc diff --git a/Makefile b/Makefile index 5420da71..05849d2a 100644 --- a/Makefile +++ b/Makefile @@ -41,3 +41,7 @@ rector: ## Refactor code using rector .PHONY: pre-commit-test pre-commit-test: fix-code-style test code-style static-code-analysis + +.PHONY: docs +docs: ## Generate documentation with phpDocumentor + docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpdoc:3 diff --git a/docs/contributing.rst b/docs/contributing.rst new file mode 100644 index 00000000..a016ce46 --- /dev/null +++ b/docs/contributing.rst @@ -0,0 +1,12 @@ +Contributing +============ + +Contributions are welcome! If you would like to contribute to ReflectionDocBlock, please follow these guidelines: + +- Fork the repository and create your branch from ``main``. +- Ensure your code follows the project's coding standards. +- Write tests for your changes. +- Submit a pull request with a clear description of your changes. + +For questions or discussions, please open an issue on GitHub. + diff --git a/examples/01-interpreting-a-simple-docblock.php b/docs/examples/01-interpreting-a-simple-docblock.php similarity index 93% rename from examples/01-interpreting-a-simple-docblock.php rename to docs/examples/01-interpreting-a-simple-docblock.php index 6d67dea4..d95d455f 100644 --- a/examples/01-interpreting-a-simple-docblock.php +++ b/docs/examples/01-interpreting-a-simple-docblock.php @@ -1,5 +1,5 @@ create('/**\n * This is a summary.\n *\n * This is a description.\n */'); + + echo $docblock->getSummary(); // Outputs: This is a summary. + +For more detailed usage and how-to guides, see the ``examples/`` directory. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + installation + how-to/index + migration-v6 + contributing diff --git a/docs/installation.rst b/docs/installation.rst new file mode 100644 index 00000000..13232061 --- /dev/null +++ b/docs/installation.rst @@ -0,0 +1,9 @@ +Installation +============ + +To install ReflectionDocBlock, use Composer: + +.. code-block:: bash + + composer require phpdocumentor/reflection-docblock + diff --git a/docs/upgrade-to-v6.rst b/docs/upgrade-to-v6.rst index e69de29b..7a55dce2 100644 --- a/docs/upgrade-to-v6.rst +++ b/docs/upgrade-to-v6.rst @@ -0,0 +1,7 @@ + +Stop using ::create + +StandardTagFactory needs to be created via createInstance + +Method::getArguments removed +Method::create is removed diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml new file mode 100644 index 00000000..3b02e31b --- /dev/null +++ b/phpdoc.dist.xml @@ -0,0 +1,46 @@ + + + Reflection Docblock + + build/docs + + + latest + + + src/ + + api + + + php + + + template + template-extends + template-implements + extends + implements + + phpDocumentor + + + + docs + + guides + + + +