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