@@ -84,7 +84,7 @@ protected static function loadCoreComponent(string $moodleRoot): bool {
84
84
*
85
85
* @return array Associative array of components as keys and paths as values or null if not found.
86
86
*/
87
- protected static function calculateAllComponents (string $ moodleRoot ): ? array {
87
+ protected static function calculateAllComponents (string $ moodleRoot ) {
88
88
89
89
// If we have calculated the components already, straight return them.
90
90
if (!empty (self ::$ moodleComponents )) {
@@ -188,7 +188,7 @@ protected static function calculateAllComponents(string $moodleRoot): ?array {
188
188
*
189
189
* @return string|null a valid moodle component for the file or null if not found.
190
190
*/
191
- public static function getMoodleComponent (File $ file , $ selfPath = true ): ? string {
191
+ public static function getMoodleComponent (File $ file , $ selfPath = true ) {
192
192
193
193
// Verify that we are able to find a valid moodle root.
194
194
if (! $ moodleRoot = self ::getMoodleRoot ($ file , $ selfPath )) {
@@ -232,7 +232,7 @@ public static function getMoodleComponent(File $file, $selfPath = true): ?string
232
232
*
233
233
* @return int|null the numeric branch in moodle root version.php or null if not found
234
234
*/
235
- public static function getMoodleBranch (? File $ file = null , bool $ selfPath = true ): ? int {
235
+ public static function getMoodleBranch (File $ file = null , bool $ selfPath = true ) {
236
236
237
237
// Return already calculated value if available.
238
238
if (self ::$ moodleBranch !== false ) {
@@ -250,7 +250,7 @@ public static function getMoodleBranch(?File $file = null, bool $selfPath = true
250
250
throw new DeepExitException (
251
251
"ERROR: Incorrect 'moodleBranch' config/runtime option. Value must be 4 digit max.: ' $ branch' " , 3 );
252
252
}
253
- self ::$ moodleBranch = $ branch ;
253
+ self ::$ moodleBranch = ( int ) $ branch ;
254
254
return self ::$ moodleBranch ;
255
255
}
256
256
@@ -268,7 +268,7 @@ public static function getMoodleBranch(?File $file = null, bool $selfPath = true
268
268
// Find the $branch value.
269
269
if ($ valueToken = $ versionFile ->findNext (T_CONSTANT_ENCAPSED_STRING , $ varToken )) {
270
270
$ branch = trim ($ versionFile ->getTokens ()[$ valueToken ]['content ' ], "\"' " );
271
- self ::$ moodleBranch = $ branch ;
271
+ self ::$ moodleBranch = ( int ) $ branch ;
272
272
return self ::$ moodleBranch ;
273
273
}
274
274
}
@@ -293,7 +293,7 @@ public static function getMoodleBranch(?File $file = null, bool $selfPath = true
293
293
*
294
294
* @return string|null the full path to moodle root or null if not found.
295
295
*/
296
- public static function getMoodleRoot (? File $ file = null , bool $ selfPath = true ): ? string {
296
+ public static function getMoodleRoot (File $ file = null , bool $ selfPath = true ) {
297
297
298
298
// Return already calculated value if available.
299
299
if (self ::$ moodleRoot !== false ) {
0 commit comments