1616use PhpSchool \PhpWorkshop \Result \Success ;
1717
1818/**
19- * Class FunctionRequirementsCheck
19+ * This check verifies that the students submission contains usages of some required functions
20+ * and also does not use certain functions (specified by the exercise).
21+ *
2022 * @package PhpSchool\PhpWorkshop\Check
2123 * @author Aydin Hassan <aydin@hotmail.co.uk>
2224 */
@@ -37,6 +39,8 @@ public function __construct(Parser $parser)
3739 }
3840
3941 /**
42+ * Return the check's name
43+ *
4044 * @return string
4145 */
4246 public function getName ()
@@ -45,9 +49,13 @@ public function getName()
4549 }
4650
4751 /**
48- * @param ExerciseInterface $exercise
49- * @param string $fileName
50- * @return ResultInterface
52+ * Parse the students solution and check that there are usages of
53+ * required functions and that banned functions are not used. The requirements
54+ * are pulled from the exercise.
55+ *
56+ * @param ExerciseInterface $exercise The exercise to check against.
57+ * @param string $fileName The absolute path to the student's submission.
58+ * @return ResultInterface The result of the check.
5159 */
5260 public function check (ExerciseInterface $ exercise , $ fileName )
5361 {
@@ -92,6 +100,8 @@ public function check(ExerciseInterface $exercise, $fileName)
92100 }
93101
94102 /**
103+ * This check can run on any exercise type.
104+ *
95105 * @param ExerciseType $exerciseType
96106 * @return bool
97107 */
@@ -101,7 +111,6 @@ public function canRun(ExerciseType $exerciseType)
101111 }
102112
103113 /**
104- *
105114 * @return string
106115 */
107116 public function getExerciseInterface ()
@@ -110,6 +119,9 @@ public function getExerciseInterface()
110119 }
111120
112121 /**
122+ * This is performed after executing the student's submission because the submission may produce the correct
123+ * output, but do it in a way that was not correct for the task. This way the student can see the program works
124+ * but missed some requirements.
113125 *
114126 * @return string
115127 */
0 commit comments