11
11
12
12
use InvalidArgumentException ;
13
13
use 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 ;
18
14
use OC \AppFramework \Bootstrap \Coordinator ;
19
15
use 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 ;
20
20
use OCP \DB \Exception as DBException ;
21
21
use OCP \DB \QueryBuilder \IQueryBuilder ;
22
22
use OCP \Exceptions \AppConfigIncorrectTypeException ;
@@ -62,7 +62,7 @@ class AppConfig implements IAppConfig {
62
62
private array $ valueTypes = []; // type for all config values
63
63
private bool $ fastLoaded = false ;
64
64
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[]]] */
66
66
private array $ configLexiconDetails = [];
67
67
private bool $ ignoreLexiconAliases = false ;
68
68
private ?Preset $ configLexiconPreset = null ;
@@ -1655,7 +1655,7 @@ private function matchAndApplyLexiconDefinition(
1655
1655
return true ;
1656
1656
}
1657
1657
1658
- /** @var ConfigLexiconEntry $configValue */
1658
+ /** @var Entry $configValue */
1659
1659
$ configValue = $ configDetails ['entries ' ][$ key ];
1660
1660
$ type &= ~self ::VALUE_SENSITIVE ;
1661
1661
@@ -1685,28 +1685,28 @@ private function matchAndApplyLexiconDefinition(
1685
1685
/**
1686
1686
* manage ConfigLexicon behavior based on strictness set in IConfigLexicon
1687
1687
*
1688
- * @param ConfigLexiconStrictness |null $strictness
1688
+ * @param Strictness |null $strictness
1689
1689
* @param string $line
1690
1690
*
1691
1691
* @return bool TRUE if conflict can be fully ignored, FALSE if action should be not performed
1692
1692
* @throws AppConfigUnknownKeyException if strictness implies exception
1693
- * @see IConfigLexicon ::getStrictness()
1693
+ * @see ILexicon ::getStrictness()
1694
1694
*/
1695
1695
private function applyLexiconStrictness (
1696
- ?ConfigLexiconStrictness $ strictness ,
1696
+ ?Strictness $ strictness ,
1697
1697
string $ line = '' ,
1698
1698
): bool {
1699
1699
if ($ strictness === null ) {
1700
1700
return true ;
1701
1701
}
1702
1702
1703
1703
switch ($ strictness ) {
1704
- case ConfigLexiconStrictness ::IGNORE :
1704
+ case Strictness ::IGNORE :
1705
1705
return true ;
1706
- case ConfigLexiconStrictness ::NOTICE :
1706
+ case Strictness ::NOTICE :
1707
1707
$ this ->logger ->notice ($ line );
1708
1708
return true ;
1709
- case ConfigLexiconStrictness ::WARNING :
1709
+ case Strictness ::WARNING :
1710
1710
$ this ->logger ->warning ($ line );
1711
1711
return false ;
1712
1712
}
@@ -1720,7 +1720,7 @@ private function applyLexiconStrictness(
1720
1720
* @param string $appId
1721
1721
* @internal
1722
1722
*
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 }
1724
1724
*/
1725
1725
public function getConfigDetailsFromLexicon (string $ appId ): array {
1726
1726
if (!array_key_exists ($ appId , $ this ->configLexiconDetails )) {
@@ -1737,14 +1737,14 @@ public function getConfigDetailsFromLexicon(string $appId): array {
1737
1737
$ this ->configLexiconDetails [$ appId ] = [
1738
1738
'entries ' => $ entries ,
1739
1739
'aliases ' => $ aliases ,
1740
- 'strictness ' => $ configLexicon ?->getStrictness() ?? ConfigLexiconStrictness ::IGNORE
1740
+ 'strictness ' => $ configLexicon ?->getStrictness() ?? Strictness ::IGNORE
1741
1741
];
1742
1742
}
1743
1743
1744
1744
return $ this ->configLexiconDetails [$ appId ];
1745
1745
}
1746
1746
1747
- private function getLexiconEntry (string $ appId , string $ key ): ?ConfigLexiconEntry {
1747
+ private function getLexiconEntry (string $ appId , string $ key ): ?Entry {
1748
1748
return $ this ->getConfigDetailsFromLexicon ($ appId )['entries ' ][$ key ] ?? null ;
1749
1749
}
1750
1750
0 commit comments