$this->cchunk["fieldsynopsis"]["modifier"] was not set for atrributes due to the early return, but this value is needed in order to be able to decide if the fieldsynopsis refers to a constant or a property at d7f7004639/phpdotnet/phd/Package/Generic/XHTML.php (L1608)
Preface elements are now rendered inline in the parent page instead of
being chunked into separate pages. Explicit annotations like
chunk:true or phd:chunk="true" can still force chunking.
Add rendering support for DocBook's <packagesynopsis> and <package>
elements so that namespaced PHP classes and enums can display a proper
`namespace X;` declaration above the class/enum synopsis.
When <function> contains <replaceable>, skip link/parentheses
processing in format_function_text() and output plain text instead.
Uses the role stack pattern already established by format_constant().
Fixesphp/phd#171
When <enumidentifier> contains a fully qualified name with :: separator
(e.g., RoundingMode::HalfAwayFromZero), the enum name is extracted and
used to generate a link to the corresponding enum documentation page.
Links are not generated in enumsynopsis context (where enumidentifier
defines the case) or when the enum is not found in the index.
Refs php/phd#180
- Move error handling code into a class and remove PhD message output handling from it.
- Introduce a new class to handle PhD message output.
- Make the implicit dependency on the output functionality of classes explicit.
- Update PEAR package.xml.
- Fix tests.
- Use proper variadic parameters
- Use class constants
- Use first-class callable syntax
---------
Co-authored-by: haszi <haszika80@gmail.com>
Add links to constants with replaceable tags by processing them when the constant tag is being closed.
Add a test.
Co-authored-by: haszi <haszika80@gmail.com>
Remove Config from Autoloader by replacing it with a static array and a setter method.
Update render.php and setup.php to pass package directories to Autoloader.
Add test.
Co-authored-by: haszi <haszika80@gmail.com>
* Add Config as a dependency to Format and all it subclasses
* Inject Config into every Format subclass at instantiation
---------
Co-authored-by: haszi <haszika80@gmail.com>
Replace static example element counter with class properties in Index and generic XHTML.
Add tests.
Refactor TestRender so that it can render multiple formats.
Co-authored-by: haszi <haszika80@gmail.com>
* Add rendering support for new class and exception markup
Add rendering support for new class and exception markup in the PHP package.
Add tests for the old and the new class and exception markup.
* Add indexing support for new class and exception markup
* Make PhD aware of the current class or exception name when using the new markup
When a reference element has the appropriate roles, store the name of the current class or exception. If this is not done, PhD will generate links to the class even from the class's own synopsis page.
* Fix code formatting differences in screen elements
* Add tests comparing old and new markup rendering output
---------
Co-authored-by: haszi <haszika80@gmail.com>
Closes https://github.com/php/doc-en/issues/3353.
When the list of `refentry`s (functions and methods) is retrieved from the indexing database the characters `_`, `::` and `->` in their names were replaced by `-` before storing them in the array `$ref` in `Format.php`. As this array is used to generate the links to and the index list of functions/methods, functions and methods with the same name after replacing the before mentioned characters (e.g. `finfo_buffer()`/`finfo::buffer()`, `finfo_file()`/`finfo::file()`, etc.) were overwriting each other's reference entries in memory (in the `$ref` array).
Fix this by not replacing the above listed characters.
Co-authored-by: haszi <haszika80@gmail.com>
Move all database access to IndexRepository.
Use the same database during the entire indexing-rendering process.
Add a simple smoke test for render.php.
Co-authored-by: haszi <haszika80@gmail.com>
This adds support for 'known' attributes on method and function parameters.
'Known' in this context means an attribute that has been declared in the documentation with an ID in the `class.attribute_name` format (all current predefined attributes are supported).
Current limitations are:
- No support for namespaced attributes
- No support for attributes on a return type
Co-authored-by: haszi <haszika80@gmail.com>
Add new IndexRepository class to handle all database access.
Inject IndexRepository as a dependency into the constructor of Index and use that instead of directly accessing the database.
Add basic indexing test.
Fix existing test that uses indexing to use IndexRepository.
Add method parameter and return types.
Make readNode method private.
Change equality to identity comparison for string.
Remove unnecessary comments and empty lines.
Add test.
* Refactor Options Parser and default Options Handler
Refactor default Options Handler to accept dependencies through its constructor.
Refactor default Options Handler to return an array of options instead of directly setting options in Config and declare array return types.
Refactor method in Options Parser to return an array of options and declare its return type as array.
Inject all necessary dependencies in render.php.
Refactor two methods in default Options Handler by using match expressions.
* Minor refactor of files used in tests
Inlcude Config with require_once instead of require in Autloader.
Define __INSTALLDIR__ only if it is not defined yet in render.php.
Include Autoloader and functions.php with require_once instead of require.
Remove unnecessary __PHPDIR__ constant, correct path for __INSTALLDIR__ and use that constant in setup.php.
* Remove var_dump from Options Parser
* Fix inconsistent option flags in default Option Handler
* Add default Options Handler tests
---------
Co-authored-by: haszi <haszika80@gmail.com>
* Add Format as an optional constructor dependency to TestRender
Add Format as an optional constructor dependency to TestRender.
Check format's methods conditionally.
Refactor tests to inject formats.
* Add Config as a constructor dependency to TestRender
Add Config as a constructor dependency to TestRender.
Refactor tests to inject Config.
* Add Index as an optional constructor dependency to TestRender
* TestRender to extend Render
* Config to allow calling instance methods
* Refactor test helpers and test directory structure
Refactor TestRender to use only constructor injected objects.
Rename test format helper classes to indicate which package they belong to.
Move TestRender and all format helper classes into the phpdotnet phd directory to enable autoloading.
Remove all unnecessary lines from setup.php.
Restructure test directory to follow the structure of the tested classes.
---------
Co-authored-by: haszi <haszika80@gmail.com>
* Run tests on push and pull requests
* Update test
Update test that had an <article> element missing its xml:id which the indexer expects to be present.
---------
Co-authored-by: haszi <haszika80@gmail.com>