1
0
mirror of https://github.com/php/phd.git synced 2026-03-24 07:02:07 +01:00

998 Commits

Author SHA1 Message Date
Máté Kocsis
e546e7b8d8 Fix rendering of attribute constants (#249)
$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)
2026-03-19 22:08:18 +01:00
Máté Kocsis
0e43594305 Revert "Add explicit type declarations to class constants (PHP 8.3+) (#215)"
This reverts commit c65199393a.
2026-03-04 08:43:09 +01:00
Louis-Arnaud
8755a928aa Make <preface> not produce a new page by default (#242)
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.
2026-02-17 14:30:25 +00:00
Louis-Arnaud
d7f7004639 Support <packagesynopsis> and <package> rendering for namespaced classes/enums (GH-194) (#241)
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.
2026-02-15 14:10:12 +00:00
Louis-Arnaud
4eb564e1fb Fix GH-158: Replace empty() with strict string comparison for sdesc/ldesc (#238)
Both sdesc and ldesc are always initialized as "" in storeInfo() and
populated with htmlentities(trim(...)) results, so they are always
strings. Using empty() is overly broad here since it would also treat
a legitimate "0" value as empty. Replace with === "" for precision.

The third occurrence in Package/PEAR/Web.php was already removed in
commit 53f9afe.
2026-02-15 13:56:49 +00:00
haszi
e012bdf3c1 Fix GH-225 (#226)
* Closes GH-225 - cannot reload saved configuration
* Add test
* Prevent serializing and deserializing non-serializable properties
2026-02-05 22:25:12 +01:00
Louis-Arnaud
c65199393a Add explicit type declarations to class constants (PHP 8.3+) (#215)
### Motivation
- Enhances type safety and static analysis.
- Makes code intent clearer.
- Prepares PhD for PHP 8.4 compatibility and future strictness.

### Scope
- Added types such as `int`, `string`, `bool`, or `array` to class constants.
- Example:
    Before:
        `public const FORMAT_HTML = 1;`
        `public const NAME = 'PhD';`
    After:
        `public const int FORMAT_HTML = 1;`
        `public const string NAME = 'PhD';`

### Impact
-  No runtime behavior change.
-  Fully backward compatible with PHP 8.3+.
- ⚙️ Code clarity and safety improvement only.
- Updated `composer.json` to indicate PHP 8.3 requirement
- Removed 8.1 and 8.2 CI pipelines

### References
- [PHP 8.3: Typed class constants RFC](https://wiki.php.net/rfc/typed_class_constants)
- [PHP manual: Class constants](https://www.php.net/manual/en/language.oop5.constants.php)

---------

Co-authored-by: lacatoire <louis-arnaud.catoire@external.drivalia.com>
2026-02-05 20:45:10 +00:00
Louis-Arnaud
5f10df173f Fix <function> with <replaceable> not rendering correctly (#235)
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().

Fixes php/phd#171
2026-02-05 17:08:04 +00:00
Louis-Arnaud
61ad3e7cb0 Support MathML (mml:*) elements for XHTML rendering (#236)
Closes #172
2026-02-05 17:04:33 +00:00
lacatoire
34f18a654b Replace deprecated SplObjectStorage::detach() with offsetUnset() 2026-02-03 18:35:36 +00:00
lacatoire
f662181225 Fix deprecated null array offset usage in Reader_Partial 2026-02-03 18:35:36 +00:00
Louis-Arnaud
c9154020cd Add linking support for enumidentifier elements (#234)
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
2026-02-03 18:24:21 +00:00
Louis-Arnaud
91384413a2 Fix: Prevent using null as array offset in Package/PHP/Web (#228)
* Fix: Stop using null as array offset (Resolves #227)

* This also avoids accessing "path" on a null source when sourceInfo() returns null.

---------

Co-authored-by: lacatoire <louis-arnaud.catoire@external.drivalia.com>
2026-01-11 20:32:45 +00:00
Louis-Arnaud
43855fa7b2 Fix deprecated fgetcsv usage by explicitly passing escape parameter (#232) 2026-01-11 20:31:16 +00:00
Louis-Arnaud
d83871e6b5 docs: replace obsolete SVN references with Git workflows (#231) 2026-01-09 02:12:30 +00:00
Louis-Arnaud
7366bc9f2a refactor: replace trigger_error(E_USER_ERROR) with exceptions (PHP 8.4 compatibility) (#218)
Co-authored-by: lacatoire <louis-arnaud.catoire@external.drivalia.com>
2026-01-09 02:09:58 +00:00
Louis-Arnaud
5d705c2676 Replace deprecated SplObjectStorage::attach() usage for PHP 8.5 (#223)
* Replace deprecated SplObjectStorage::attach()/detach() usage for PHP 8.5

---------

Co-authored-by: lacatoire <louis-arnaud.catoire@external.drivalia.com>
2025-12-12 19:21:31 +01:00
haszi
ed86b82d16 Replace curly brace string offset with square bracket syntax (#222)
Co-authored-by: haszi <haszika80@gmail.com>
2025-11-26 20:15:20 +01:00
AllenJB
5b4703a5b7 Chunked XHTML with JS search (#204)
* Chunked XHTML with JS search

* Improve prev/next nav alignment/sizing with differing content

* Refactor to merge changes into Chunked XHTML directly;
New search indexes pushed up to Web (allowing search.js changes to be pushed to web-php, avoiding duplication)

* Add search access key hint

* Update tests

* Exclude search from CHM format

* Chunked XHTML with JS search (don't use the localStorage cache for local docs)
2025-11-04 17:15:47 +00:00
AllenJB
264c65b187 Fix missing pages in search indexes (#212)
* Search indexes: Fix missing search entries

This handles duplicated ids - but requires changes on web-php to use new indexes
2025-11-04 06:19:18 +00:00
Anna Filina
deb7d81c49 Remove references to PDF from docs and code comments 2025-11-04 06:15:12 +00:00
Anna Filina
610168e8aa Remove PDF formats from Package_PHP_Factory 2025-11-04 06:15:12 +00:00
Anna Filina
ac29ade4b7 Remove PDF renderer classes 2025-11-04 06:15:12 +00:00
AllenJB
b9eb060be4 Make generated example IDs page specific (#210)
* Make example id attribute counter reset on each page (fixes #205)
2025-11-04 00:47:09 +00:00
Anna Filina
ae9107bcd8 Modify autoloader signature per spl_autoload_register docs
https://www.php.net/manual/en/function.spl-autoload-register.php
2025-10-21 19:58:57 +02:00
Derick Rethans
d2874c005c Add the long description (refpurpose) so that we can expose that in the meta information on the web site 2025-09-02 16:33:43 +01:00
Luffy
10303e6e88 Decode HTML entities in descriptions (#196) 2025-04-22 10:20:55 +08:00
Jakub Vrána
40bc3ea30a Fix link to true and false types (#197) 2025-04-15 12:16:45 +08:00
Derick Rethans
b7d8f52b05 Allow for (nested) annotations elements
This allows us to set 'interactive' annotations on books, sets, and chapters to
signal to the WASM code runner that examples in these areas can be run.

The WASM code runner also checks for the 'non-interactive' annotation and
selectively disables running code for that example.
2025-03-06 17:30:06 +01:00
Derick Rethans
b1e5ac3975 Fixed trailing spaces 2025-03-06 17:30:06 +01:00
Luffy
d603ec5441 Render enumitemdescription using single line comments (#192) 2025-03-06 12:34:37 +00:00
Luffy
b09ca0b9da Support enum display version info (#191) 2025-03-06 12:33:05 +00:00
philip
0b690001ae Removed E_STRICT references as it's deprecated 2025-03-04 08:32:37 -08:00
Saki Takamachi
3c00a1a753 Add support enum links (#188) 2025-02-06 12:22:18 +00:00
haszi
b4c4bf8066 Explicitly cast values to the expected types 2025-01-14 12:16:32 +00:00
haszi
85aeccaf0d Pass missing parameter to constructor 2025-01-14 12:16:32 +00:00
haszi
7e4a232578 Fix incorrectly placed parenthesis 2025-01-14 12:16:32 +00:00
haszi
0525f61e85 Remove unnecessarily passed variables 2025-01-14 12:16:32 +00:00
haszi
996043bdca Remove unnecessary null coalescing operator
The property is initialized as an empty array
2025-01-14 12:16:32 +00:00
haszi
00743eb4af Instantiate Config object and use it in demo 2025-01-14 12:16:32 +00:00
haszi
dc826beaac Remove duplicate array keys 2025-01-14 12:16:32 +00:00
haszi
7073c2f5ae Remove return statement
Parent method returns void as should this method
2025-01-14 12:16:32 +00:00
haszi
d611e64fb1 Fix PHPDoc Return types 2025-01-14 12:16:32 +00:00
haszi
e89333c222 Change PHPDoc return type of createLink
The various formats return string, null or void so change the PHPDoc return type to reflect this
2025-01-14 12:16:32 +00:00
haszi
c5491e4b36 Fix Config parameter types 2025-01-14 12:16:32 +00:00
haszi
f6fcc078c1 Remove unnecessary ternary operators 2025-01-14 12:16:32 +00:00
haszi
9999f02ea7 Fix existing PHPDoc issues 2025-01-14 12:16:32 +00:00
haszi
92dd87abf8 Define undefined properties and variables (#186)
Co-authored-by: haszi <haszika80@gmail.com>
2025-01-05 23:51:29 +00:00
haszi
c22feecbd0 Add FQN normalization to constants 2025-01-05 23:49:14 +00:00
haszi
d7a81ebea6 Add FQN normalization to properties 2025-01-05 23:49:14 +00:00