@@ -22,17 +22,17 @@ final class Application
2222 private $ workshopTitle ;
2323
2424 /**
25- * @var array
25+ * @var array<class-string>
2626 */
2727 private $ checks = [];
2828
2929 /**
30- * @var class-string[]
30+ * @var array< class-string>
3131 */
3232 private $ exercises = [];
3333
3434 /**
35- * @var array
35+ * @var array<array{resultClass: class-string, resultRendererClass: class-string}>
3636 */
3737 private $ results = [];
3838
@@ -68,7 +68,7 @@ final class Application
6868 * @param string $workshopTitle The workshop title - this is used throughout the application
6969 * @param string $diConfigFile The absolute path to the DI configuration file
7070 */
71- public function __construct ($ workshopTitle , $ diConfigFile )
71+ public function __construct (string $ workshopTitle , string $ diConfigFile )
7272 {
7373 Assertion::string ($ workshopTitle );
7474 Assertion::file ($ diConfigFile );
@@ -81,9 +81,9 @@ public function __construct($workshopTitle, $diConfigFile)
8181 * Register a custom check with the application. Exercises will only be able to use the check
8282 * if it has been registered here.
8383 *
84- * @param string $check The FQCN of the check
84+ * @param class- string $check The FQCN of the check
8585 */
86- public function addCheck ($ check )
86+ public function addCheck (string $ check ): void
8787 {
8888 $ this ->checks [] = $ check ;
8989 }
@@ -94,16 +94,16 @@ public function addCheck($check)
9494 *
9595 * @param class-string $exercise The FQCN of the check
9696 */
97- public function addExercise ($ exercise )
97+ public function addExercise (string $ exercise ): void
9898 {
9999 $ this ->exercises [] = $ exercise ;
100100 }
101101
102102 /**
103- * @param string $resultClass
104- * @param string $resultRendererClass
103+ * @param class- string $resultClass
104+ * @param class- string $resultRendererClass
105105 */
106- public function addResult ($ resultClass , $ resultRendererClass )
106+ public function addResult (string $ resultClass , string $ resultRendererClass ): void
107107 {
108108 Assertion::classExists ($ resultClass );
109109 Assertion::classExists ($ resultRendererClass );
@@ -120,7 +120,7 @@ public function addResult($resultClass, $resultRendererClass)
120120 *
121121 * @param string $logo The logo
122122 */
123- public function setLogo ($ logo )
123+ public function setLogo (string $ logo ): void
124124 {
125125 Assertion::string ($ logo );
126126 $ this ->logo = $ logo ;
@@ -132,7 +132,7 @@ public function setLogo($logo)
132132 *
133133 * @param string $colour The colour
134134 */
135- public function setFgColour ($ colour )
135+ public function setFgColour (string $ colour ): void
136136 {
137137 Assertion::string ($ colour );
138138 $ this ->fgColour = $ colour ;
@@ -144,7 +144,7 @@ public function setFgColour($colour)
144144 *
145145 * @param string $colour The colour
146146 */
147- public function setBgColour ($ colour )
147+ public function setBgColour (string $ colour ): void
148148 {
149149 Assertion::string ($ colour );
150150 $ this ->bgColour = $ colour ;
@@ -156,7 +156,7 @@ public function setBgColour($colour)
156156 *
157157 * @return int The exit code
158158 */
159- public function run ()
159+ public function run (): int
160160 {
161161 $ container = $ this ->getContainer ();
162162
@@ -218,7 +218,7 @@ public function run()
218218 /**
219219 * @return \DI\Container
220220 */
221- private function getContainer ()
221+ private function getContainer (): \ DI \ Container
222222 {
223223 $ containerBuilder = new ContainerBuilder ();
224224 $ containerBuilder ->addDefinitions (
0 commit comments