* @return array|object
*/
protected static function applyTransformations( array $dataIn, array $transforms ) {
- $strip = isset( $transforms['Strip'] ) ? $transforms['Strip'] : 'none';
+ $strip = $transforms['Strip'] ?? 'none';
if ( $strip === 'base' ) {
$transforms['Strip'] = 'none';
}
- $transformTypes = isset( $transforms['Types'] ) ? $transforms['Types'] : null;
+ $transformTypes = $transforms['Types'] ?? null;
if ( $transformTypes !== null && !is_array( $transformTypes ) ) {
throw new InvalidArgumentException( __METHOD__ . ':Value for "Types" must be an array' );
}
case 'kvp':
case 'BCkvp':
- $key = isset( $metadata[self::META_KVP_KEY_NAME] )
- ? $metadata[self::META_KVP_KEY_NAME]
- : $transformTypes['ArmorKVP'];
+ $key = $metadata[self::META_KVP_KEY_NAME] ?? $transformTypes['ArmorKVP'];
$valKey = isset( $transforms['BC'] ) ? '*' : 'value';
$assocAsObject = !empty( $transformTypes['AssocAsObject'] );
$merge = !empty( $metadata[self::META_KVP_MERGE] );