1
0
mirror of https://github.com/php/phd.git synced 2026-03-25 15:42:14 +01:00

43 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
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
haszi
99c70b7aaf Add links to constants with replaceable tags (#175)
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>
2024-11-03 14:05:25 +00:00
Kamil Tekiela
6de3ff754a Add proper types 2024-10-21 15:19:45 +01:00
Kamil Tekiela
01709360c3 Align parameter names
Update Format.php
2024-10-21 15:19:45 +01:00
Kamil Tekiela
2852b2756c Remove some dead code (#163) 2024-10-20 13:34:46 +02:00
haszi
3250c7c270 Remove ReaderKeeper from Generic XHTML format (#138)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-14 17:17:09 +01:00
haszi
5362fde921 Implement simplelist attributes (#96)
Co-authored-by: haszi <haszika80@gmail.com>
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-02-20 12:49:36 +00:00
haszi
27e3bc3e4a Move whitespace formatting to generic XHTML format (#95)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-13 22:04:40 +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
Lu Fei
bacc87c11a Fix index generation for table rows (#88)
This fixes some constant links
2023-11-12 13:02:10 +00:00
sy-records
934be12873 Revert "Fix missing constants link"
This reverts commit 6f2312310c.
2023-11-10 16:31:25 +08:00
sy-records
6f2312310c Fix missing constants link 2023-11-10 16:29:09 +08:00
George Peter Banyard
ad7e0fe765 Fix render code for PHP 7.3 2023-07-26 21:44:03 +01:00
George Peter Banyard
ac72a948cb Add support for rendering more logical classsynopsis markup (#77)
* Add support for rendering more logical classsynopsis markup while allowing the old markup to render
2023-07-26 14:10:08 +01:00
Peter Cowburn
9544a6b72b make objectstorage::attach() compatible with splobjectstorage::attach()
PhD's ObjectStorage::attach() method does not respect the declared
return type from its parent class (SplObjectStorage): the latter
declares the return type as void.

It is currently mitigated via the #[\ReturnTypeWillChange] attribute.

This commit removes that attribute and instead aligns the return type
declaration (to return void), with associated fixes to not return
anything and not try to use a return value.

Since declaring a void return type is only allowed as of PHP 7.1.0, this
raises the minimum required PHP version for phd to that version. Since
PHP 7.1 is super ancient and even PHP 7.3 will become EOL in a few weeks
(at the time of writing) I'm making the executive decision that
requiring 7.1 is fine. :-)
2021-10-29 23:34:41 +01:00
Peter Cowburn
68363f64fb fix more PHP 8.1 deprecations
Most of these fix passing null to functions that no longer accept null.

Also explicitly check for null $data for fwrite()'s, instead of falsey.
2021-10-29 22:16:38 +01:00
Larry Garfield
6c1af76a46 Fix PHP 8.1 deprecations. 2021-10-19 16:14:51 -05:00
Máté Kocsis
bc10e61b9d Improve the display of union and intersection types
Simple nullable types are now displayed via using "?", while support for intersection types are reintroduced.
2021-07-25 23:37:16 +02:00
Máté Kocsis
300f869055 Remove unnecessary whitespaces after class constants and in implements list 2021-07-25 19:01:20 +02:00
Christoph M. Becker
ba78137000 Supress whitespace in type elements
Union types can get pretty long, so it may make sense to split them
over multiple lines[1]; however, that adds undesired whitespace within
or at the end of the union type.  Thus, we supress this whitespace
generally.

[1] <https://github.com/php/doc-en/pull/783>

Closes GH-46.
2021-07-18 12:07:44 +02:00
Máté Kocsis
60cfe96833 Fix newline handling in case of constructors 2021-06-18 16:29:07 +02:00
Máté Kocsis
a13d8b1edc Reformat methodsynopsis whitespaces (#38) 2021-06-16 11:02:00 +02:00
Kamil Tekiela
547a7daa96 Remove whitespace before semicolons (#41) 2021-06-12 23:50:52 +01:00
Craig Duncan
4e67a5977c Correct continue usage within a switch block 2019-02-10 21:42:51 +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
aecae4e2c3 Eliminate $ comments 2015-03-09 06:20:39 +01:00
Moacir de Oliveira
79ed0cfa21 $retval is not used here
Signed-off-by: Moacir de Oliveira <moacir@php.net>
2012-08-18 18:01:48 -04:00
Moacir de Oliveira
b0e35d28db InvalidArgumentException is not in our namespace
Signed-off-by: Moacir de Oliveira <moacir@php.net>
2012-08-18 17:31:37 -04:00
Hannes Magnusson
37a0e4268d WS :) 2012-06-09 17:33:56 +01:00
Hannes Magnusson
7df2e2b931 Add support for <?phpdoc?>
Initially only supports <?phpdoc print-version-for="foobar"?>
where `foobar` is an item in the aggregated version.xml file.
print-version-for will go through the same mechanism as all
refpages to generate version information, and therefore
fallback to "may only be in svn" if no found.
2011-07-05 18:54:18 +00:00
Hannes Magnusson
87245accb1 Microoptimize 2010-01-06 08:24:43 +00:00
Christian Weiske
87140b3520 remove legacy code that is not needed anymore; move Reader storage to ReaderKeeper 2009-10-16 17:43:56 +00:00
Moacir de Oliveira Miranda Júnior
d28ca1be8a fixing bug #47637 2009-09-04 15:09:04 +00:00
Moacir de Oliveira Miranda Júnior
8826e12bdc changing the name of the method render() of the Render class, now execute(). Conflict with the constructor 2009-08-01 20:04:21 +00:00
Hannes Magnusson
9bacdbd09b - Add missing $Id$ tags and vim modelines
- Remove useless closing tags
2009-07-30 16:56:01 +00:00
Moacir de Oliveira Miranda Júnior
a5590f13cd adding PI support 2009-07-28 05:40:25 +00:00
Moacir de Oliveira Miranda Júnior
409c65ce54 fixing class names bugs 2009-06-20 06:58:48 +00:00
Christian Weiske
ff5cc4ebcf Add namespace in (hopefully) every class. This is fully untested!
I probably confused Format_Legacy with Format in some files.
2009-06-19 21:48:54 +00:00
Moacir de Oliveira Miranda Júnior
b7909c572d Merging from Enterprise 2009-06-13 11:18:08 +00:00
Hannes Magnusson
4fe8c61922 Revert. This should had gone into the PHD_ENTERPRISE branch! 2008-07-28 22:47:15 +00:00
Hannes Magnusson
c665ca06ca Initial commit of Enterprise PhD 2.0 XP, build#1337 2008-07-28 22:40:58 +00:00