pax_global_header00006660000000000000000000000064147470423630014524gustar00rootroot0000000000000052 comment=29868829a7805657891a0c27a8e4750f663adc59 markstory-sphinxcontrib-phpdomain-04c2251/000077500000000000000000000000001474704236300206665ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/.github/000077500000000000000000000000001474704236300222265ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/.github/workflows/000077500000000000000000000000001474704236300242635ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/.github/workflows/ci.yml000066400000000000000000000040341474704236300254020ustar00rootroot00000000000000name: CI on: pull_request: push: jobs: build: if: endsWith(github.head_ref || github.ref_name, '.changes') == false runs-on: ubuntu-latest strategy: matrix: python: ['3.10', '3.11', '3.12'] fail-fast: false permissions: contents: write steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: Install tools run: | sudo apt -y install libxml2-utils - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements-test.txt pip install . - name: Build Unit Tests run: | cd test/unit make clean make html SPHINXOPTS='-W' make comparehtml - name: Apply Coding Style if: matrix.python == '3.11' run: | pip install black python -m black --diff --check . - name: Push Unit Tests Output if: failure() && github.repository_owner != 'markstory' && matrix.python == '3.11' uses: stefanzweifel/git-auto-commit-action@v4 with: branch: ${{ github.head_ref || github.ref_name }}.changes create_branch: true push_options: '--force' commit_message: Unit Tests Changes commit_user_name: Bot commit_user_email: bot@example.com commit_author: Bot - name: Build myst integration tests run: | cd test/myst make html SPHINXOPTS='-W' - name: Build Unit Tests with toc show_parents=hide run: | cd test/unit make html SPHINXOPTS='-W -D toc_object_entries_show_parents=hide' - name: Build Unit Tests with toc show_parents=domain run: | cd test/unit make html SPHINXOPTS='-W -D toc_object_entries_show_parents=domain' - name: Build Unit Tests with toc show_parents=all run: | cd test/unit make html SPHINXOPTS='-W -D toc_object_entries_show_parents=all' markstory-sphinxcontrib-phpdomain-04c2251/.github/workflows/doc.yml000066400000000000000000000025621474704236300255600ustar00rootroot00000000000000name: GitHub Pages Publish on: # Runs on pushes targeting the default branch push: branches: [master] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false jobs: build: if: github.repository_owner == 'markstory' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Python dependencies run: | pip install -r requirements.txt pip install -e . - name: Setup Pages id: pages uses: actions/configure-pages@v3 - name: Build doc run: make -C doc html - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: path: doc/_build/html deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 markstory-sphinxcontrib-phpdomain-04c2251/.gitignore000066400000000000000000000001011474704236300226460ustar00rootroot00000000000000dist/ build/ doc/_build test/*/_build *.pyc *.egg-info .DS_Store markstory-sphinxcontrib-phpdomain-04c2251/CHANGES000066400000000000000000000054621474704236300216700ustar00rootroot000000000000000.11.1 ====== * Fixed version constraint to be <8.0 to improve Sphinx 7 compatibility. 0.11.0 ====== * Fixed ``~`` not trimming namespaces on classes, interfaces and traits. * Fixed ``~`` not generating links for properties on namespaced classes. * Added support for ``toc_object_entries_show_parents`` options. * Moved documentation to GitHub pages. 0.10.0 ====== * Bumped compatible version of sphinx to 7.0 0.9.0 ===== * Added support for PHP enums. Simple, Backed and Advanced enum declarations are supported. 0.8.1 ===== * Only show the method name for `:php:doc:` links on namespaced classes. 0.8.0 ===== * Add github actions * Run pip install on local project * Stop testing with old python * Bump sphinx support up to 4.3 0.7.3 ===== * Bumped compatible version of sphinx to 4.0 0.7.2 ===== * Bumped compatible version of sphinx to 3.6 0.7.1 ===== * Bumped compatible version of sphinx to 3.5 0.7.0 ===== * Bumped compatible version of sphinx to 2.5 * Added cross-ref linking to `returntype` fields in method annotations. 0.6.3 ===== * Add `currentmodule` directive to allow namespaced elements to be defined across multiple files without index warnings. 0.6.2 ===== * Update version constraint to allow sphinx 2.3 0.6.1 ===== * Updated sphinx version compatibility 0.6.0 ===== * Bad release, avoid this one.. 0.5.0 ===== * Prepare for sphinx 2 support 0.4.1 ===== * Improved compatibility with future versions of sphinx by not using deprecated modules and implement read_safe mode. 0.4.0 ===== * Added: Method and class definitions can now use php visibility keywords. Which now show up as annotations in rendered documents. 0.3.0 ====== * Added: The `:any:` role now works with PHP objects. 0.2.5 ===== * Fix requirements.txt not being included in packages 0.2.4 ===== * Fix package installation in python3. 0.2.3 ===== * Improve compatibility with python3. * Add travis.ci configuration to test documentation generation. 0.2.2 ===== * Fix default array args with short arrays being improperly handled. 0.2.1 ===== * Fix fatal error when `:php:function` is used with no class context. 0.2.0 ===== * This is a Breaking change. The PHP Domain can now run under sphinx 1.4.5. 0.1.4 ===== * Added support for traits. 0.1.3 ===== * Fixed issues with global functions getting nested inside classes that preceded them. * Fixed static methods being omitted from the index. * Interface support added (thanks heavenshell). 0.1.2 ===== * Made it possible to not require class properties to be nested under the class definition. * Added ``.. php:staticmethod:`` to solve ambiguity in method naming. * Added prefixes for a number of things, and removed classname as a prefix for indented class constants. 0.1.1 ===== * Fixed issues with constant documentation. 0.1.0 ===== * Initial release. markstory-sphinxcontrib-phpdomain-04c2251/LICENSE000066400000000000000000000026021474704236300216730ustar00rootroot00000000000000If not otherwise noted, the extensions in this package are licensed under the following license. Copyright (c) 2016 by Mark Story and contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. markstory-sphinxcontrib-phpdomain-04c2251/MANIFEST.in000066400000000000000000000001041474704236300224170ustar00rootroot00000000000000include requirements.txt README.rst include LICENSE include CHANGES markstory-sphinxcontrib-phpdomain-04c2251/README.rst000066400000000000000000000020551474704236300223570ustar00rootroot00000000000000PHP Domain for Sphinx ##################### :author: Mark Story :author: Michael Voříšek About ===== A domain for sphinx >= 1.3 that provides language support for PHP. PHP Domain supports following objects: * Global variable * Global function * Constant * Namespace * Function * Class * Class * Class constant * Instance methods * Static methods * Properties .. note:: This domain expresses methods and attribute names like this:: Class::method_name Class::$attribute_name You address classes/functions in namespaces using \\ syntax as you would in PHP:: Package\Subpackage\Class See `Usage Example`_ in the documentation for information about how to use it. .. _`Usage Example`: https://markstory.github.io/sphinxcontrib-phpdomain/usage.html URLs ==== :PyPI: https://pypi.python.org/pypi/sphinxcontrib-phpdomain :Documentation: https://markstory.github.io/sphinxcontrib-phpdomain/ Install ======= You can install the phpdomain using pip:: pip install -U sphinxcontrib-phpdomain markstory-sphinxcontrib-phpdomain-04c2251/doc/000077500000000000000000000000001474704236300214335ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/doc/Makefile000066400000000000000000000111351474704236300230740ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/sphinxcontrib-rubydomain-acceptancetest.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sphinxcontrib-rubydomain-acceptancetest.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/sphinxcontrib-rubydomain-acceptancetest" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sphinxcontrib-rubydomain-acceptancetest" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." latexpdf: latex $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." make -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." markstory-sphinxcontrib-phpdomain-04c2251/doc/changes.rst000066400000000000000000000000571474704236300235770ustar00rootroot00000000000000ChangeLog ######### .. include:: ../CHANGES markstory-sphinxcontrib-phpdomain-04c2251/doc/conf.py000066400000000000000000000151141474704236300227340ustar00rootroot00000000000000import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.append(os.path.abspath("..")) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = "1.0" # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ["sphinxcontrib.phpdomain"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] # The suffix of source filenames. source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = "index" # General information about the project. project = "sphinxcontrib-phpdomain" copyright = "2011 - 2023, Mark Story and Michael Voříšek" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = "0.1" # The full version, including alpha/beta/rc tags. release = "0.1" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ["_build"] # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. html_theme = "sphinxdoc" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = "sphinxcontrib-phpdomain" # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). # latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). # latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ( "index", "sphinxcontrib-phpdomain.tex", "sphinxcontrib-phpdomain Documentation", "Mark Story and Michael Voříšek", "manual", ), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # Additional stuff for the LaTeX preamble. # latex_preamble = '' # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ( "index", "sphinxcontrib-phpdomain", "sphinxcontrib-phpdomain Documentation", ["Mark Story and Michael Voříšek"], 1, ) ] markstory-sphinxcontrib-phpdomain-04c2251/doc/index.rst000066400000000000000000000002221474704236300232700ustar00rootroot00000000000000.. include:: ../README.rst Contents ======== .. toctree:: :maxdepth: 2 usage reference changes * :ref:`genindex` * :ref:`search` markstory-sphinxcontrib-phpdomain-04c2251/doc/make.bat000066400000000000000000000101141474704236300230350ustar00rootroot00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\sphinxcontrib-rubydomain-acceptancetest.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\sphinxcontrib-rubydomain-acceptancetest.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end markstory-sphinxcontrib-phpdomain-04c2251/doc/reference.rst000066400000000000000000000146151474704236300241320ustar00rootroot00000000000000Reference ######### .. highlight:: rst The PHP domain provides the following directives. Most directives are similar to Python's. Directives ========== Each directive populates the index, and or the namespace index. .. rst:directive:: .. php:namespace:: name This directive declares a new PHP namespace. It accepts nested namespaces by separating namespaces with ``\``. It does not generate any content like :rst:dir:`php:class` does. It will however, generate an entry in the namespace/module index. It has ``synopsis`` and ``deprecated`` options, similar to :rst:dir:`py:module` .. rst:directive:: .. php:global:: name This directive declares a new PHP global variable. .. rst:directive:: .. php:function:: name(signature) Defines a new global/namespaced function outside of a class. You can use many of the same field lists as the python domain. However, ``raises`` is replaced with ``throws`` .. rst:directive:: .. php:const:: name This directive declares a new PHP constant, you can also used it nested inside a class directive to create class constants. .. rst:directive:: .. php:exception:: name This directive declares a new Exception in the current namespace. The signature can include constructor arguments. .. rst:directive:: .. php:interface:: name Describe an interface. Methods and constants belonging to the interface should follow or be nested inside this directive. .. rst:directive:: .. php:trait:: name Describe a trait. Methods beloning to the trait should follow or be nested inside this directive. .. rst:directive:: .. php:enum:: name [ : type ] Describes an enum. Cases, methods, and constants belonging to the enum should be inside this directive's body:: .. php:enum:: Suit In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts Hearts is one of the four suits in playing cards. .. php:case:: Diamonds Diamonds is one of the four suits in playing cards. .. php:case:: Clubs Clubs is one of the four suits in playing cards. .. php:case:: Spades Spades is one of the four suits in playing cards. .. php:method:: color() -> string Returns "Red" for hearts and diamonds and "black" for clubs and spades. .. php:const:: Roses : Hearts An alias for :php:case:`Suit::Hearts`. You may describe a backed enum by specifying the optional enum type and case values:: .. php:enum:: Suit : string In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts : 'H' .. php:case:: Diamonds : 'D' .. php:case:: Clubs : 'C' .. php:case:: Spades : 'S' .. rst:directive:: .. php:case:: name [ : value ] Describes an enum case. If describing a backed enum case, you may also provide the case value. See :rst:dir:`php:enum` for examples. .. rst:directive:: .. php:class:: name Describes a class. Methods, attributes, and constants belonging to the class should be inside this directive's body:: .. php:class:: MyClass Class description .. php:method:: method($argument) Method description Attributes, methods and constants don't need to be nested. They can also just follow the class declaration:: .. php:class:: MyClass Text about the class .. php:method:: methodName() Text about the method .. seealso:: :rst:dir:`php:method` :rst:dir:`php:attr` :rst:dir:`php:const` .. rst:directive:: .. php:method:: name(signature) Describe a class method, its arguments, return value, and exceptions:: .. php:method:: instanceMethod($one, $two) :param string $one: The first parameter. :param string $two: The second parameter. :returns: A description of what this returns. :returntype: LibraryName\\LibraryClass :throws: InvalidArgumentException This is an instance method. .. rst:directive:: .. php:staticmethod:: ClassName::methodName(signature) Describe a static method, its arguments, return value and exceptions, see :rst:dir:`php:method` for options. .. rst:directive:: .. php:attr:: name Describe an property/attribute on a class. Cross Referencing ================= The following roles refer to php objects and are links are generated if a matching directive is found: .. rst:role:: php:ns Reference a namespace. Nested namespaces need to be separated by two \\ due to the syntax of ReST:: .. php:ns:`LibraryName\\SubPackage` will work correctly. .. rst:role:: php:func Reference a PHP function either in a namespace or out. If the function is in a namespace, be sure to include the namespace, unless you are currently inside the same namespace. .. rst:role:: php:global Reference a global variable whose name has ``$`` prefix. .. rst:role:: php:const Reference either a global constant, or a class constant. Class constants should be preceded by the owning class:: DateTime has an :php:const:`DateTime::ATOM` constant. .. rst:role:: php:class Reference a class; a name with namespace can be used. If you include a namespace, you should use following style:: :php:class:`LibraryName\\ClassName` .. rst:role:: php:meth Reference a method of a class/interface/trait. This role supports both kinds of methods:: :php:meth:`DateTime::setDate` :php:meth:`Classname::staticMethod` .. rst:role:: php:attr Reference a property on an object:: :php:attr:`ClassName::$propertyName` .. rst:role:: php:exc Reference an exception. A namespaced name may be used. .. rst:role:: php:interface Reference an interface. A namespaced name may be used. .. rst:role:: php:trait Reference a trait. A namespaced name may be used. .. rst:role:: php:enum Reference an enum. A namespaced name may be used:: :php:enum:`Example\\Suit` .. rst:role:: php:case Reference an enum case. A namespace name may be used:: :php:case:`Example\\Suit::Hearts` markstory-sphinxcontrib-phpdomain-04c2251/doc/usage.rst000066400000000000000000000032741474704236300232770ustar00rootroot00000000000000Usage Example ============= This is source: .. code:: rst .. php:class:: DateTime Datetime class .. php:method:: setDate($year, $month, $day) Set the date. :param int $year: The year. :param int $month: The month. :param int $day: The day. :returns: Either false on failure, or the datetime object for method chaining. .. php:method:: setTime($hour, $minute[, $second]) Set the time. :param int $hour: The hour :param int $minute: The minute :param int $second: The second :returns: Either false on failure, or the datetime object for method chaining. .. php:const:: ATOM Y-m-d\TH:i:sP Result ----------------- .. php:class:: DateTime :nocontentsentry: Datetime class .. php:method:: setDate($year, $month, $day) :nocontentsentry: Set the date. :param int $year: The year. :param int $month: The month. :param int $day: The day. :returns: Either false on failure, or the DateTime object for method chaining. .. php:method:: setTime($hour, $minute[, $second]) :nocontentsentry: Set the time. :param int $hour: The hour :param int $minute: The minute :param int $second: The second :returns: Either false on failure, or the DateTime object for method chaining. .. php:const:: ATOM :nocontentsentry: Y-m-d\TH:i:sP Cross referencing ----------------- From other place, you can create cross reference like that: .. code:: rst You can modify a DateTime's date using :php:meth:`DateTime::setDate`. Result ----------- You can modify a DateTime's date using :php:meth:`DateTime::setDate`. markstory-sphinxcontrib-phpdomain-04c2251/requirements-test.txt000066400000000000000000000000141474704236300251220ustar00rootroot00000000000000myst-parser markstory-sphinxcontrib-phpdomain-04c2251/requirements.txt000066400000000000000000000000221474704236300241440ustar00rootroot00000000000000sphinx>=1.3, <9.0 markstory-sphinxcontrib-phpdomain-04c2251/setup.cfg000066400000000000000000000001171474704236300225060ustar00rootroot00000000000000[egg_info] tag_build = tag_date = false [aliases] release = egg_info -RDb '' markstory-sphinxcontrib-phpdomain-04c2251/setup.py000066400000000000000000000030671474704236300224060ustar00rootroot00000000000000import os from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), "requirements.txt"), "r") as f: requirements = f.read() long_desc = """ This package provides a Sphinx extension for documenting PHP projects. PHP Domain supports following objects: * Global variable * Global function * Constants * Namespaces * Functions * Class * Class * Class constant * Instance methods * Static methods * Properties * Enums """ setup( name="sphinxcontrib-phpdomain", version="0.13.0", url="https://github.com/markstory/sphinxcontrib-phpdomain", download_url="http://pypi.python.org/pypi/sphinxcontrib-phpdomain", license="BSD", author="Mark Story", author_email="mark@mark-story.com", description="Sphinx extension to enable documenting PHP code", long_description=long_desc, project_urls={ "Documentation": "https://markstory.github.io/sphinxcontrib-phpdomain/", }, classifiers=[ "Environment :: Console", "Environment :: Web Environment", "Framework :: Sphinx :: Domain", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Documentation", "Topic :: Utilities", ], platforms="any", dependency_links=[], namespace_packages=["sphinxcontrib"], packages=find_packages(exclude=["test*"]), include_package_data=True, install_requires=requirements, zip_safe=False, ) markstory-sphinxcontrib-phpdomain-04c2251/sphinxcontrib/000077500000000000000000000000001474704236300235605ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/sphinxcontrib/__init__.py000066400000000000000000000005621474704236300256740ustar00rootroot00000000000000""" sphinxcontrib ~~~~~~~~~~~~~ This package is a namespace package that contains all extensions distributed in the ``sphinx-contrib`` distribution. :copyright: Copyright 2016-present by Mark Story and contributors. :copyright: Copyright 2007-2009 by the Sphinx team :license: BSD, see LICENSE for details. """ __import__("pkg_resources").declare_namespace(__name__) markstory-sphinxcontrib-phpdomain-04c2251/sphinxcontrib/phpdomain.py000066400000000000000000000743751474704236300261310ustar00rootroot00000000000000""" Sphinx PHP domain. The PHP domain. Based off of the rubydomain by SHIBUKAWA Yoshiki :copyright: Copyright 2016 by Mark Story :license: BSD, see LICENSE for details. """ import re import inspect from docutils import nodes from docutils.parsers.rst import directives, Directive from sphinx import addnodes from sphinx.roles import XRefRole from sphinx.locale import _ from sphinx.domains import Domain, ObjType, Index from sphinx.directives import ObjectDescription from sphinx.util import logging from sphinx.util.nodes import make_refnode from sphinx.util.docfields import Field, GroupedField, TypedField from sphinx import __version__ as sphinx_version def log_info(fromdocnode, message: str): """ Log informative message. Should have no effect on exit code. """ logger = logging.getLogger(__name__) logger.info(f"[phpdomain] {message}", location=fromdocnode) def log_warning(fromdocnode, message: str): """ Log warning. Should set exit code to non-zero. """ logger = logging.getLogger(__name__) logger.warning(f"[phpdomain] {message}", location=fromdocnode, type="phpdomain") def throw_if_false(fromdocnode, value, message: str): """ Log warning if the value is not true and throw ValueError. Should set exit code to non-zero. """ if not value: log_warning(fromdocnode, message) raise ValueError php_sig_re = re.compile( r""" ^ (public\ |protected\ |private\ )? # visibility (final\ |abstract\ |static\ )? # modifiers ((?:\\?(?!\d)\w+)\:\:)? # class name (\$?(?:\\?(?!\d)\w+)+) \s* # thing name (?: \((.*)\) # optional: arguments (?: \s* -> \s* (.*))? # return annotation )? (?: \s* : \s* (.*))? # backed enum type / case value $ # and nothing more """, re.VERBOSE, ) NS = "\\" separators = { "global": None, "namespace": NS, "function": NS, "interface": NS, "class": None, "trait": None, "enum": None, "exception": None, "method": "::", "const": "::", "attr": "::$", "staticmethod": "::", "case": "::", } php_separator = re.compile(r"(\w+)?(?:[:]{2})?") def _pseudo_parse_arglist(signode, arglist): # type: (addnodes.desc_signature, unicode) -> None """ "Parse" a list of arguments separated by commas. Arguments can have "optional" annotations given by enclosing them in brackets. Currently, this will split at any comma, even if it's inside a string literal (e.g. default argument value). This function comes from sphinx.domains.python. """ paramlist = addnodes.desc_parameterlist() stack = [paramlist] try: for argument in arglist.split(","): argument = argument.strip() ends_open = ends_close = 0 while argument.startswith("["): stack.append(addnodes.desc_optional()) stack[-2] += stack[-1] argument = argument[1:].strip() while argument.startswith("]"): stack.pop() argument = argument[1:].strip() while argument.endswith("]") and not argument.endswith("[]"): ends_close += 1 argument = argument[:-1].strip() while argument.endswith("["): ends_open += 1 argument = argument[:-1].strip() if argument: stack[-1] += addnodes.desc_parameter(argument, argument) while ends_open: stack.append(addnodes.desc_optional()) stack[-2] += stack[-1] ends_open -= 1 while ends_close: stack.pop() ends_close -= 1 if len(stack) != 1: raise IndexError except IndexError: # if there are too few or too many elements on the stack, just give up # and treat the whole argument list as one argument, discarding the # already partially populated paramlist node signode += addnodes.desc_parameterlist() signode[-1] += addnodes.desc_parameter(arglist, arglist) else: signode += paramlist def php_rsplit(fullname): items = [item for item in php_separator.findall(fullname)] return "".join(items[:-2]), "".join(items[1:-1]) class PhpObject(ObjectDescription): """ Description of a general PHP object. """ option_spec = { "noindex": directives.flag, "noindexentry": directives.flag, "nocontentsentry": directives.flag, "module": directives.unchanged, } doc_field_types = [ TypedField( "parameter", label=_("Parameters"), names=("param", "parameter", "arg", "argument"), typerolename="obj", typenames=("paramtype", "type"), ), TypedField( "variable", label=_("Variables"), rolename="obj", names=("var", "ivar", "cvar"), typerolename="obj", typenames=("vartype",), ), GroupedField( "exceptions", label=_("Throws"), rolename="exc", names=("throws", "throw", "exception", "except"), can_collapse=True, ), Field( "returnvalue", label=_("Returns"), has_arg=False, names=("returns", "return"), ), Field( "returntype", label=_("Return type"), has_arg=False, names=("rtype", "returntype"), bodyrolename="obj", ), ] def get_signature_prefix(self, sig): """ May return a prefix to put before the object name in the signature. """ return "" def needs_arglist(self): """ May return true if an empty argument list is to be generated even if the document contains none. """ return False def handle_signature(self, sig, signode): """ Transform a PHP signature into RST nodes. Returns (fully qualified name of the thing, classname if any). If inside a class, the current class name is handled intelligently: * it is stripped from the displayed name if present * it is added to the full name (return value) if not present """ m = php_sig_re.match(sig) if m is None: throw_if_false(signode, False, "Invalid signature") visibility, modifiers, name_prefix, name, arglist, retann, enumtype = m.groups() if not name_prefix: name_prefix = "" # determine namespace and class name (if applicable), as well as full name namespace = self.options.get( "namespace", self.env.temp_data.get("php:namespace") ) separator = separators[self.objtype] classname = self.env.temp_data.get("php:class") # Method declared as Class::methodName if not classname and "::" in name_prefix: classname = name_prefix.rstrip("::") if self.objtype == "global" or self.objtype == "function": add_module = False namespace = None classname = None fullname = name else: add_module = True if name_prefix: classname = classname.rstrip("::") fullname = name_prefix + name # Currently in a class, but not creating another class, elif classname and not self.objtype in [ "class", "exception", "interface", "trait", "enum", "function", ]: if not self.env.temp_data["php:in_class"]: name_prefix = classname + separator fullname = classname + separator + name else: classname = "" fullname = name # A leading \ means the name is fully qualified # and should not inherit the current namespace. if fullname.startswith(NS) and namespace: add_module = False name = name[1:] fullname = fullname[1:] namespace = None signode["namespace"] = namespace signode["class"] = self.class_name = classname signode["fullname"] = fullname if visibility: signode += addnodes.desc_annotation(visibility, visibility) sig_prefix = self.get_signature_prefix(sig) if modifiers and not (sig_prefix and "static" in sig_prefix): signode += addnodes.desc_annotation(modifiers, modifiers) if sig_prefix: signode += addnodes.desc_annotation(sig_prefix, sig_prefix) if name_prefix: if namespace and not self.env.temp_data["php:in_class"]: name_prefix = namespace + NS + name_prefix signode += addnodes.desc_addname(name_prefix, name_prefix) elif add_module and self.env.config.add_module_names: if self.objtype == "global": nodetext = "" signode += addnodes.desc_addname(nodetext, nodetext) else: namespace = self.options.get( "namespace", self.env.temp_data.get("php:namespace") ) if namespace and not self.env.temp_data.get("php:in_class", False): nodetext = namespace + NS signode += addnodes.desc_addname(nodetext, nodetext) signode += addnodes.desc_name(name, name) if not arglist: if self.needs_arglist(): # for callables, add an empty parameter list signode += addnodes.desc_parameterlist() if retann: signode += addnodes.desc_returns(retann, retann) elif enumtype: signode += addnodes.desc_returns(enumtype, enumtype) return fullname, name_prefix _pseudo_parse_arglist(signode, arglist) if retann: signode += addnodes.desc_returns(retann, retann) elif enumtype: signode += addnodes.desc_returns(enumtype, enumtype) return fullname, name_prefix def _object_hierarchy_parts(self, sig_node: addnodes.desc_signature): if "fullname" not in sig_node: return () namespace = sig_node.get("namespace") fullname = sig_node["fullname"] if isinstance(namespace, str): return (namespace, *fullname.split("::")) else: return tuple(fullname.split("::")) def _toc_entry_name(self, sig_node: addnodes.desc_signature) -> str: if not sig_node.get("_toc_parts"): return "" config = self.env.app.config objtype = sig_node.parent.get("objtype") if config.add_function_parentheses and objtype in {"function", "method"}: parens = "()" else: parens = "" *parents, name = sig_node["_toc_parts"] if config.toc_object_entries_show_parents == "domain": return sig_node.get("fullname", name) + parens if config.toc_object_entries_show_parents == "hide": return name + parens if config.toc_object_entries_show_parents == "all": if ( objtype in {"method", "const", "attr", "staticmethod", "case"} and len(parents) > 0 ): name = parents.pop() + "::" + name return "\\".join(parents + [name + parens]) return "" def get_index_text(self, namespace, name): """ Return the text for the index entry of the object. """ raise NotImplementedError("must be implemented in subclasses") def _is_class_member(self): return self.objtype.startswith("method") or self.objtype.startswith("attr") def add_target_and_index(self, name_cls, sig, signode): if self.objtype == "global": namespace = None else: namespace = self.options.get( "namespace", self.env.temp_data.get("php:namespace") ) if self._is_class_member(): if signode["class"]: prefix = namespace and namespace + NS or "" else: prefix = namespace and namespace + NS or "" else: prefix = namespace and namespace + NS or "" fullname = prefix + name_cls[0] # note target if fullname not in self.state.document.ids: signode["names"].append(fullname) signode["ids"].append(fullname) signode["first"] = not self.names self.state.document.note_explicit_target(signode) objects = self.env.domaindata["php"]["objects"] if fullname in objects: self.state_machine.reporter.warning( "duplicate object description of %s, " % fullname + "other instance in " + self.env.doc2path(objects[fullname][0]), line=self.lineno, ) objects[fullname] = (self.env.docname, self.objtype) if "noindexentry" not in self.options: indextext = self.get_index_text(namespace, name_cls) if indextext: self.indexnode["entries"].append( ("single", indextext, fullname, fullname, None) ) class PhpGloballevel(PhpObject): """ Description of an object on global level (global variables). """ def get_index_text(self, namespace, name_cls): if self.objtype == "global": return _("%s (global variable)") % name_cls[0] else: return "" class PhpNamespacelevel(PhpObject): """ Description of an object on namespace level (functions, constants). """ def needs_arglist(self): return self.objtype == "function" def get_signature_prefix(self, sig): """ Adds class prefix for constants created inside classes """ if self.objtype == "const": return _("constant ") if self.class_name and self.class_name != "": return self.class_name + "::" def get_index_text(self, namespace, name_cls): if self.objtype == "function": if not namespace: return _("%s() (global function)") % name_cls[0] return _("%s() (function in %s)") % (name_cls[0], namespace) elif self.objtype == "const" and self.class_name != "": return _("%s (class constant)") % (name_cls[0]) elif self.objtype == "const": if not namespace: return _("%s (global constant)") % (name_cls[0]) return _("%s (constant in %s)") % (name_cls[0], namespace) else: return "" class PhpClasslike(PhpObject): """ Description of a class-like object (classes, interfaces, traits, enums). """ def get_signature_prefix(self, sig): return self.objtype + " " def get_index_text(self, namespace, name_cls): if self.objtype == "class": if not namespace: return _("%s (class)") % name_cls[0] return _("%s (class in %s)") % (name_cls[0], namespace) elif self.objtype == "interface": if not namespace: return _("%s (interface)") % name_cls[0] return _("%s (interface in %s)") % (name_cls[0], namespace) elif self.objtype == "trait": if not namespace: return _("%s (trait)") % name_cls[0] return _("%s (trait in %s)") % (name_cls[0], namespace) elif self.objtype == "enum": if not namespace: return _("%s (enum)") % name_cls[0] return _("%s (enum in %s)") % (name_cls[0], namespace) elif self.objtype == "exception": return name_cls[0] else: return "" def after_content(self): self.env.temp_data["php:in_class"] = False def before_content(self): self.env.temp_data["php:in_class"] = True if self.names: self.env.temp_data["php:class"] = self.names[0][0] class PhpClassmember(PhpObject): """ Description of a class member (methods, properties). """ def get_signature_prefix(self, sig): if self.objtype == "attr": return _("property ") if self.objtype == "staticmethod": return _("static ") if self.objtype == "case": return _("case ") return "" def needs_arglist(self): return self.objtype == "method" def get_index_text(self, namespace, name_cls): name, cls = name_cls if ( self.objtype.endswith("method") or self.objtype == "attr" or self.objtype == "case" ): try: clsname, propname = php_rsplit(name) except ValueError: propname = name clsname = None if self.objtype.endswith("method"): if namespace and clsname is None: return _("%s() (in namespace %s)") % (name, namespace) elif namespace and self.env.config.add_module_names: return _("%s() (%s\\%s method)") % (propname, namespace, clsname) else: return _("%s() (%s method)") % (propname, clsname) elif self.objtype == "attr": if namespace and clsname is None: return _("%s (in namespace %s)") % (name, namespace) elif namespace and self.env.config.add_module_names: return _("%s (%s\\%s property)") % (propname, namespace, clsname) else: return _("%s (%s property)") % (propname, clsname) elif self.objtype == "case": if namespace and clsname is None: return _("%s enum case") % (name) elif namespace and self.env.config.add_module_names: return _("%s (%s\\%s enum case)") % (propname, namespace, clsname) else: return _("%s (%s enum case)") % (propname, clsname) else: return "" class PhpNamespace(Directive): """ Directive to start a new PHP namespace, which is similar to module. """ has_content = False required_arguments = 1 optional_arguments = 0 final_argument_whitespace = False option_spec = { "synopsis": lambda x: x, "noindex": directives.flag, "deprecated": directives.flag, } def run(self): env = self.state.document.settings.env namespace = self.arguments[0].strip() noindex = "noindex" in self.options env.temp_data["php:namespace"] = namespace env.temp_data["php:class"] = None env.domaindata["php"]["namespaces"][namespace] = ( env.docname, self.options.get("synopsis", ""), "deprecated" in self.options, ) targetnode = nodes.target("", "", ids=["namespace-" + namespace], ismod=True) self.state.document.note_explicit_target(targetnode) ret = [targetnode] # the synopsis isn't printed; in fact, it is only used in the # modindex currently if not noindex: indextext = _("%s (namespace)") % namespace inode = addnodes.index( entries=[ ("single", indextext, "namespace-" + namespace, namespace, None) ] ) ret.append(inode) return ret class PhpCurrentNamespace(Directive): """ This directive is just to tell Sphinx that we're documenting stuff in namespace foo, but links to namespace foo won't lead here. """ has_content = False required_arguments = 1 optional_arguments = 0 final_argument_whitespace = False option_spec = {} def run(self): env = self.state.document.settings.env namespace = self.arguments[0].strip() if namespace == "None": env.temp_data["php:namespace"] = None else: env.temp_data["php:namespace"] = namespace return [] class PhpXRefRole(XRefRole): """ Provides cross reference links for PHP objects """ def process_link(self, env, refnode, has_explicit_title, title, target): if not has_explicit_title: if title.startswith("::"): title = title[2:] target = target.lstrip("~") # only has a meaning for the title # If the first char is ~ don't display the leading namespace & class. if title.startswith("~"): m = re.search(r"(?:.+[:]{2}|(?:.*?\\{1,2})+)?(.*)\Z", title) if m: title = m.group(1) refnode["php:namespace"] = env.temp_data.get("php:namespace") refnode["php:class"] = env.temp_data.get("php:class") return title, target class PhpNamespaceIndex(Index): """ Index subclass to provide the PHP namespace index. """ name = "modindex" localname = _("PHP Namespace Index") shortname = _("namespaces") def generate(self, docnames=None): content = {} # list of prefixes to ignore ignores = self.domain.env.config["modindex_common_prefix"] ignores = sorted(ignores, key=len, reverse=True) # list of all namespaces, sorted by name namespaces = sorted( self.domain.data["namespaces"].items(), key=lambda x: x[0].lower() ) # sort out collapsable namespaces prev_namespace = "" num_toplevels = 0 for namespace, (docname, synopsis, deprecated) in namespaces: if docnames and docname not in docnames: continue for ignore in ignores: if namespace.startswith(ignore): namespace = namespace[len(ignore) :] stripped = ignore break else: stripped = "" # we stripped the whole namespace name? if not namespace: namespace, stripped = stripped, "" entries = content.setdefault(namespace[0].lower(), []) package = namespace.split(NS)[0] if package != namespace: # it's a subnamespace if prev_namespace == package: # first subnamespace - make parent a group head entries[-1][1] = 1 elif not prev_namespace.startswith(package): # subnamespace without parent in list, add dummy entry entries.append([stripped + package, 1, "", "", "", "", ""]) subtype = 2 else: num_toplevels += 1 subtype = 0 qualifier = deprecated and _("Deprecated") or "" entries.append( [ stripped + namespace, subtype, docname, "namespace-" + stripped + namespace, "", qualifier, synopsis, ] ) prev_namespace = namespace # apply heuristics when to collapse modindex at page load: # only collapse if number of toplevel namespaces is larger than # number of subnamespaces collapse = len(namespaces) - num_toplevels < num_toplevels # sort by first letter content = sorted(content.items()) return content, collapse class PhpDomain(Domain): """ PHP language domain. """ name = "php" label = "PHP" object_types = { "function": ObjType(_("function"), "func", "obj"), "global": ObjType(_("global variable"), "global", "obj"), "const": ObjType(_("const"), "const", "obj"), "method": ObjType(_("method"), "meth", "obj"), "class": ObjType(_("class"), "class", "obj"), "attr": ObjType(_("attribute"), "attr", "obj"), "exception": ObjType(_("exception"), "exc", "obj"), "namespace": ObjType(_("namespace"), "ns", "obj"), "interface": ObjType(_("interface"), "interface", "obj"), "trait": ObjType(_("trait"), "trait", "obj"), "enum": ObjType(_("enum"), "enum", "obj"), "case": ObjType(_("case"), "case", "obj"), } directives = { "function": PhpNamespacelevel, "global": PhpGloballevel, "const": PhpNamespacelevel, "class": PhpClasslike, "method": PhpClassmember, "staticmethod": PhpClassmember, "attr": PhpClassmember, "case": PhpClassmember, "exception": PhpClasslike, "interface": PhpClasslike, "trait": PhpClasslike, "enum": PhpClasslike, "namespace": PhpNamespace, "currentmodule": PhpCurrentNamespace, "currentnamespace": PhpCurrentNamespace, } roles = { "func": PhpXRefRole(fix_parens=False), "global": PhpXRefRole(), "class": PhpXRefRole(), "exc": PhpXRefRole(), "meth": PhpXRefRole(fix_parens=False), "attr": PhpXRefRole(), "const": PhpXRefRole(), "ns": PhpXRefRole(), "obj": PhpXRefRole(), "interface": PhpXRefRole(), "trait": PhpXRefRole(), "enum": PhpXRefRole(), "case": PhpXRefRole(), } initial_data = { "objects": {}, # fullname -> docname, objtype "namespaces": {}, # namespace -> docname, synopsis } indices = [ PhpNamespaceIndex, ] def clear_doc(self, docname): for fullname, (fn, _l) in list(self.data["objects"].items()): if fn == docname: del self.data["objects"][fullname] for ns, (fn, _x, _x) in list(self.data["namespaces"].items()): if fn == docname: del self.data["namespaces"][ns] def merge_domaindata(self, docnames, otherdata): for fullname, (fn, objtype) in otherdata["objects"].items(): if fn in docnames: self.data["objects"][fullname] = (fn, objtype) for namespace, data in otherdata["namespaces"].items(): if data[0] in docnames: self.data["namespaces"][namespace] = data def resolve_any_xref(self, env, fromdocname, builder, target, node, contnode): for typ in self.roles: resolve = self.resolve_xref( env, fromdocname, builder, typ, target, node, contnode ) if resolve: return [("php:%s" % typ, resolve)] return [] def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): if typ == "ns" or typ == "obj" and target in self.data["namespaces"]: docname, synopsis, deprecated = self.data["namespaces"].get( target, ("", "", "") ) if not docname: return None else: title = "%s%s" % (synopsis, (deprecated and " (deprecated)" or "")) return make_refnode( builder, fromdocname, docname, "namespace-" + target, contnode, title, ) else: namespace = node.get("php:namespace") clsname = node.get("php:class") searchorder = node.hasattr("refspecific") and 1 or 0 name, obj = self.find_obj( env, node, namespace, clsname, target, typ, searchorder ) if not obj: return None else: return make_refnode(builder, fromdocname, obj[0], name, contnode, name) def find_obj( self, env, fromdocnode, namespace, classname, name, type, searchorder=0 ): """ Find a PHP object for "name", using the given namespace and classname. """ # strip parenthesis if name[-2:] == "()": name = name[:-2] if not name: return None, None objects = self.data["objects"] newname = None if searchorder == 1: if ( namespace and classname and namespace + NS + classname + "::" + name in objects ): newname = namespace + NS + classname + "::" + name elif namespace and namespace + NS + name in objects: newname = namespace + NS + name elif namespace and namespace + NS + name in objects: newname = namespace + NS + name elif classname and classname + "::" + name in objects: newname = classname + "." + name elif classname and classname + "::$" + name in objects: newname = classname + "::$" + name elif name in objects: newname = name else: if name in objects: newname = name elif classname and classname + "::" + name in objects: newname = classname + "::" + name elif classname and classname + "::$" + name in objects: newname = classname + "::$" + name elif namespace and namespace + NS + name in objects: newname = namespace + NS + name elif ( namespace and classname and namespace + NS + classname + "::" + name in objects ): newname = namespace + NS + classname + "::" + name elif ( namespace and classname and namespace + NS + classname + "::$" + name in objects ): newname = namespace + NS + classname + "::$" + name # special case: object methods elif ( type in ("func", "meth") and "::" not in name and "object::" + name in objects ): newname = "object::" + name if newname is None: return None, None return newname, objects[newname] def get_objects(self): for ns, info in self.data["namespaces"].items(): yield (ns, ns, "namespace", info[0], "namespace-" + ns, 0) for refname, (docname, type) in self.data["objects"].items(): yield (refname, refname, type, docname, refname, 1) def setup(app): app.add_domain(PhpDomain) return {"version": sphinx_version, "parallel_read_safe": True} markstory-sphinxcontrib-phpdomain-04c2251/test/000077500000000000000000000000001474704236300216455ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/test/myst/000077500000000000000000000000001474704236300226415ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/test/myst/Makefile000066400000000000000000000111351474704236300243020ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/sphinxcontrib-rubydomain-acceptancetest.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sphinxcontrib-rubydomain-acceptancetest.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/sphinxcontrib-rubydomain-acceptancetest" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sphinxcontrib-rubydomain-acceptancetest" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." latexpdf: latex $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." make -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." markstory-sphinxcontrib-phpdomain-04c2251/test/myst/conf.py000066400000000000000000000004221474704236300241360ustar00rootroot00000000000000import sys, os sys.path.append(os.path.abspath("..")) extensions = [ "sphinxcontrib.phpdomain", "myst_parser", ] myst_enable_extensions = ["colon_fence"] source_suffix = ".md" master_doc = "index" exclude_patterns = ["_build", "log.md"] html_theme = "default" markstory-sphinxcontrib-phpdomain-04c2251/test/myst/index.md000066400000000000000000000000651474704236300242730ustar00rootroot00000000000000# Test: Build all files :::{toctree} :glob: ** ::: markstory-sphinxcontrib-phpdomain-04c2251/test/myst/log.html000066400000000000000000000037171474704236300243200ustar00rootroot00000000000000

Invalid domain type

Invalid signature

x();

Unresolved references

  • Foo\Aa

  • Foo\A::simplifyy

markstory-sphinxcontrib-phpdomain-04c2251/test/myst/log.md000066400000000000000000000004511474704236300237440ustar00rootroot00000000000000# Invalid domain type :::{php:namespacee} Foo ::: # Invalid signature :::{php:method} x(); ::: # Unresolved references - {php:class}`Foo\Aa` - {php:meth}`Foo\A::simplifyy` :::{php:namespace} Foo ::: - {php:meth}`Foo\A::simplify` :::{php:namespace} Fooo ::: - {php:meth}`Foo\A::simplify` markstory-sphinxcontrib-phpdomain-04c2251/test/myst/log.txt000066400000000000000000000020121474704236300241560ustar00rootroot00000000000000test/log.md:3: WARNING: Unknown directive type: 'php:namespacee' [myst.directive_unknown] test/log.md:8: WARNING: [phpdomain] Invalid signature test/log.md:13: [phpdomain] Target Foo\Aa not found test/log.md:15: [phpdomain] Target Foo\A::simplifyy not found test/log.md:20: [phpdomain] Target Foo\Foo\A::simplify not found - did you mean to write A::simplify? test/log.md:25: [phpdomain] Target Fooo\Foo\A::simplify not found - did you mean to write \Foo\A::simplify? test/ns.md:48: [phpdomain] Target A2::simplify not found test/ns.md:53: [phpdomain] Target Bar2\A::simplify not found test/rst_doc.md:506: [phpdomain] Target OtherLibrary\int|string|ReturnedClass|\LibraryName\SubPackage\SubpackageInterface|null not found test/rst_doc2.md:11: [phpdomain] Target Imagine\Image\ImageInterface::draw not found test/rst_doc2.md:17: [phpdomain] Target Imagine\Image\PointInterface not found test/rst_doc2.md:17: [phpdomain] Target Imagine\Image\BoxInterface not found test/rst_doc2.md:17: [phpdomain] Target Imagine\Image\Color not found markstory-sphinxcontrib-phpdomain-04c2251/test/myst/make.bat000066400000000000000000000101141474704236300242430ustar00rootroot00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\sphinxcontrib-rubydomain-acceptancetest.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\sphinxcontrib-rubydomain-acceptancetest.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end markstory-sphinxcontrib-phpdomain-04c2251/test/myst/method.html000066400000000000000000000041441474704236300250120ustar00rootroot00000000000000

Simple method

class Foo
Foo::test($a, ...$args)

Simple test method.

Parameters:
  • $args (array) – Associative array

Cross linking

markstory-sphinxcontrib-phpdomain-04c2251/test/myst/method.md000066400000000000000000000003131474704236300244400ustar00rootroot00000000000000# Simple method :::{php:class} Foo ::: :::{php:method} test($a, ...$args) Simple test method. ```{eval-rst} :param array $args: Associative array ``` ::: ## Cross linking - {php:meth}`Foo::test()` markstory-sphinxcontrib-phpdomain-04c2251/test/myst/ns.html000066400000000000000000000136101474704236300241500ustar00rootroot00000000000000

Simple NS

class Foo\ A
Foo\A:: simplify ( )

Cross linking

NS can be changed

class Foo\Bar\ A
Foo\Bar\A:: simplify ( )
class Bar\ A
Bar\A:: simplify ( )

Cross linking

NS must not be guessed

These cross references must not have a link as the target methods are not defined.

  • A2::simplify

  • A::simplify

markstory-sphinxcontrib-phpdomain-04c2251/test/myst/ns.md000066400000000000000000000012061474704236300236020ustar00rootroot00000000000000# Simple NS :::{php:namespace} Foo ::: :::{php:class} A ::: :::{php:method} simplify() ::: ## Cross linking - {php:meth}`A::simplify` # NS can be changed :::{php:namespace} Foo\Bar ::: :::{php:class} A ::: :::{php:method} simplify() ::: :::{php:namespace} Bar ::: :::{php:class} A ::: :::{php:method} simplify() ::: ## Cross linking - {php:meth}`A::simplify` - {php:meth}`\Foo\Bar\A::simplify` - {php:meth}`\Bar\A::simplify` # NS must not be guessed :::note These cross references must not have a link as the target methods are not defined. ::: - {php:meth}`\A2::simplify` :::{php:namespace} Bar2 ::: - {php:meth}`A::simplify` markstory-sphinxcontrib-phpdomain-04c2251/test/myst/requirements.txt000066400000000000000000000000231474704236300261200ustar00rootroot00000000000000sphinx myst-parser markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_doc.html000066400000000000000000003125561474704236300252000ustar00rootroot00000000000000

Acceptance tests for PHPdomain

Globals

$global_var

A global variable

constant SOME_CONSTANT

A global constant

constant VALUE

A global constant

in_array(needle, haystack)

Checks for needle in haystack.

Parameters:
  • needle – The element to search for.

  • haystack (array) – The array to search.

Returns:

Element exists in array.

Return type:

bool

Classes

class DateTime

Datetime class

setDate($year, $month, $day)

Set the date in the datetime object

Parameters:
  • $year (int) – The year.

  • $month (int) – The month.

  • $day (int) – The day.

setTime($hour, $minute[, $second])

Set the time

Parameters:
  • $hour (int) – The hour

  • $minute (int) – The minute

  • $second (int) – The second

public static getLastErrors ( )

Returns the warnings and errors

Returns:

array Returns array containing info about warnings and errors.

constant ATOM

Y-m-dTH:i:sP

property testattr

Value of some attribute

class OtherClass

Another class

OtherClass::update($arg='', $arg2=[], $arg3=[])

Update something.

property OtherClass::$ nonIndentedAttribute

This attribute wasn’t indented

constant OtherClass:: NO_INDENT

This class constant wasn’t indented

static OtherClass:: staticMethod

A static method.

Exceptions

exception InvalidArgumentException

Throw when you get an argument that is bad.

Interfaces

interface DateTimeInterface

Datetime interface

setDate($year, $month, $day)

Set the date in the datetime object

Parameters:
  • $year (int) – The year.

  • $month (int) – The month.

  • $day (int) – The day.

setTime($hour, $minute[, $second])

Set the time

Parameters:
  • $hour (int) – The hour

  • $minute (int) – The minute

  • $second (int) – The second

constant ATOM

Y-m-dTH:i:sP

property testattr

Value of some attribute

interface OtherInterface

Another interface

Traits

trait LogTrait

A logging trait

log($level, $string)

A method description.

More globals after classes

$other_global_var

A global variable

strpos($needle, $haystack)

Position of needle in haystack

Test Case - Global symbols with no namespaces

$global_var

$other_global_var

SOME_CONSTANT

in_array

strpos

DateTime

DateTime::setTime()

DateTime::getLastErrors()

DateTime::setDate()

DateTime::ATOM

DateTime::$testattr

OtherClass::update

OtherClass::$nonIndentedAttribute

OtherClass::NO_INDENT

OtherClass::staticMethod

InvalidArgumentException

DateTimeInterface

DateTimeInterface::setTime()

setDate()

DateTimeInterface::ATOM

DateTimeInterface::$testattr

OtherInterface

LogTrait

LogTrait::log()

Namespaced elements

LibraryName\namespaced_function($one[, $two])

A function in a namespace

Parameters:
  • $one (string) – First parameter.

  • $two (string) – Second parameter.

constant LibraryName\ NS_CONST

A constant in a namespace

exception LibraryName\ NamespaceException

This exception is in a namespace.

class LibraryName\ LibraryClass

A class in a namespace

LibraryClass:: instanceMethod ( $foo )

An instance method

constant TEST_CONST

Test constant

property property

A property!

static LibraryName\LibraryClass:: staticMethod

A static method in a namespace

class LibraryName\ NamespaceClass

A class in the namespace, no indenting on children

LibraryName\NamespaceClass::firstMethod($one, $two)

A normal instance method.

property LibraryName\NamespaceClass::$ property

A property

constant LibraryName\NamespaceClass:: NAMESPACE_CONST

Const on class in namespace

static LibraryName\NamespaceClass:: namespaceStatic ( $foo )

A static method here.

final class LibraryName\ LibraryClassFinal

A final class

publicLibraryName\LibraryClassFinal::firstMethod($one, $two)

A public instance method.

protectedLibraryName\LibraryClassFinal::secondMethod($one, $two)

A protected instance method.

privateLibraryName\LibraryClassFinal::thirdMethod($one, $two)

A private instance method.

staticLibraryName\LibraryClassFinal::fourthMethod($one, $two)

A static method.

protectedfinalLibraryName\LibraryClassFinal::fifthMethod($one, $two)

A protected final method.

abstract class LibraryName\ LibraryClassAbstract

An abstract class

interface LibraryName\ LibraryInterface

A interface in a namespace

instanceMethod ( $foo )

An instance method

trait LibraryName\ TemplateTrait

A trait in a namespace

render ( $template )

Render a template.

Test Case - not including namespace

Within a namespace context you don’t need to include the namespace in links.

LibraryName

namespaced_function()

NS_CONST

LibraryClass

LibraryClass::instanceMethod

LibraryClass::staticMethod()

LibraryClass::$property

LibraryClass::TEST_CONST

OtherClass

ThirdClass

NamespaceClass

NamespaceClass::firstMethod

NamespaceClass::$property

NamespaceClass::NAMESPACE_CONST

LibraryClassFinal

LibraryClassFinal::firstMethod

LibraryClassFinal::secondMethod

LibraryClassFinal::thirdMethod

LibraryClassFinal::fourthMethod

LibraryClassFinal::fifthMethod

LibraryInterface

LibraryInterface::instanceMethod

NamespaceException

TemplateTrait

TemplateTrait::render()

Test Case - global access

DateTime

DateTime::setTime()

$global_var

SOME_CONSTANT

in_array()

LibraryName\LibraryClass::$property

$property Should not be prefixed with classname.

LibraryName\LibraryClass::TEST_CONST

LibraryName\NS_CONST

DateTimeInterface

DateTimeInterface::setTime()

Any Cross Ref

LibraryName\NS_CONST

DateTimeInterface::setTime()

Nested namespaces

exception LibraryName\SubPackage\ NestedNamespaceException

In a package

class LibraryName\SubPackage\ SubpackageClass

A class in a subpackage

interface LibraryName\SubPackage\ SubpackageInterface

A class in a subpackage

Return Types

class OtherLibrary\ ReturningClass

A class to do some returning.

returnClassFromSameNamespace ( )
Returns:

An object instance of a class from the same namespace.

Return type:

ReturnedClass

returnClassFromOtherNamespace ( )
Returns:

An object instance of a class from another namespace.

Return type:

LibraryName\SubPackage\SubpackageInterface

returnClassConstant ( )
Returns:

The value of a specific class constant.

Return type:

LibraryName\NamespaceClass::NAMESPACE_CONST

returnGlobalConstant ( )
Returns:

The value of a specific global constant. # TODO link is not working without “\”

Return type:

SOME_CONSTANT

returnExceptionInstance ( )
Returns:

An instance of an exception.

Return type:

InvalidArgumentException

returnScalarType ( )
Returns:

A scalar string type.

Return type:

string

returnUnionType ( )
Returns:

Any of a whole bunch of things specified with a PHP 8 union type.

Return type:

int|string|ReturnedClass|\LibraryName\SubPackage\SubpackageInterface|null

class OtherLibrary\ ReturnedClass

A class to return.

Enums

Basic Enumerations

enum Example\Basic\ Suit

In playing cards, a suit is one of the categories into which the cards of a deck are divided.

case Hearts
case Diamonds
case Clubs
case Spades

Backed Enumerations

enum Example\Backed\ Suit string

In playing cards, a suit is one of the categories into which the cards of a deck are divided.

case Hearts 'H'
case Diamonds 'D'
case Clubs 'C'
case Spades 'S'

Advanced Enumerations

enum Example\Advanced\ Suit string

In playing cards, a suit is one of the categories into which the cards of a deck are divided.

case Hearts 'H'
case Diamonds 'D'
case Clubs 'C'
case Spades 'S'
color ( ) string

Returns “red” for hearts and diamonds, “black” for clubs and spades.

static values string[]

Returns an array of the values of all the cases on this enum.

constant Roses Hearts

An alias for Suit::Hearts.

constant Bells Diamonds

An alias for Suit::Diamonds.

constant Acorns Clubs

An alias for Suit::Clubs.

constant Shields Spades

An alias for Suit::Spades.

markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_doc.md000066400000000000000000000300051474704236300246160ustar00rootroot00000000000000```{eval-rst} Acceptance tests for PHPdomain ############################## Globals ======= .. php:global:: $global_var A global variable .. php:const:: SOME_CONSTANT A global constant .. php:const:: VALUE A global constant .. php:function:: in_array(needle, haystack) Checks for needle in haystack. :param needle: The element to search for. :param array haystack: The array to search. :returns: Element exists in array. :returntype: bool Classes ======= .. php:class:: DateTime Datetime class .. php:method:: setDate($year, $month, $day) Set the date in the datetime object :param int $year: The year. :param int $month: The month. :param int $day: The day. .. php:method:: setTime($hour, $minute[, $second]) Set the time :param int $hour: The hour :param int $minute: The minute :param int $second: The second .. php:method:: public static getLastErrors() Returns the warnings and errors :returns: array Returns array containing info about warnings and errors. .. php:const:: ATOM Y-m-d\TH:i:sP .. php:attr:: testattr Value of some attribute .. php:class:: OtherClass Another class .. php:method:: update($arg = '', $arg2 = [], $arg3 = []) Update something. .. php:attr:: nonIndentedAttribute This attribute wasn't indented .. php:const:: NO_INDENT This class constant wasn't indented .. php:staticmethod:: OtherClass::staticMethod() A static method. Exceptions ========== .. php:exception:: InvalidArgumentException Throw when you get an argument that is bad. Interfaces ========== .. php:interface:: DateTimeInterface Datetime interface .. php:method:: setDate($year, $month, $day) Set the date in the datetime object :param int $year: The year. :param int $month: The month. :param int $day: The day. .. php:method:: setTime($hour, $minute[, $second]) Set the time :param int $hour: The hour :param int $minute: The minute :param int $second: The second .. php:const:: ATOM Y-m-d\TH:i:sP .. php:attr:: testattr Value of some attribute .. php:interface:: OtherInterface Another interface Traits ====== .. php:trait:: LogTrait A logging trait .. php:method:: log($level, $string) A method description. More globals after classes ========================== .. php:global:: $other_global_var A global variable .. php:function:: strpos($needle, $haystack) Position of needle in haystack Test Case - Global symbols with no namespaces --------------------------------------------- :php:global:`$global_var` :php:global:`$other_global_var` :php:const:`SOME_CONSTANT` :php:func:`in_array` :php:func:`strpos` :php:class:`DateTime` :php:meth:`DateTime::setTime()` :php:meth:`DateTime::getLastErrors()` :php:meth:`DateTime::setDate()` :php:const:`DateTime::ATOM` :php:attr:`DateTime::$testattr` :php:meth:`OtherClass::update` :php:attr:`OtherClass::$nonIndentedAttribute` :php:const:`OtherClass::NO_INDENT` :php:func:`OtherClass::staticMethod` :php:exc:`InvalidArgumentException` :php:interface:`DateTimeInterface` :php:meth:`DateTimeInterface::setTime()` :php:meth:`~DateTimeInterface::setDate()` :php:const:`DateTimeInterface::ATOM` :php:attr:`DateTimeInterface::$testattr` :php:interface:`OtherInterface` :php:trait:`LogTrait` :php:meth:`LogTrait::log()` Test Case - Prefix less links ----------------------------- The following links should not be prefixed with a classname. :php:meth:`~DateTime::setDate()` :php:attr:`~DateTime::$testattr` Namespaced elements =================== .. php:namespace:: LibraryName .. php:function:: namespaced_function($one[, $two]) A function in a namespace :param string $one: First parameter. :param string $two: Second parameter. .. php:const:: NS_CONST A constant in a namespace .. php:exception:: NamespaceException This exception is in a namespace. .. php:class:: LibraryClass A class in a namespace .. php:method:: LibraryClass::instanceMethod($foo) An instance method .. php:const:: TEST_CONST Test constant .. php:attr:: property A property! .. php:staticmethod:: LibraryClass::staticMethod() A static method in a namespace .. php:class:: NamespaceClass A class in the namespace, no indenting on children .. php:method:: firstMethod($one, $two) A normal instance method. .. php:attr:: property A property .. php:const:: NAMESPACE_CONST Const on class in namespace .. php:staticmethod:: namespaceStatic($foo) A static method here. .. php:class:: final LibraryClassFinal A final class .. php:method:: public firstMethod($one, $two) A public instance method. .. php:method:: protected secondMethod($one, $two) A protected instance method. .. php:method:: private thirdMethod($one, $two) A private instance method. .. php:method:: static fourthMethod($one, $two) A static method. .. php:method:: protected final fifthMethod($one, $two) A protected final method. .. php:class:: abstract LibraryClassAbstract An abstract class .. php:interface:: LibraryInterface A interface in a namespace .. php:method:: instanceMethod($foo) An instance method .. php:trait:: TemplateTrait A trait in a namespace .. php:method:: render($template) Render a template. Test Case - not including namespace ----------------------------------- Within a namespace context you don't need to include the namespace in links. :php:ns:`LibraryName` :php:func:`namespaced_function()` :php:const:`NS_CONST` :php:class:`LibraryClass` :php:func:`LibraryClass::instanceMethod` :php:func:`LibraryClass::staticMethod()` :php:attr:`LibraryClass::$property` :php:const:`LibraryClass::TEST_CONST` :php:class:`OtherClass` :php:class:`ThirdClass` :php:class:`NamespaceClass` :php:func:`NamespaceClass::firstMethod` :php:attr:`NamespaceClass::$property` :php:const:`NamespaceClass::NAMESPACE_CONST` :php:class:`LibraryClassFinal` :php:meth:`LibraryClassFinal::firstMethod` :php:meth:`LibraryClassFinal::secondMethod` :php:meth:`LibraryClassFinal::thirdMethod` :php:meth:`LibraryClassFinal::fourthMethod` :php:meth:`LibraryClassFinal::fifthMethod` :php:interface:`LibraryInterface` :php:func:`LibraryInterface::instanceMethod` :php:exc:`NamespaceException` :php:trait:`TemplateTrait` :php:meth:`TemplateTrait::render()` Test Case - Links with prefix trimming -------------------------------------- All of the following links should not be prefixed with a namespace. :php:interface:`~LibraryInterface` :php:class:`~LibraryClass` :php:trait:`~TemplateTrait` :php:exc:`~NamespaceException` All of the following links should not be prefixed with a classname. :php:func:`~LibraryClass::instanceMethod` :php:const:`~LibraryClass::TEST_CONST` :php:attr:`~LibraryClass::$property` Test Case - global access ------------------------- :php:class:`\\DateTime` :php:func:`\\DateTime::setTime()` :php:global:`$global_var` :php:const:`SOME_CONSTANT` :php:func:`in_array()` :php:attr:`\\LibraryName\\LibraryClass::$property` :php:attr:`~\\LibraryName\\LibraryClass::$property` Should not be prefixed with classname. :php:const:`\\LibraryName\\LibraryClass::TEST_CONST` :php:const:`\\LibraryName\\NS_CONST` :php:interface:`\\DateTimeInterface` :php:func:`\\DateTimeInterface::setTime()` Any Cross Ref ============= :any:`LibraryName\\NS_CONST` :any:`DateTimeInterface::setTime()` Nested namespaces ================= .. php:namespace:: LibraryName\SubPackage .. php:exception:: NestedNamespaceException In a package .. php:class:: SubpackageClass A class in a subpackage .. php:interface:: SubpackageInterface A class in a subpackage Test Case - Test subpackage links --------------------------------- :php:ns:`LibraryName\\SubPackage` :php:ns:`\\LibraryName\\SubPackage` :php:class:`SubpackageClass` :php:class:`\\LibraryName\\SubPackage\\SubpackageClass` :php:interface:`SubpackageInterface` :php:class:`\\LibraryName\\SubPackage\\SubpackageInterface` :php:exc:`NestedNamespaceException` :php:exc:`\\LibraryName\\SubPackage\\NestedNamespaceException` Return Types ============ .. php:namespace:: OtherLibrary .. php:class:: ReturningClass A class to do some returning. .. php:method:: returnClassFromSameNamespace() :returns: An object instance of a class from the same namespace. :returntype: ReturnedClass .. php:method:: returnClassFromOtherNamespace() :returns: An object instance of a class from another namespace. :returntype: \\LibraryName\\SubPackage\\SubpackageInterface .. php:method:: returnClassConstant() :returns: The value of a specific class constant. :returntype: \\LibraryName\\NamespaceClass::NAMESPACE_CONST .. php:method:: returnGlobalConstant() :returns: The value of a specific global constant. # TODO link is not working without "\\" :returntype: SOME_CONSTANT .. php:method:: returnExceptionInstance() :returns: An instance of an exception. :returntype: \\InvalidArgumentException .. php:method:: returnScalarType() :returns: A scalar string type. :returntype: string .. php:method:: returnUnionType() :returns: Any of a whole bunch of things specified with a PHP 8 union type. :returntype: int|string|ReturnedClass|\\LibraryName\\SubPackage\\SubpackageInterface|null .. php:class:: ReturnedClass A class to return. Enums ===== Basic Enumerations ------------------ .. php:namespace:: Example\Basic .. php:enum:: Suit In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts .. php:case:: Diamonds .. php:case:: Clubs .. php:case:: Spades Backed Enumerations ------------------- .. php:namespace:: Example\Backed .. php:enum:: Suit : string In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts : 'H' .. php:case:: Diamonds : 'D' .. php:case:: Clubs : 'C' .. php:case:: Spades : 'S' Advanced Enumerations --------------------- .. php:namespace:: Example\Advanced .. php:enum:: Suit : string In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts : 'H' .. php:case:: Diamonds : 'D' .. php:case:: Clubs : 'C' .. php:case:: Spades : 'S' .. php:method:: color() -> string Returns "red" for hearts and diamonds, "black" for clubs and spades. .. php:staticmethod:: values() -> string[] Returns an array of the values of all the cases on this enum. .. php:const:: Roses() : Hearts An alias for :php:case:`Suit::Hearts`. .. php:const:: Bells : Diamonds An alias for :php:case:`Suit::Diamonds`. .. php:const:: Acorns : Clubs An alias for :php:case:`Suit::Clubs`. .. php:const:: Shields : Spades An alias for :php:case:`Suit::Spades`. Enumeration Links ----------------- Links to Basic Enumeration Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :php:enum:`\\Example\\Basic\\Suit` :php:case:`\\Example\\Basic\\Suit::Hearts` :php:case:`\\Example\\Basic\\Suit::Diamonds` :php:case:`\\Example\\Basic\\Suit::Clubs` :php:case:`\\Example\\Basic\\Suit::Spades` Links to Backed Enumeration Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :php:enum:`\\Example\\Backed\\Suit` :php:case:`\\Example\\Backed\\Suit::Hearts` :php:case:`\\Example\\Backed\\Suit::Diamonds` :php:case:`\\Example\\Backed\\Suit::Clubs` :php:case:`\\Example\\Backed\\Suit::Spades` Links to Advanced Enumeration Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :php:enum:`Suit` :php:case:`Suit::Hearts` :php:case:`Suit::Diamonds` :php:case:`Suit::Clubs` :php:case:`Suit::Spades` :php:meth:`Suit::color` :php:meth:`Suit::values` :php:const:`Suit::Roses` :php:const:`Suit::Bells` :php:const:`Suit::Acorns` :php:const:`Suit::Shields` ``` markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_doc2.html000066400000000000000000000125551474704236300252560ustar00rootroot00000000000000

Top Level Namespace

namespace Imagine\Draw

class Imagine\Draw\ DrawerInterface

Instance of this interface is returned by Imagine\Image\ImageInterface::draw.

Imagine\Draw\DrawerInterface::arc(PointInterface$center, BoxInterface$size, $start, $end, Color$color)

Draws an arc on a starting at a given x, y coordinates under a given start and end angles

Parameters:
  • $center (Imagine\Image\PointInterface) – Center of the arc.

  • $size (Imagine\Image\BoxInterface) – Size of the bounding box.

  • $start (int) – Start angle.

  • $end (int) – End angle.

  • $color (Imagine\Image\Color) – Line color.

Throws:

\Imagine\Exception\RuntimeException

Returns:

DrawerInterface

Re-used namespace

No indexing errors or links should point to this namespace.

class LibraryName\ ThirdClass

Another class in a currentmodule block

No indexing errors or links should point to this namespace.

class LibraryName\ OtherClass

Another class in a reused namespace

markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_doc2.md000066400000000000000000000022131474704236300247000ustar00rootroot00000000000000```{eval-rst} Top Level Namespace ################### namespace ``Imagine\Draw`` .. php:namespace:: Imagine\Draw .. php:class:: DrawerInterface Instance of this interface is returned by :php:meth:`\\Imagine\\Image\\ImageInterface::draw`. .. php:method:: arc(PointInterface $center, BoxInterface $size, $start, $end, Color $color) Draws an arc on a starting at a given x, y coordinates under a given start and end angles :param \\Imagine\\Image\\PointInterface $center: Center of the arc. :param \\Imagine\\Image\\BoxInterface $size: Size of the bounding box. :param int $start: Start angle. :param int $end: End angle. :param \\Imagine\\Image\\Color $color: Line color. :throws: \\Imagine\\Exception\\RuntimeException :returns: DrawerInterface Re-used namespace ================= .. php:currentmodule:: LibraryName No indexing errors or links should point to this namespace. .. php:class:: ThirdClass Another class in a currentmodule block .. php:currentnamespace:: LibraryName No indexing errors or links should point to this namespace. .. php:class:: OtherClass Another class in a reused namespace ``` markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_index.html000066400000000000000000000107521474704236300255330ustar00rootroot00000000000000

Welcome to sphinxcontrib-phpdomain-acceptancetest’s documentation!

Contents:

Indices and tables

markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_index.md000066400000000000000000000005201474704236300251570ustar00rootroot00000000000000```{eval-rst} Welcome to sphinxcontrib-phpdomain-acceptancetest's documentation! =================================================================== Contents: .. toctree:: :maxdepth: 2 rst_doc rst_doc2 rst_nesting_regression Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ``` markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_nesting_regression.html000066400000000000000000000052061474704236300303310ustar00rootroot00000000000000

Nested method Regression

Test nested methods to ensure page generation doesn’t hard fail.

Largo_Byline:: populate_variables ( )

Set us up the vars

  • ‘post_id’: an integer post ID

  • ‘exclude_date’: boolean whether or not to include the date in the byline

param array $args:

Associative array containing following keys:

Largo_Byline:: generate_byline ( )

this creates the byline text and adds it to $this->output

See:

$output $reates this

markstory-sphinxcontrib-phpdomain-04c2251/test/myst/rst_nesting_regression.md000066400000000000000000000010631474704236300277620ustar00rootroot00000000000000```{eval-rst} Nested method Regression ======================== Test nested methods to ensure page generation doesn't hard fail. .. php:method:: Largo_Byline::populate_variables() Set us up the vars - 'post_id': an integer post ID - 'exclude_date': boolean whether or not to include the date in the byline :param array $args: Associative array containing following keys: .. php:method:: Largo_Byline::generate_byline() this creates the byline text and adds it to $this->output :see: $output $reates this ``` markstory-sphinxcontrib-phpdomain-04c2251/test/unit/000077500000000000000000000000001474704236300226245ustar00rootroot00000000000000markstory-sphinxcontrib-phpdomain-04c2251/test/unit/Makefile000066400000000000000000000037541474704236300242750ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest .PHONY: comparehtml help: @echo "Please use \`make ' where is one of" @echo " clean clean up test build artifacts" @echo " html to make standalone HTML files" @echo " linkcheck to check all external links for integrity" @echo " comparehtml compare build/html with snapshots (for test regressions)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." # get all test cases test_sources = $(shell find . -name '*.rst') # replace .rst with .html test_html = $(notdir $(test_sources:.rst=.html)) $(BUILDDIR)/html/%.result: $(BUILDDIR)/html/% # create 'result' xml files from the generated html, but only capture role=main # to keep fixtures easier to manage. xmllint $(BUILDDIR)/html/$* --xpath '//div[@role="main"]' | xmllint --format - > $(BUILDDIR)/html/$*.result compareresult-%: # compare test_doc.html and test_doc.html.result diff -u $* $(BUILDDIR)/html/$*.result # generate dependency lists to contain iteration generateresults: $(foreach build_html, $(test_html), $(BUILDDIR)/html/$(build_html).result) compareresults: $(foreach build_html, $(test_html), compareresult-$(build_html)) # run from ci tooling comparehtml: generateresults compareresults linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." markstory-sphinxcontrib-phpdomain-04c2251/test/unit/conf.py000066400000000000000000000160351474704236300241300ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # sphinxcontrib-rubydomain-acceptancetest documentation build configuration file, created by # sphinx-quickstart on Sun Apr 25 13:27:18 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.append(os.path.abspath("..")) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = "1.0" # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ["sphinxcontrib.phpdomain"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] # The suffix of source filenames. source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = "index" # General information about the project. project = "sphinxcontrib-phpdomain-acceptancetest" copyright = "2011, Mark Story" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = "0.1" # The full version, including alpha/beta/rc tags. release = "0.1" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ["_build"] # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. html_theme = "default" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = "sphinxcontrib-phpdomain-acceptancetestdoc" # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). # latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). # latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ( "index", "sphinxcontrib-phpdomain-acceptancetest.tex", "sphinxcontrib-phpdomain-acceptancetest Documentation", "Mark Story", "manual", ), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # Additional stuff for the LaTeX preamble. # latex_preamble = '' # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ( "index", "sphinxcontrib-phpdomain-acceptancetest", "sphinxcontrib-phpdomain-acceptancetest Documentation", ["Mark Story"], 1, ) ] markstory-sphinxcontrib-phpdomain-04c2251/test/unit/index.html000066400000000000000000000144301474704236300246230ustar00rootroot00000000000000

Welcome to sphinxcontrib-phpdomain-acceptancetest’s documentation!

Contents:

Indices and tables

markstory-sphinxcontrib-phpdomain-04c2251/test/unit/index.rst000066400000000000000000000004401474704236300244630ustar00rootroot00000000000000Welcome to sphinxcontrib-phpdomain-acceptancetest's documentation! =================================================================== Contents: .. toctree:: :maxdepth: 2 :glob: * Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` markstory-sphinxcontrib-phpdomain-04c2251/test/unit/method.html000066400000000000000000000041201474704236300247670ustar00rootroot00000000000000

Simple method

class Foo
Foo::test($a, ...$args)

Simple test method.

Parameters:
  • $args (array) – Associative array

Cross linking

markstory-sphinxcontrib-phpdomain-04c2251/test/unit/method.rst000066400000000000000000000003201474704236300246310ustar00rootroot00000000000000Simple method ############# .. php:class:: Foo .. php:method:: test($a, ...$args) Simple test method. :param array $args: Associative array Cross linking ============= - :php:meth:`Foo::test()` markstory-sphinxcontrib-phpdomain-04c2251/test/unit/ns.html000066400000000000000000000033251474704236300241350ustar00rootroot00000000000000

Simple NS

class Foo\ A
Foo\A:: simplify ( )

Cross linking

markstory-sphinxcontrib-phpdomain-04c2251/test/unit/ns.rst000066400000000000000000000002221474704236300237720ustar00rootroot00000000000000Simple NS ######### .. php:namespace:: Foo .. php:class:: A .. php:method:: simplify() Cross linking ============= - :php:meth:`A::simplify` markstory-sphinxcontrib-phpdomain-04c2251/test/unit/test_doc.html000066400000000000000000003045601474704236300253260ustar00rootroot00000000000000

Acceptance tests for PHPdomain

Globals

$global_var

A global variable

constant SOME_CONSTANT

A global constant

constant VALUE

A global constant

in_array(needle, haystack)

Checks for needle in haystack.

Parameters:
  • needle – The element to search for.

  • haystack (array) – The array to search.

Returns:

Element exists in array.

Return type:

boolean

Classes

class DateTime

Datetime class

setDate($year, $month, $day)

Set the date in the datetime object

Parameters:
  • $year (int) – The year.

  • $month (int) – The month.

  • $day (int) – The day.

setTime($hour, $minute[, $second])

Set the time. See setDate() for changing the date.

Parameters:
  • $hour (int) – The hour

  • $minute (int) – The minute

  • $second (int) – The second

public static getLastErrors ( )

Returns the warnings and errors

Returns:

array Returns array containing info about warnings and errors.

constant ATOM

Y-m-dTH:i:sP

property testattr

Value of some attribute

class OtherClass

Another class

OtherClass::update($arg='', $arg2=[], $arg3=[])

Update something.

property OtherClass::$ nonIndentedAttribute

This attribute wasn’t indented

constant OtherClass:: NO_INDENT

This class constant wasn’t indented

static OtherClass:: staticMethod

A static method.

Exceptions

exception InvalidArgumentException

Throw when you get an argument that is bad.

Interfaces

interface DateTimeInterface

Datetime interface

setDate($year, $month, $day)

Set the date in the datetime object

Parameters:
  • $year (int) – The year.

  • $month (int) – The month.

  • $day (int) – The day.

setTime($hour, $minute[, $second])

Set the time

Parameters:
  • $hour (int) – The hour

  • $minute (int) – The minute

  • $second (int) – The second

constant ATOM

Y-m-dTH:i:sP

property testattr

Value of some attribute

interface OtherInterface

Another interface

Traits

trait LogTrait

A logging trait

log($level, $string)

A method description.

More globals after classes

$other_global_var

A global variable

strpos($needle, $haystack)

Position of needle in haystack

Test Case - Global symbols with no namespaces

$global_var

$other_global_var

SOME_CONSTANT

in_array

strpos

DateTime

DateTime::setTime()

DateTime::getLastErrors()

DateTime::setDate()

DateTime::ATOM

DateTime::$testattr

OtherClass::update

OtherClass::$nonIndentedAttribute

OtherClass::NO_INDENT

OtherClass::staticMethod

InvalidArgumentException

DateTimeInterface

DateTimeInterface::setTime()

setDate()

DateTimeInterface::ATOM

DateTimeInterface::$testattr

OtherInterface

LogTrait

LogTrait::log()

Namespaced elements

namespaced_function($one[, $two])

A function in a namespace

Parameters:
  • $one (string) – First parameter.

  • $two (string) – Second parameter.

constant LibraryName\ NS_CONST

A constant in a namespace

exception LibraryName\ NamespaceException

This exception is in a namespace.

class LibraryName\ LibraryClass

A class in a namespace

LibraryClass:: instanceMethod ( $foo )

An instance method

constant TEST_CONST

Test constant

property property

A property!

static LibraryName\LibraryClass:: staticMethod

A static method in a namespace

class LibraryName\ NamespaceClass

A class in the namespace, no indenting on children

LibraryName\NamespaceClass::firstMethod($one, $two)

A normal instance method.

property LibraryName\NamespaceClass::$ property

A property

constant LibraryName\NamespaceClass:: NAMESPACE_CONST

Const on class in namespace

static LibraryName\NamespaceClass:: namespaceStatic ( $foo )

A static method here.

final class LibraryName\ LibraryClassFinal

A final class

publicLibraryName\LibraryClassFinal::firstMethod($one, $two)

A public instance method.

protectedLibraryName\LibraryClassFinal::secondMethod($one, $two)

A protected instance method.

privateLibraryName\LibraryClassFinal::thirdMethod($one, $two)

A private instance method.

staticLibraryName\LibraryClassFinal::fourthMethod($one, $two)

A static method.

protectedfinalLibraryName\LibraryClassFinal::fifthMethod($one, $two)

A protected final method.

abstract class LibraryName\ LibraryClassAbstract

An abstract class

interface LibraryName\ LibraryInterface

A interface in a namespace

instanceMethod ( $foo )

An instance method

trait LibraryName\ TemplateTrait

A trait in a namespace

render ( $template )

Render a template.

Test Case - not including namespace

Within a namespace context you don’t need to include the namespace in links.

LibraryName

namespaced_function()

NS_CONST

LibraryClass

LibraryClass::instanceMethod

LibraryClass::staticMethod()

LibraryClass::$property

LibraryClass::TEST_CONST

LibraryName\OtherClass

LibraryName\ThirdClass

NamespaceClass

NamespaceClass::firstMethod

NamespaceClass::$property

LibraryName\LibraryInterface

LibraryName\NamespaceException

TemplateTrait

LibraryName\TemplateTrait

LibraryName\TemplateTrait::render()

Test Case - global access

DateTime

DateTime::setTime()

$global_var

SOME_CONSTANT

LibraryName\LibraryClass::TEST_CONST

LibraryName\NS_CONST

DateTimeInterface

DateTimeInterface::setTime()

LibraryName\LibraryClass::$property

Should not be prefixed with classname.

$property

Any Cross Ref

LibraryName\NS_CONST

DateTimeInterface::setTime()

Nested namespaces

exception LibraryName\SubPackage\ NestedNamespaceException

In a package

class LibraryName\SubPackage\ SubpackageClass

A class in a subpackage

interface LibraryName\SubPackage\ SubpackageInterface

A class in a subpackage

Return Types

class OtherLibrary\ ReturningClass

A class to do some returning.

returnClassFromSameNamespace ( )
Returns:

An object instance of a class from the same namespace.

Return type:

OtherLibrary\ReturnedClass

returnClassFromOtherNamespace ( )
Returns:

An object instance of a class from another namespace.

Return type:

LibraryName\SubPackage\SubpackageInterface

returnClassConstant ( )
Returns:

The value of a specific class constant.

Return type:

LibraryName\NamespaceClass::NAMESPACE_CONST

returnGlobalConstant ( )
Returns:

The value of a specific global constant.

Return type:

SOME_CONSTANT

returnExceptionInstance ( )
Returns:

An instance of an exception.

Return type:

InvalidArgumentException

returnScalarType ( )
Returns:

A scalar string type.

Return type:

string

returnUnionType ( )
Returns:

Any of a whole bunch of things specified with a PHP 8 union type.

Return type:

int|string|OtherLibrary\ReturnedClass|LibraryName\SubPackage\SubpackageInterface|null

class OtherLibrary\ ReturnedClass

A class to return.

Enums

Basic Enumerations

enum Example\Basic\ Suit

In playing cards, a suit is one of the categories into which the cards of a deck are divided.

case Hearts
case Diamonds
case Clubs
case Spades

Backed Enumerations

enum Example\Backed\ Suit string

In playing cards, a suit is one of the categories into which the cards of a deck are divided.

case Hearts 'H'
case Diamonds 'D'
case Clubs 'C'
case Spades 'S'

Advanced Enumerations

enum Example\Advanced\ Suit string

In playing cards, a suit is one of the categories into which the cards of a deck are divided.

case Hearts 'H'
case Diamonds 'D'
case Clubs 'C'
case Spades 'S'
color ( ) string

Returns “red” for hearts and diamonds, “black” for clubs and spades.

static values string[]

Returns an array of the values of all the cases on this enum.

constant Roses Hearts

An alias for Example\Advanced\Suit::Hearts.

constant Bells Diamonds

An alias for Example\Advanced\Suit::Diamonds.

constant Acorns Clubs

An alias for Example\Advanced\Suit::Clubs.

constant Shields Spades

An alias for Example\Advanced\Suit::Spades.

markstory-sphinxcontrib-phpdomain-04c2251/test/unit/test_doc.rst000066400000000000000000000300161474704236300251620ustar00rootroot00000000000000Acceptance tests for PHPdomain ############################## Globals ======= .. php:global:: $global_var A global variable .. php:const:: SOME_CONSTANT A global constant .. php:const:: VALUE A global constant .. php:function:: in_array(needle, haystack) Checks for needle in haystack. :param needle: The element to search for. :param array haystack: The array to search. :returns: Element exists in array. :returntype: boolean Classes ======= .. php:class:: DateTime Datetime class .. php:method:: setDate($year, $month, $day) Set the date in the datetime object :param int $year: The year. :param int $month: The month. :param int $day: The day. .. php:method:: setTime($hour, $minute[, $second]) Set the time. See :php:func:`setDate()` for changing the date. :param int $hour: The hour :param int $minute: The minute :param int $second: The second .. php:method:: public static getLastErrors() Returns the warnings and errors :returns: array Returns array containing info about warnings and errors. .. php:const:: ATOM Y-m-d\TH:i:sP .. php:attr:: testattr Value of some attribute .. php:class:: OtherClass Another class .. php:method:: update($arg = '', $arg2 = [], $arg3 = []) Update something. .. php:attr:: nonIndentedAttribute This attribute wasn't indented .. php:const:: NO_INDENT This class constant wasn't indented .. php:staticmethod:: OtherClass::staticMethod() A static method. Exceptions ========== .. php:exception:: InvalidArgumentException Throw when you get an argument that is bad. Interfaces ========== .. php:interface:: DateTimeInterface Datetime interface .. php:method:: setDate($year, $month, $day) Set the date in the datetime object :param int $year: The year. :param int $month: The month. :param int $day: The day. .. php:method:: setTime($hour, $minute[, $second]) Set the time :param int $hour: The hour :param int $minute: The minute :param int $second: The second .. php:const:: ATOM Y-m-d\TH:i:sP .. php:attr:: testattr Value of some attribute .. php:interface:: OtherInterface Another interface Traits ====== .. php:trait:: LogTrait A logging trait .. php:method:: log($level, $string) A method description. More globals after classes ========================== .. php:global:: $other_global_var A global variable .. php:global:: strpos($needle, $haystack) Position of needle in haystack Test Case - Global symbols with no namespaces --------------------------------------------- :php:global:`$global_var` :php:global:`$other_global_var` :php:const:`SOME_CONSTANT` :php:func:`in_array` :php:func:`strpos` :php:class:`DateTime` :php:func:`DateTime::setTime()` :php:func:`DateTime::getLastErrors()` :php:func:`DateTime::setDate()` :php:func:`DateTime::ATOM` :php:func:`DateTime::$testattr` :php:func:`OtherClass::update` :php:attr:`OtherClass::$nonIndentedAttribute` :php:const:`OtherClass::NO_INDENT` :php:func:`OtherClass::staticMethod` :php:exc:`InvalidArgumentException` :php:interface:`DateTimeInterface` :php:func:`DateTimeInterface::setTime()` :php:func:`~DateTimeInterface::setDate()` :php:func:`DateTimeInterface::ATOM` :php:func:`DateTimeInterface::$testattr` :php:func:`OtherInterface` :php:trait:`LogTrait` :php:func:`LogTrait::log()` Test Case - Prefix less links ----------------------------- The following links should not be prefixed with a classname. :php:func:`~DateTime::setDate()` :php:attr:`~DateTime::$testattr` Namespaced elements =================== .. php:namespace:: LibraryName .. php:function:: namespaced_function($one[, $two]) A function in a namespace :param string $one: First parameter. :param string $two: Second parameter. .. php:const:: NS_CONST A constant in a namespace .. php:exception:: NamespaceException This exception is in a namespace. .. php:class:: LibraryClass A class in a namespace .. php:method:: LibraryClass::instanceMethod($foo) An instance method .. php:const:: TEST_CONST Test constant .. php:attr:: property A property! .. php:staticmethod:: LibraryClass::staticMethod() A static method in a namespace .. php:class:: NamespaceClass A class in the namespace, no indenting on children .. php:method:: firstMethod($one, $two) A normal instance method. .. php:attr:: property A property .. php:const:: NAMESPACE_CONST Const on class in namespace .. php:staticmethod:: namespaceStatic($foo) A static method here. .. php:class:: final LibraryClassFinal A final class .. php:method:: public firstMethod($one, $two) A public instance method. .. php:method:: protected secondMethod($one, $two) A protected instance method. .. php:method:: private thirdMethod($one, $two) A private instance method. .. php:method:: static fourthMethod($one, $two) A static method. .. php:method:: protected final fifthMethod($one, $two) A protected final method. .. php:class:: abstract LibraryClassAbstract An abstract class .. php:interface:: LibraryInterface A interface in a namespace .. php:method:: instanceMethod($foo) An instance method .. php:trait:: TemplateTrait A trait in a namespace .. php:method:: render($template) Render a template. Test Case - not including namespace ----------------------------------- Within a namespace context you don't need to include the namespace in links. :php:ns:`LibraryName` :php:func:`namespaced_function()` :php:const:`NS_CONST` :php:class:`LibraryClass` :php:func:`LibraryClass::instanceMethod` :php:func:`LibraryClass::staticMethod()` :php:attr:`LibraryClass::$property` :php:const:`LibraryClass::TEST_CONST` :php:class:`LibraryName\\OtherClass` :php:class:`LibraryName\\ThirdClass` :php:class:`NamespaceClass` :php:func:`NamespaceClass::firstMethod` :php:attr:`NamespaceClass::$property` :php:interface:`LibraryName\\LibraryInterface` :php:exc:`LibraryName\\NamespaceException` :php:trait:`TemplateTrait` :php:trait:`LibraryName\\TemplateTrait` :php:func:`LibraryName\\TemplateTrait::render()` Test Case - Links with prefix trimming -------------------------------------- All of the following links should not be prefixed with a namespace. :php:interface:`~LibraryName\\LibraryInterface` :php:class:`~LibraryName\\LibraryClass` :php:trait:`~LibraryName\\TemplateTrait` :php:exc:`~LibraryName\\NamespaceException` All of the following links should not be prefixed with a classname. :php:func:`~LibraryClass::instanceMethod` :php:const:`~LibraryClass::TEST_CONST` :php:attr:`~LibraryClass::$property` Test Case - global access ------------------------- :php:class:`DateTime` :php:func:`DateTime::setTime()` :php:global:`$global_var` :php:const:`SOME_CONSTANT` :php:const:`LibraryName\\LibraryClass::TEST_CONST` :php:const:`LibraryName\\NS_CONST` :php:interface:`DateTimeInterface` :php:func:`DateTimeInterface::setTime()` :php:attr:`LibraryName\\LibraryClass::$property` Should not be prefixed with classname. :php:attr:`~LibraryName\\LibraryClass::$property` Any Cross Ref ============= :any:`LibraryName\\NS_CONST` :any:`DateTimeInterface::setTime()` Nested namespaces ================= .. php:namespace:: LibraryName\SubPackage .. php:exception:: NestedNamespaceException In a package .. php:class:: SubpackageClass A class in a subpackage .. php:interface:: SubpackageInterface A class in a subpackage Test Case - Test subpackage links --------------------------------- :php:ns:`LibraryName\\SubPackage` :php:class:`SubpackageClass` :php:class:`LibraryName\\SubPackage\\SubpackageClass` :php:interface:`SubpackageInterface` :php:class:`LibraryName\\SubPackage\\SubpackageInterface` :php:exc:`LibraryName\\SubPackage\\NestedNamespaceException` :php:func:`LibraryName\\namespaced_function` Return Types ============ .. php:namespace:: OtherLibrary .. php:class:: ReturningClass A class to do some returning. .. php:method:: returnClassFromSameNamespace() :returns: An object instance of a class from the same namespace. :returntype: OtherLibrary\\ReturnedClass .. php:method:: returnClassFromOtherNamespace() :returns: An object instance of a class from another namespace. :returntype: LibraryName\\SubPackage\\SubpackageInterface .. php:method:: returnClassConstant() :returns: The value of a specific class constant. :returntype: LibraryName\\NamespaceClass::NAMESPACE_CONST .. php:method:: returnGlobalConstant() :returns: The value of a specific global constant. :returntype: SOME_CONSTANT .. php:method:: returnExceptionInstance() :returns: An instance of an exception. :returntype: InvalidArgumentException .. php:method:: returnScalarType() :returns: A scalar string type. :returntype: string .. php:method:: returnUnionType() :returns: Any of a whole bunch of things specified with a PHP 8 union type. :returntype: int|string|OtherLibrary\\ReturnedClass|LibraryName\\SubPackage\\SubpackageInterface|null .. php:class:: ReturnedClass A class to return. Enums ===== Basic Enumerations ------------------ .. php:namespace:: Example\Basic .. php:enum:: Suit In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts .. php:case:: Diamonds .. php:case:: Clubs .. php:case:: Spades Backed Enumerations ------------------- .. php:namespace:: Example\Backed .. php:enum:: Suit : string In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts : 'H' .. php:case:: Diamonds : 'D' .. php:case:: Clubs : 'C' .. php:case:: Spades : 'S' Advanced Enumerations --------------------- .. php:namespace:: Example\Advanced .. php:enum:: Suit : string In playing cards, a suit is one of the categories into which the cards of a deck are divided. .. php:case:: Hearts : 'H' .. php:case:: Diamonds : 'D' .. php:case:: Clubs : 'C' .. php:case:: Spades : 'S' .. php:method:: color() -> string Returns "red" for hearts and diamonds, "black" for clubs and spades. .. php:staticmethod:: values() -> string[] Returns an array of the values of all the cases on this enum. .. php:const:: Roses() : Hearts An alias for :php:case:`Example\\Advanced\\Suit::Hearts`. .. php:const:: Bells : Diamonds An alias for :php:case:`Example\\Advanced\\Suit::Diamonds`. .. php:const:: Acorns : Clubs An alias for :php:case:`Example\\Advanced\\Suit::Clubs`. .. php:const:: Shields : Spades An alias for :php:case:`Example\\Advanced\\Suit::Spades`. Enumeration Links ----------------- Links to Basic Enumeration Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :php:enum:`Example\\Basic\\Suit` :php:case:`Example\\Basic\\Suit::Hearts` :php:case:`Example\\Basic\\Suit::Diamonds` :php:case:`Example\\Basic\\Suit::Clubs` :php:case:`Example\\Basic\\Suit::Spades` Links to Backed Enumeration Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :php:enum:`Example\\Backed\\Suit` :php:case:`Example\\Backed\\Suit::Hearts` :php:case:`Example\\Backed\\Suit::Diamonds` :php:case:`Example\\Backed\\Suit::Clubs` :php:case:`Example\\Backed\\Suit::Spades` Links to Advanced Enumeration Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :php:enum:`Example\\Advanced\\Suit` :php:case:`Example\\Advanced\\Suit::Hearts` :php:case:`Example\\Advanced\\Suit::Diamonds` :php:case:`Example\\Advanced\\Suit::Clubs` :php:case:`Example\\Advanced\\Suit::Spades` :php:meth:`Example\\Advanced\\Suit::color` :php:meth:`Example\\Advanced\\Suit::values` :php:const:`Example\\Advanced\\Suit::Roses` :php:const:`Example\\Advanced\\Suit::Bells` :php:const:`Example\\Advanced\\Suit::Acorns` :php:const:`Example\\Advanced\\Suit::Shields` markstory-sphinxcontrib-phpdomain-04c2251/test/unit/test_doc2.html000066400000000000000000000161271474704236300254070ustar00rootroot00000000000000

Top Level Namespace

namespace Imagine\Draw

class Imagine\Draw\ DrawerInterface

Instance of this interface is returned by ImagineImageImageInterface::draw.

Imagine\Draw\DrawerInterface::arc(PointInterface$center, BoxInterface$size, $start, $end, Color$color)

Draws an arc on a starting at a given x, y coordinates under a given start and end angles

Parameters:
  • $center (ImagineImagePointInterface) – Center of the arc.

  • $size (ImagineImageBoxInterface) – Size of the bounding box.

  • $start (integer) – Start angle.

  • $end (integer) – End angle.

  • $color (ImagineImageColor) – Line color.

Throws:

ImagineExceptionRuntimeException

Returns:

ImagineDrawDrawerInterface

Re-used namespace

No indexing errors or links should point to this namespace.

class LibraryName\ ThirdClass

Another class in a currentmodule block

No indexing errors or links should point to this namespace.

class LibraryName\ OtherClass

Another class in a reused namespace

class Foo\Data\Thing

A class is with an absolute namespace.

markstory-sphinxcontrib-phpdomain-04c2251/test/unit/test_doc2.rst000066400000000000000000000026101474704236300252430ustar00rootroot00000000000000Top Level Namespace ################### namespace ``Imagine\Draw`` .. php:namespace:: Imagine\Draw .. php:class:: DrawerInterface Instance of this interface is returned by :php:meth:`Imagine\Image\ImageInterface::draw`. .. php:method:: arc(PointInterface $center, BoxInterface $size, $start, $end, Color $color) Draws an arc on a starting at a given x, y coordinates under a given start and end angles :param Imagine\Image\PointInterface $center: Center of the arc. :param Imagine\Image\BoxInterface $size: Size of the bounding box. :param integer $start: Start angle. :param integer $end: End angle. :param Imagine\Image\Color $color: Line color. :throws: Imagine\Exception\RuntimeException :returns: Imagine\Draw\DrawerInterface Re-used namespace ================= .. php:currentmodule:: LibraryName No indexing errors or links should point to this namespace. .. php:class:: ThirdClass Another class in a currentmodule block .. php:currentnamespace:: LibraryName No indexing errors or links should point to this namespace. .. php:class:: OtherClass Another class in a reused namespace .. php:class:: \Foo\Data\Thing A class is with an absolute namespace. Test link generation ==================== :php:class:`Imagine\\Draw\\DrawerInterface` :php:class:`LibraryName\\OtherClass` :php:class:`LibraryName\\ThirdClass` :php:class:`Foo\\Data\\Thing` markstory-sphinxcontrib-phpdomain-04c2251/test/unit/test_nesting_regression.html000066400000000000000000000051671474704236300304710ustar00rootroot00000000000000

Nested method Regression

Test nested methods to ensure page generation doesn’t hard fail.

Largo_Byline:: populate_variables ( )

Set us up the vars

  • ‘post_id’: an integer post ID

  • ‘exclude_date’: boolean whether or not to include the date in the byline

param array $args:

Associative array containing following keys:

Largo_Byline:: generate_byline ( )

this creates the byline text and adds it to $this->output

See:

$output $reates this

markstory-sphinxcontrib-phpdomain-04c2251/test/unit/test_nesting_regression.rst000066400000000000000000000010411474704236300303200ustar00rootroot00000000000000Nested method Regression ======================== Test nested methods to ensure page generation doesn't hard fail. .. php:method:: Largo_Byline::populate_variables() Set us up the vars - 'post_id': an integer post ID - 'exclude_date': boolean whether or not to include the date in the byline :param array $args: Associative array containing following keys: .. php:method:: Largo_Byline::generate_byline() this creates the byline text and adds it to $this->output :see: $output $reates this