- 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>
* 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>
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