diff options
-rw-r--r-- | core/js/setupchecks.js | 2 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 30 | ||||
-rw-r--r-- | lib/private/DB/MissingIndexInformation.php | 6 | ||||
-rw-r--r-- | settings/Controller/CheckSetupController.php | 6 |
4 files changed, 25 insertions, 19 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index a3155287ac6..1fa69819377 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -183,7 +183,7 @@ type: OC.SetupChecks.MESSAGE_TYPE_INFO }) } - if (data.hasMissingIndexes) { + if (data.hasMissingIndexes.length > 0) { var listOfMissingIndexes = ""; data.hasMissingIndexes.forEach(function(element){ listOfMissingIndexes += "<li>"; diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index feef66c353e..b2a3ce2c4bf 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -157,7 +157,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -191,7 +192,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -226,7 +228,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -259,7 +262,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -290,7 +294,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -321,7 +326,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -352,7 +358,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: false, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -404,7 +411,8 @@ describe('OC.SetupChecks tests', function() { hasPassedCodeIntegrityCheck: true, isOpcacheProperlySetup: true, isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -436,7 +444,8 @@ describe('OC.SetupChecks tests', function() { isOpcacheProperlySetup: false, phpOpcacheDocumentation: 'https://example.org/link/to/doc', isSettimelimitAvailable: true, - hasFreeTypeSupport: true + hasFreeTypeSupport: true, + hasMissingIndexes: [] }) ); @@ -468,7 +477,8 @@ describe('OC.SetupChecks tests', function() { isOpcacheProperlySetup: true, phpOpcacheDocumentation: 'https://example.org/link/to/doc', isSettimelimitAvailable: true, - hasFreeTypeSupport: false + hasFreeTypeSupport: false, + hasMissingIndexes: [] }) ); diff --git a/lib/private/DB/MissingIndexInformation.php b/lib/private/DB/MissingIndexInformation.php index d6e40e0b09e..0cb9852d0d4 100644 --- a/lib/private/DB/MissingIndexInformation.php +++ b/lib/private/DB/MissingIndexInformation.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2018 Morris Jobke <hey@morrisjobke.de> * @@ -21,19 +22,18 @@ namespace OC\DB; - class MissingIndexInformation { private $listOfMissingIndexes = []; - public function addHintForMissingSubject($tableName, $indexName) { + public function addHintForMissingSubject(string $tableName, string $indexName) { $this->listOfMissingIndexes[] = [ 'tableName' => $tableName, 'indexName' => $indexName ]; } - public function getListOfMissingIndexes() { + public function getListOfMissingIndexes(): array { return $this->listOfMissingIndexes; } }
\ No newline at end of file diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index e1073be4697..4080cfab029 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -415,11 +415,7 @@ Raw output return function_exists('imagettfbbox') && function_exists('imagettftext'); } - /** - * Check if the required FreeType functions are present - * @return bool - */ - protected function hasMissingIndexes() { + protected function hasMissingIndexes(): array { $indexInfo = new MissingIndexInformation(); // Dispatch event so apps can also hint for pending index updates if needed $event = new GenericEvent($indexInfo); |