1111
1212use InvalidArgumentException ;
1313use JsonException ;
14- use NCU \Config \Lexicon \ConfigLexiconEntry ;
15- use NCU \Config \Lexicon \ConfigLexiconStrictness ;
16- use NCU \Config \Lexicon \IConfigLexicon ;
17- use NCU \Config \Lexicon \Preset ;
1814use OC \AppFramework \Bootstrap \Coordinator ;
1915use OC \Config \ConfigManager ;
16+ use OCP \Config \Lexicon \Entry ;
17+ use OCP \Config \Lexicon \ILexicon ;
18+ use OCP \Config \Lexicon \Preset ;
19+ use OCP \Config \Lexicon \Strictness ;
2020use OCP \DB \Exception as DBException ;
2121use OCP \DB \QueryBuilder \IQueryBuilder ;
2222use OCP \Exceptions \AppConfigIncorrectTypeException ;
@@ -62,7 +62,7 @@ class AppConfig implements IAppConfig {
6262 private array $ valueTypes = []; // type for all config values
6363 private bool $ fastLoaded = false ;
6464 private bool $ lazyLoaded = false ;
65- /** @var array<string, array{entries: array<string, ConfigLexiconEntry >, aliases: array<string, string>, strictness: ConfigLexiconStrictness }> ['app_id' => ['strictness' => ConfigLexiconStrictness, 'entries' => ['config_key' => ConfigLexiconEntry[]]] */
65+ /** @var array<string, array{entries: array<string, Entry >, aliases: array<string, string>, strictness: Strictness }> ['app_id' => ['strictness' => ConfigLexiconStrictness, 'entries' => ['config_key' => ConfigLexiconEntry[]]] */
6666 private array $ configLexiconDetails = [];
6767 private bool $ ignoreLexiconAliases = false ;
6868 private ?Preset $ configLexiconPreset = null ;
@@ -1655,7 +1655,7 @@ private function matchAndApplyLexiconDefinition(
16551655 return true ;
16561656 }
16571657
1658- /** @var ConfigLexiconEntry $configValue */
1658+ /** @var Entry $configValue */
16591659 $ configValue = $ configDetails ['entries ' ][$ key ];
16601660 $ type &= ~self ::VALUE_SENSITIVE ;
16611661
@@ -1685,28 +1685,28 @@ private function matchAndApplyLexiconDefinition(
16851685 /**
16861686 * manage ConfigLexicon behavior based on strictness set in IConfigLexicon
16871687 *
1688- * @param ConfigLexiconStrictness |null $strictness
1688+ * @param Strictness |null $strictness
16891689 * @param string $line
16901690 *
16911691 * @return bool TRUE if conflict can be fully ignored, FALSE if action should be not performed
16921692 * @throws AppConfigUnknownKeyException if strictness implies exception
1693- * @see IConfigLexicon ::getStrictness()
1693+ * @see ILexicon ::getStrictness()
16941694 */
16951695 private function applyLexiconStrictness (
1696- ?ConfigLexiconStrictness $ strictness ,
1696+ ?Strictness $ strictness ,
16971697 string $ line = '' ,
16981698 ): bool {
16991699 if ($ strictness === null ) {
17001700 return true ;
17011701 }
17021702
17031703 switch ($ strictness ) {
1704- case ConfigLexiconStrictness ::IGNORE :
1704+ case Strictness ::IGNORE :
17051705 return true ;
1706- case ConfigLexiconStrictness ::NOTICE :
1706+ case Strictness ::NOTICE :
17071707 $ this ->logger ->notice ($ line );
17081708 return true ;
1709- case ConfigLexiconStrictness ::WARNING :
1709+ case Strictness ::WARNING :
17101710 $ this ->logger ->warning ($ line );
17111711 return false ;
17121712 }
@@ -1720,7 +1720,7 @@ private function applyLexiconStrictness(
17201720 * @param string $appId
17211721 * @internal
17221722 *
1723- * @return array{entries: array<string, ConfigLexiconEntry >, aliases: array<string, string>, strictness: ConfigLexiconStrictness }
1723+ * @return array{entries: array<string, Entry >, aliases: array<string, string>, strictness: Strictness }
17241724 */
17251725 public function getConfigDetailsFromLexicon (string $ appId ): array {
17261726 if (!array_key_exists ($ appId , $ this ->configLexiconDetails )) {
@@ -1737,14 +1737,14 @@ public function getConfigDetailsFromLexicon(string $appId): array {
17371737 $ this ->configLexiconDetails [$ appId ] = [
17381738 'entries ' => $ entries ,
17391739 'aliases ' => $ aliases ,
1740- 'strictness ' => $ configLexicon ?->getStrictness() ?? ConfigLexiconStrictness ::IGNORE
1740+ 'strictness ' => $ configLexicon ?->getStrictness() ?? Strictness ::IGNORE
17411741 ];
17421742 }
17431743
17441744 return $ this ->configLexiconDetails [$ appId ];
17451745 }
17461746
1747- private function getLexiconEntry (string $ appId , string $ key ): ?ConfigLexiconEntry {
1747+ private function getLexiconEntry (string $ appId , string $ key ): ?Entry {
17481748 return $ this ->getConfigDetailsFromLexicon ($ appId )['entries ' ][$ key ] ?? null ;
17491749 }
17501750
0 commit comments