Automattic\WooCommerce\Vendor\Sabberworm\CSS
OutputFormatter::safely
Runs the given code, either swallowing or passing exceptions, depending on the bIgnoreExceptions setting.
Метод класса: OutputFormatter{}
Хуков нет.
Возвращает
Строку|null.
Использование
$OutputFormatter = new OutputFormatter(); $OutputFormatter->safely( $cCode );
- $cCode(строка) (обязательный)
- the name of the function to call.
Код OutputFormatter::safely() OutputFormatter::safely WC 10.4.3
public function safely($cCode)
{
if ($this->oFormat->get('IgnoreExceptions')) {
// If output exceptions are ignored, run the code with exception guards
try {
return $cCode();
} catch (OutputException $e) {
return null;
} // Do nothing
} else {
// Run the code as-is
return $cCode();
}
}