@@ -1094,6 +1094,50 @@ public function getDetails(string $app, string $key): array {
10941094		];
10951095	}
10961096
1097+ 	/** 
1098+ 	 * @inheritDoc 
1099+ 	 * 
1100+ 	 * @param string $app id of the app 
1101+ 	 * @param string $key config key 
1102+ 	 * 
1103+ 	 * @return array 
1104+ 	 * @since 32.0.0 
1105+ 	 */ 
1106+ 	public  function  getKeyDetails (string  $ app , string  $ key ): array  {
1107+ 		$ this  ->assertParams ($ app , $ key );
1108+ 		try  {
1109+ 			$ details  = $ this  ->getDetails ($ app , $ key );
1110+ 		} catch  (AppConfigUnknownKeyException   $ e ) {
1111+ 			$ details  = [
1112+ 				'app '  => $ app ,
1113+ 				'key '  => $ key
1114+ 			];
1115+ 		}
1116+ 
1117+ 		/** @var Entry $lexiconEntry */ 
1118+ 		try  {
1119+ 			$ lazy  = false ;
1120+ 			$ this  ->matchAndApplyLexiconDefinition ($ app , $ key , $ lazy , lexiconEntry: $ lexiconEntry );
1121+ 		} catch  (AppConfigTypeConflictException  |AppConfigUnknownKeyException  ) {
1122+ 			// can be ignored 
1123+ 		}
1124+ 
1125+ 		if  ($ lexiconEntry  !== null ) {
1126+ 			$ details  = array_merge ($ details , [
1127+ 				'lazy '  => $ lexiconEntry ->isLazy (),
1128+ 				'valueType '  => $ lexiconEntry ->getValueType (),
1129+ 				'valueTypeName '  => $ lexiconEntry ->getValueType ()->name ,
1130+ 				'sensitive '  => $ lexiconEntry ->isFlagged (self ::FLAG_SENSITIVE ),
1131+ 				'default '  => $ lexiconEntry ->getDefault ($ this  ->getLexiconPreset ()),
1132+ 				'definition '  => $ lexiconEntry ->getDefinition (),
1133+ 				'note '  => $ lexiconEntry ->getNote (),
1134+ 				'warning '  => $ lexiconEntry ->getWarning ()
1135+ 			]);
1136+ 		}
1137+ 
1138+ 		return  array_filter ($ details );
1139+ 	}
1140+ 
10971141	/** 
10981142	 * @param string $type 
10991143	 * 
@@ -1631,6 +1675,7 @@ private function matchAndApplyLexiconDefinition(
16311675		?bool  &$ lazy  = null ,
16321676		int  &$ type  = self ::VALUE_MIXED ,
16331677		?string  &$ default  = null ,
1678+ 		?Entry   &$ lexiconEntry  = null ,
16341679	): bool  {
16351680		if  (in_array ($ key ,
16361681			[
@@ -1655,27 +1700,27 @@ private function matchAndApplyLexiconDefinition(
16551700			return  true ;
16561701		}
16571702
1658- 		/** @var Entry $configValue  */ 
1659- 		$ configValue   = $ configDetails ['entries ' ][$ key ];
1703+ 		/** @var Entry $lexiconEntry  */ 
1704+ 		$ lexiconEntry   = $ configDetails ['entries ' ][$ key ];
16601705		$ type  &= ~self ::VALUE_SENSITIVE ;
16611706
1662- 		$ appConfigValueType  = $ configValue  ->getValueType ()->toAppConfigFlag ();
1707+ 		$ appConfigValueType  = $ lexiconEntry  ->getValueType ()->toAppConfigFlag ();
16631708		if  ($ type  === self ::VALUE_MIXED ) {
16641709			$ type  = $ appConfigValueType ; // we overwrite if value was requested as mixed 
16651710		} elseif  ($ appConfigValueType  !== $ type ) {
16661711			throw  new  AppConfigTypeConflictException ('The app config key  '  . $ app  . '/ '  . $ key  . ' is typed incorrectly in relation to the config lexicon ' );
16671712		}
16681713
1669- 		$ lazy  = $ configValue  ->isLazy ();
1714+ 		$ lazy  = $ lexiconEntry  ->isLazy ();
16701715		// only look for default if needed, default from Lexicon got priority 
16711716		if  ($ default  !== null ) {
1672- 			$ default  = $ configValue  ->getDefault ($ this  ->getLexiconPreset ()) ?? $ default ;
1717+ 			$ default  = $ lexiconEntry  ->getDefault ($ this  ->getLexiconPreset ()) ?? $ default ;
16731718		}
16741719
1675- 		if  ($ configValue  ->isFlagged (self ::FLAG_SENSITIVE )) {
1720+ 		if  ($ lexiconEntry  ->isFlagged (self ::FLAG_SENSITIVE )) {
16761721			$ type  |= self ::VALUE_SENSITIVE ;
16771722		}
1678- 		if  ($ configValue  ->isDeprecated ()) {
1723+ 		if  ($ lexiconEntry  ->isDeprecated ()) {
16791724			$ this  ->logger ->notice ('App config key  '  . $ app  . '/ '  . $ key  . ' is set as deprecated. ' );
16801725		}
16811726
0 commit comments