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

139 Commits

Author SHA1 Message Date
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
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
haszi
c5491e4b36 Fix Config parameter types 2025-01-14 12:16:32 +00:00
haszi
9999f02ea7 Fix existing PHPDoc issues 2025-01-14 12:16:32 +00:00
haszi
b80ae36dba Change property names to camel case 2024-12-29 19:58:10 +00:00
haszi
171b0e4dd1 Make constant explicitly public 2024-12-29 19:58:10 +00:00
haszi
32e6352556 Add PHP format related properties 2024-12-29 19:58:10 +00:00
haszi
12c6e240d0 Refactor copyright
Make copyright a readonly property that is initialized in the constructor
Remove copyright() method
2024-12-29 19:58:10 +00:00
haszi
c220f9af5f Fix color output related methods
Add getter for color output
Remove superfluous set_color_output() method
Add code related to color output on windows to the constructor
2024-12-29 19:58:10 +00:00
haszi
2ef82d78ce Refactor methods mass getting and setting options
Remove superfluous exportable() method
2024-12-29 19:58:10 +00:00
haszi
3694750fa8 Replace method calls with property access
Remove methods mapping method calls to property access
2024-12-29 19:58:10 +00:00
haszi
e571634780 Convert array to properties 2024-12-29 19:58:10 +00:00
haszi
543bb5bf25 Move constant definitions to a dedicated file 2024-10-21 14:36:48 +01:00
Kamil Tekiela
2852b2756c Remove some dead code (#163) 2024-10-20 13:34:46 +02:00
haszi
49a37c45b3 Move requireIndexing() to Config (#151)
* Move requireIndexing() to Config

* Change method name to requiresIndexing

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-09-22 19:22:31 +01:00
haszi
455a797ef8 Removed unused options 'chunk_extra' and 'intermediate_output_dir' from Config (#153)
Co-authored-by: haszi <haszika80@gmail.com>
2024-09-11 13:49:02 +01:00
haszi
93a0c11828 Add file modification history to PHP doc pages (#115)
Co-authored-by: haszi <haszika80@gmail.com>
2024-04-20 15:23:32 +01:00
haszi
b703f50bdf Refactor test helpers and test files (#104)
* 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>
2024-02-26 15:12:03 +00:00
haszi
e5b8bf35a9 Remove file ending comment blocks (#92)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-08 12:46:21 +00:00
Peter Kokot
3564283891 Sync final newlines
This patch adds some missing newlines and trims multiple redundant
newlines into a single newline.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-02 06:23:33 +02:00
Sobak
62b20a2db1 Fix stylesheet handling for PHP Package
It basically reverts almost all changes made in PR #8. Most of the code
was unused and it failed to copy the stylesheet. This change actually
applies CSS to the generated output.

Also, setting PhD to use PHP.net's CSS was moved inside the PHP Package
so that formats from other packages won't get php.net styling.

Also, fixes bug #67638

CHM format probably require further fixes but I'll commit this changes
first as docs.php.net logs were spammed for months due to this buggy code.
2016-12-15 10:39:15 +01:00
Sobak
aecae4e2c3 Eliminate $ comments 2015-03-09 06:20:39 +01:00
Andy Burton
472b8de563 CHM style fixes
Updated css to use theme-base and theme-medium from php.net and google
fonts.
New stylesheet references have been placed in the phd config.php
Separated stylesheet loading and rendering into ChunkedXHTML methods.
Standardised process between CHM and Epub.
Add a few css tweaks to sort out the new style in CHM.
Bugfix in Format.php for non-existant array key.
Tested with epub and chm rendering under php 5.5.10 on win 8.1
2014-03-26 12:53:43 +00:00
Hannes Magnusson
37a0e4268d WS :) 2012-06-09 17:33:56 +01:00
Hannes Magnusson
ccb9cd2834 Fixed bug#47392 Option to specify filename for bightmls 2012-04-06 11:39:14 -07:00
Hannes Magnusson
9c1fa3647f Show individual package version in --version 2012-04-06 06:30:47 -07:00
Hannes Magnusson
5d128a5c2a Whopsy, rollback to dev 2012-04-06 06:10:02 -07:00
Hannes Magnusson
919f6ab592 Prep 1.1.4 2012-04-06 05:20:54 -07:00
Hannes Magnusson
63642416df Back to -dev 2012-03-01 08:30:02 +00:00
Hannes Magnusson
d8e7162c11 Prep for 1.1.3 release 2012-03-01 08:04:58 +00:00
Hannes Magnusson
45cb6cf431 Back to -dev 2011-12-18 12:43:29 +00:00
Hannes Magnusson
81d492eb58 Prep for 1.1.2 release 2011-12-18 11:47:16 +00:00
Moacir de Oliveira Miranda Júnior
5acecbc941 back to dev 2011-06-22 03:13:23 +00:00
Moacir de Oliveira Miranda Júnior
70ab2a858d Preparing release 1.1.1 2011-06-22 01:01:15 +00:00
Moacir de Oliveira Miranda Júnior
24038df4fd Do not automatically add package dirs, use the option --packagedir instead
* New option --packagedir (-k) <path> to run an external package
2011-05-29 15:56:43 +00:00
Hannes Magnusson
08b967488d Add --memoryindex (-M) to just store the index in memory
# couple of percentages less :)
2011-04-27 18:33:37 +00:00
Richard Quadling
8e9d5c0d65 Added --quit option to quit after processing command line params. Useful when used with --saveconfig to just save the config. 2011-03-16 12:38:23 +00:00
Moacir de Oliveira Miranda Júnior
6a3eb37f6b adding function Config::copyright(), uses date('Y') in the current year 2011-03-08 20:06:38 +00:00
Moacir de Oliveira Miranda Júnior
68ba1c9567 back to dev 2011-03-08 17:39:07 +00:00
Moacir de Oliveira Miranda Júnior
f73368ac13 preparing the release tag 1.1.0 2011-03-08 17:12:34 +00:00
Richard Quadling
b8985b73ca Restoring a different verbose level fails to actually set the error reporting level. 2011-02-18 16:33:45 +00:00
Richard Quadling
08c16e8e95 Using saveconfig once no longer saves the config on every call to render. Error introduced in commit 307980. 2011-02-09 11:16:44 +00:00
Richard Quadling
869fe449bb Revert verbose setting back to VERBOSE_DEFAULT 2011-02-04 14:01:06 +00:00
Richard Quadling
d87cc0db72 Using saveconfig once no longer saves the config on every call to render. 2011-02-04 13:58:12 +00:00
Richard Quadling
171311b130 Do not disable color configuration settings when loading from phd.config.php on Windows when saved setting is enabled. 2011-02-03 17:36:30 +00:00
Moacir de Oliveira Miranda Júnior
0a22967386 back to dev 2010-08-11 04:29:56 +00:00
Moacir de Oliveira Miranda Júnior
b604faeda3 Preparing the release tag 2010-08-11 04:13:48 +00:00
Philip Olson
fd5eabd6ca Added --notoc option to use cached toc (for PHP package), and now build toc/ by default. 2010-06-03 03:33:21 +00:00
Moacir de Oliveira Miranda Júnior
65b047182b re-adding fallback_language to the Config class
* fixes the out of memory problems with the --lang option
2010-06-03 02:53:40 +00:00