1515use PhpSchool \PhpWorkshop \UserState ;
1616
1717/**
18- * Class ResultsRenderer
18+ * Renderer which renders a `\PhpSchool\PhpWorkshop\ResultAggregator` and writes it the output.
19+ *
1920 * @package PhpSchool\PhpWorkshop\ResultRenderer
2021 */
2122class ResultsRenderer
@@ -51,11 +52,11 @@ class ResultsRenderer
5152 private $ resultRendererFactory ;
5253
5354 /**
54- * @param $appName
55- * @param Color $color
56- * @param TerminalInterface $terminal
57- * @param ExerciseRepository $exerciseRepository
58- * @param SyntaxHighlighter $syntaxHighlighter
55+ * @param string $appName The name of the binary to run this workshop.
56+ * @param Color $color A instance of `Color` used to colour strings with ANSI escape codes.
57+ * @param TerminalInterface $terminal A helper to get information regarding the current terminal.
58+ * @param ExerciseRepository $exerciseRepository The exercise repository.
59+ * @param SyntaxHighlighter $syntaxHighlighter A PHP syntax highlighter for the terminal, uses ANSI escape codes.
5960 */
6061 public function __construct (
6162 $ appName ,
@@ -74,10 +75,13 @@ public function __construct(
7475 }
7576
7677 /**
77- * @param ResultAggregator $results
78- * @param ExerciseInterface $exercise
79- * @param UserState $userState
80- * @param OutputInterface $output
78+ * Render the result set to the output and statistics on the number of exercises completed and
79+ * remaining.
80+ *
81+ * @param ResultAggregator $results The result set.
82+ * @param ExerciseInterface $exercise The exercise instance that was just attempted.
83+ * @param UserState $userState The current state of the student's progress.
84+ * @param OutputInterface $output The output instance.
8185 */
8286 public function render (
8387 ResultAggregator $ results ,
@@ -201,8 +205,11 @@ private function styleArray(array $lines, array $styles)
201205 }
202206
203207 /**
208+ * Style/colour a string.
209+ * Can be any of: black, red, green, yellow, blue, magenta, cyan, white, bold, italic, underline
210+ *
204211 * @param string $string
205- * @param array|string $colourOrStyle
212+ * @param array|string $colourOrStyle A single style as a string or multiple styles as an array.
206213 *
207214 * @return string
208215 *
@@ -222,15 +229,19 @@ public function style($string, $colourOrStyle)
222229 }
223230
224231 /**
225- * @param ResultInterface $result
226- * @return string
232+ * Render a result. Attempt to find the correct renderer via the result renderer factory.
233+ *
234+ * @param ResultInterface $result The result.
235+ * @return string The string representation of the result.
227236 */
228237 public function renderResult (ResultInterface $ result )
229238 {
230239 return $ this ->resultRendererFactory ->create ($ result )->render ($ this );
231240 }
232241
233242 /**
243+ * Draw a line break across the terminal.
244+ *
234245 * @return string
235246 */
236247 public function lineBreak ()
0 commit comments