@@ -84,7 +84,7 @@ protected static function loadCoreComponent(string $moodleRoot): bool {
8484 *
8585 * @return array Associative array of components as keys and paths as values or null if not found.
8686 */
87- protected static function calculateAllComponents (string $ moodleRoot ): ? array {
87+ protected static function calculateAllComponents (string $ moodleRoot ) {
8888
8989 // If we have calculated the components already, straight return them.
9090 if (!empty (self ::$ moodleComponents )) {
@@ -188,7 +188,7 @@ protected static function calculateAllComponents(string $moodleRoot): ?array {
188188 *
189189 * @return string|null a valid moodle component for the file or null if not found.
190190 */
191- public static function getMoodleComponent (File $ file , $ selfPath = true ): ? string {
191+ public static function getMoodleComponent (File $ file , $ selfPath = true ) {
192192
193193 // Verify that we are able to find a valid moodle root.
194194 if (! $ moodleRoot = self ::getMoodleRoot ($ file , $ selfPath )) {
@@ -232,7 +232,7 @@ public static function getMoodleComponent(File $file, $selfPath = true): ?string
232232 *
233233 * @return int|null the numeric branch in moodle root version.php or null if not found
234234 */
235- public static function getMoodleBranch (? File $ file = null , bool $ selfPath = true ): ? int {
235+ public static function getMoodleBranch (File $ file = null , bool $ selfPath = true ) {
236236
237237 // Return already calculated value if available.
238238 if (self ::$ moodleBranch !== false ) {
@@ -250,7 +250,7 @@ public static function getMoodleBranch(?File $file = null, bool $selfPath = true
250250 throw new DeepExitException (
251251 "ERROR: Incorrect 'moodleBranch' config/runtime option. Value must be 4 digit max.: ' $ branch' " , 3 );
252252 }
253- self ::$ moodleBranch = $ branch ;
253+ self ::$ moodleBranch = ( int ) $ branch ;
254254 return self ::$ moodleBranch ;
255255 }
256256
@@ -268,7 +268,7 @@ public static function getMoodleBranch(?File $file = null, bool $selfPath = true
268268 // Find the $branch value.
269269 if ($ valueToken = $ versionFile ->findNext (T_CONSTANT_ENCAPSED_STRING , $ varToken )) {
270270 $ branch = trim ($ versionFile ->getTokens ()[$ valueToken ]['content ' ], "\"' " );
271- self ::$ moodleBranch = $ branch ;
271+ self ::$ moodleBranch = ( int ) $ branch ;
272272 return self ::$ moodleBranch ;
273273 }
274274 }
@@ -293,7 +293,7 @@ public static function getMoodleBranch(?File $file = null, bool $selfPath = true
293293 *
294294 * @return string|null the full path to moodle root or null if not found.
295295 */
296- public static function getMoodleRoot (? File $ file = null , bool $ selfPath = true ): ? string {
296+ public static function getMoodleRoot (File $ file = null , bool $ selfPath = true ) {
297297
298298 // Return already calculated value if available.
299299 if (self ::$ moodleRoot !== false ) {
0 commit comments