Skip to content

Commit a3635dd

Browse files
committed
Application docs
1 parent 7e86d5c commit a3635dd

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

src/Application.php

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ final class Application
4545
private $diConfigFile;
4646

4747
/**
48-
* @var string
48+
* @var string|null
4949
*/
5050
private $logo = null;
5151

@@ -60,8 +60,11 @@ final class Application
6060
private $bgColour = 'black';
6161

6262
/**
63-
* @param string $workshopTitle
64-
* @param $diConfigFile
63+
* This is the main application class. It should be instantiated with the title of
64+
* the workshop and the path to the DI configuration file.
65+
*
66+
* @param string $workshopTitle The workshop title - this is used throughout the application
67+
* @param string $diConfigFile The absolute path to the DI configuration file
6568
*/
6669
public function __construct($workshopTitle, $diConfigFile)
6770
{
@@ -73,15 +76,21 @@ public function __construct($workshopTitle, $diConfigFile)
7376
}
7477

7578
/**
76-
* @param string $check
79+
* Register a custom check with the application. Exercises will only be use the check
80+
* if it has been registered here.
81+
*
82+
* @param string $check The FQCN of the check
7783
*/
7884
public function addCheck($check)
7985
{
8086
$this->checks[] = $check;
8187
}
8288

8389
/**
84-
* @param string $exercise
90+
* Register an exercise with the application. Only exercises registered here will
91+
* be displayed in the exercise menu.
92+
*
93+
* @param string $exercise The FQCN of the check
8594
*/
8695
public function addExercise($exercise)
8796
{
@@ -104,7 +113,10 @@ public function addResult($resultClass, $resultRendererClass)
104113
}
105114

106115
/**
107-
* @param string $logo
116+
* Add an ASCII art logo to the application. This will be displayed a the top of them menu. It will be
117+
* automatically padded to sit in the middle.
118+
*
119+
* @param string $logo The logo
108120
*/
109121
public function setLogo($logo)
110122
{
@@ -113,7 +125,10 @@ public function setLogo($logo)
113125
}
114126

115127
/**
116-
* @param string $colour
128+
* Modify the foreground color of the workshop menu
129+
* Can be any of: black, red, green, yellow, blue, magenta, cyan, white
130+
*
131+
* @param string $colour The colour
117132
*/
118133
public function setFgColour($colour)
119134
{
@@ -122,7 +137,10 @@ public function setFgColour($colour)
122137
}
123138

124139
/**
125-
* @param string $colour
140+
* Modify the background color of the workshop menu
141+
* Can be any of: black, red, green, yellow, blue, magenta, cyan, white
142+
*
143+
* @param string $colour The colour
126144
*/
127145
public function setBgColour($colour)
128146
{
@@ -131,7 +149,10 @@ public function setBgColour($colour)
131149
}
132150

133151
/**
134-
* Run the app
152+
* Executes the framework, invoking the specified command.
153+
* The return value is the exit code. 0 for success, anything else is a failure.
154+
*
155+
* @return int The exit code
135156
*/
136157
public function run()
137158
{

0 commit comments

Comments
 (0)