Formatters
Formatters are used to make a generated solution visible to the user.
- interface Formatter
-
- Fully qualified name
-
\Elias
Haeussler\ Typo3Solver\ Formatter\ Formatter
Interface for formatters that convert a given problem and its solution into a readable format.
Default formatters
Since exceptions are handled in various places, the extension already ships with some default formatters:
- class CliFormatter
-
- Fully qualified name
-
\Elias
Haeussler\ Typo3Solver\ Formatter\ Cli Formatter
Formatter used on the command line. It displays all provided solutions. On verbose output, the original prompt is also displayed. In addition, if a solution comes from the solutions cache, the original date and cache identifier are displayed as well.
- class JsonFormatter
-
- Fully qualified name
-
\Elias
Haeussler\ Typo3Solver\ Formatter\ Json Formatter
This formatter is used within the solver:solve command if the solver:solve option is given. It displays the solution as JSON string, allowing further processing, especially in CI.
- class WebFormatter
-
- Fully qualified name
-
\Elias
Haeussler\ Typo3Solver\ Formatter\ Web Formatter
This formatter is used for the modified debug exception handler. It adds an additional section to the error page which displays all solutions. In addition, the used model, generated prompt and cache metadata are shown.
Note
If solution streaming is possible, the \EliasHaeussler\Typo3Solver\Formatter\WebStreamFormatter is used instead on the error page.
- class WebStreamFormatter
-
- Fully qualified name
-
\Elias
Haeussler\ Typo3Solver\ Formatter\ Web Stream Formatter
On solution streaming, this formatter is used to only print the list of solutions, streaming it to the error page where it replaces the current solution list.
See also
View the sources on GitHub: