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

13 Commits

Author SHA1 Message Date
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
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
haszi
9999f02ea7 Fix existing PHPDoc issues 2025-01-14 12:16:32 +00:00
haszi
0364e4f969 Use trigger_error for errors (#174)
Co-authored-by: haszi <haszika80@gmail.com>
2024-10-29 14:11:27 +00:00
haszi
8ca0905687 Remove Config from Autoloader (#143)
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>
2024-07-09 19:52:23 +01:00
haszi
e6e6847d7b Refactor Options Parser and default Options Handler (#110)
* 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>
2024-03-17 18:29:43 +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
Moacir de Oliveira Miranda Júnior
3678d2acaa removing require Config.php from render, let the Autoloader do it 2010-05-07 19:19:35 +00:00
Hannes Magnusson
d2be54f91b - Add a new verbose level 'messages' (enabled by default)
- Add the possibility to generate a 'phd.config.php' config file (--saveconfig).
  If that file exists in cwd then it will be read and used
  (command line arguments will overwrite the config file though)
- Add a new config option, 'package_dirs'. Used to specify the directory locations to use for autoloading
2010-04-29 19:16:10 +00:00
Moacir de Oliveira Miranda Júnior
639a4380f4 Defining __INSTALLDIR__ if its not yet defined in the Autoloader
+ Allows external programs to use the PhD Autoloader
+ Using pear tasks to replace @php_dir@ in the autoloader
2010-04-05 01:04:47 +00:00
Hannes Magnusson
adf4a572a9 WS & comment 2009-12-08 19:20:58 +00:00
Hannes Magnusson
329b9be0dc - Move the autoloader into its own class
- Only autoload classes from our namespace
2009-12-08 19:09:37 +00:00