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 ;
@@ -1628,7 +1628,7 @@ private function matchAndApplyLexiconDefinition(
16281628 return true ;
16291629 }
16301630
1631- /** @var ConfigLexiconEntry $configValue */
1631+ /** @var Entry $configValue */
16321632 $ configValue = $ configDetails ['entries ' ][$ key ];
16331633 $ type &= ~self ::VALUE_SENSITIVE ;
16341634
@@ -1658,28 +1658,28 @@ private function matchAndApplyLexiconDefinition(
16581658 /**
16591659 * manage ConfigLexicon behavior based on strictness set in IConfigLexicon
16601660 *
1661- * @param ConfigLexiconStrictness |null $strictness
1661+ * @param Strictness |null $strictness
16621662 * @param string $line
16631663 *
16641664 * @return bool TRUE if conflict can be fully ignored, FALSE if action should be not performed
16651665 * @throws AppConfigUnknownKeyException if strictness implies exception
1666- * @see IConfigLexicon ::getStrictness()
1666+ * @see ILexicon ::getStrictness()
16671667 */
16681668 private function applyLexiconStrictness (
1669- ?ConfigLexiconStrictness $ strictness ,
1669+ ?Strictness $ strictness ,
16701670 string $ line = '' ,
16711671 ): bool {
16721672 if ($ strictness === null ) {
16731673 return true ;
16741674 }
16751675
16761676 switch ($ strictness ) {
1677- case ConfigLexiconStrictness ::IGNORE :
1677+ case Strictness ::IGNORE :
16781678 return true ;
1679- case ConfigLexiconStrictness ::NOTICE :
1679+ case Strictness ::NOTICE :
16801680 $ this ->logger ->notice ($ line );
16811681 return true ;
1682- case ConfigLexiconStrictness ::WARNING :
1682+ case Strictness ::WARNING :
16831683 $ this ->logger ->warning ($ line );
16841684 return false ;
16851685 }
@@ -1693,7 +1693,7 @@ private function applyLexiconStrictness(
16931693 * @param string $appId
16941694 * @internal
16951695 *
1696- * @return array{entries: array<string, ConfigLexiconEntry >, aliases: array<string, string>, strictness: ConfigLexiconStrictness }
1696+ * @return array{entries: array<string, Entry >, aliases: array<string, string>, strictness: Strictness }
16971697 */
16981698 public function getConfigDetailsFromLexicon (string $ appId ): array {
16991699 if (!array_key_exists ($ appId , $ this ->configLexiconDetails )) {
@@ -1710,14 +1710,14 @@ public function getConfigDetailsFromLexicon(string $appId): array {
17101710 $ this ->configLexiconDetails [$ appId ] = [
17111711 'entries ' => $ entries ,
17121712 'aliases ' => $ aliases ,
1713- 'strictness ' => $ configLexicon ?->getStrictness() ?? ConfigLexiconStrictness ::IGNORE
1713+ 'strictness ' => $ configLexicon ?->getStrictness() ?? Strictness ::IGNORE
17141714 ];
17151715 }
17161716
17171717 return $ this ->configLexiconDetails [$ appId ];
17181718 }
17191719
1720- private function getLexiconEntry (string $ appId , string $ key ): ?ConfigLexiconEntry {
1720+ private function getLexiconEntry (string $ appId , string $ key ): ?Entry {
17211721 return $ this ->getConfigDetailsFromLexicon ($ appId )['entries ' ][$ key ] ?? null ;
17221722 }
17231723
0 commit comments