diff --git a/moodle/Util/MoodleUtil.php b/moodle/Util/MoodleUtil.php index b15aeb44..a8e9ecb8 100644 --- a/moodle/Util/MoodleUtil.php +++ b/moodle/Util/MoodleUtil.php @@ -84,7 +84,7 @@ protected static function loadCoreComponent(string $moodleRoot): bool { * * @return array Associative array of components as keys and paths as values or null if not found. */ - protected static function calculateAllComponents(string $moodleRoot): ?array { + protected static function calculateAllComponents(string $moodleRoot) { // If we have calculated the components already, straight return them. if (!empty(self::$moodleComponents)) { @@ -188,7 +188,7 @@ protected static function calculateAllComponents(string $moodleRoot): ?array { * * @return string|null a valid moodle component for the file or null if not found. */ - public static function getMoodleComponent(File $file, $selfPath = true): ?string { + public static function getMoodleComponent(File $file, $selfPath = true) { // Verify that we are able to find a valid moodle root. if (! $moodleRoot = self::getMoodleRoot($file, $selfPath)) { @@ -232,7 +232,7 @@ public static function getMoodleComponent(File $file, $selfPath = true): ?string * * @return int|null the numeric branch in moodle root version.php or null if not found */ - public static function getMoodleBranch(?File $file = null, bool $selfPath = true): ?int { + public static function getMoodleBranch(File $file = null, bool $selfPath = true) { // Return already calculated value if available. if (self::$moodleBranch !== false) { @@ -293,7 +293,7 @@ public static function getMoodleBranch(?File $file = null, bool $selfPath = true * * @return string|null the full path to moodle root or null if not found. */ - public static function getMoodleRoot(?File $file = null, bool $selfPath = true): ?string { + public static function getMoodleRoot(File $file = null, bool $selfPath = true) { // Return already calculated value if available. if (self::$moodleRoot !== false) { diff --git a/moodle/tests/moodleutil_test.php b/moodle/tests/moodleutil_test.php index 59505616..82c1725a 100644 --- a/moodle/tests/moodleutil_test.php +++ b/moodle/tests/moodleutil_test.php @@ -142,7 +142,7 @@ public function getMoodleComponentProvider() { * * @dataProvider getMoodleComponentProvider */ - public function test_getMoodleComponent(array $config, array $return, ?bool $reset = true, ?bool $selfPath = true) { + public function test_getMoodleComponent(array $config, array $return, bool $reset = true, bool $selfPath = true) { $file = null; // Set config options when passed. if ($config) { @@ -240,7 +240,7 @@ public function getMoodleBranchProvider() { * * @dataProvider getMoodleBranchProvider */ - public function test_getMoodleBranch(array $config, array $return, ?bool $reset = true, ?bool $selfPath = true) { + public function test_getMoodleBranch(array $config, array $return, bool $reset = true, bool $selfPath = true) { $file = null; // Set config options when passed. if ($config) { @@ -342,7 +342,7 @@ public function getMoodleRootProvider() { * * @dataProvider getMoodleRootProvider */ - public function test_getMoodleRoot(array $config, array $return, ?bool $reset = true, ?bool $selfPath = true) { + public function test_getMoodleRoot(array $config, array $return, bool $reset = true, bool $selfPath = true) { $file = null; // Set config options when passed. if ($config) {