Skip to content

Commit 35071ba

Browse files
committed
Static mask config accessor added ClientManager::getMask() added
1 parent 2d4789a commit 35071ba

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/ClientManager.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@ public static function get(string $key, $default = null): mixed {
9595
return $value === null ? $default : $value;
9696
}
9797

98+
/**
99+
* Get the mask for a given section
100+
* @param string $section section name such as "message" or "attachment"
101+
*
102+
* @return string|null
103+
*/
104+
public static function getMask(string $section): ?string {
105+
$default_masks = ClientManager::get("masks");
106+
if (isset($default_masks[$section])) {
107+
if (class_exists($default_masks[$section])) {
108+
return $default_masks[$section];
109+
}
110+
}
111+
return null;
112+
}
113+
98114
/**
99115
* Resolve a account instance.
100116
* @param string|null $name

0 commit comments

Comments
 (0)