Skip to content

Instantly share code, notes, and snippets.

@martindilling
Last active May 25, 2021 08:25
Show Gist options
  • Save martindilling/2a053193c42cc061c28eef069010ff4c to your computer and use it in GitHub Desktop.
Save martindilling/2a053193c42cc061c28eef069010ff4c to your computer and use it in GitHub Desktop.
Sometimes you find crazy things
<?php
$value = function (string $field, $default = null) use ($input_data, $notification, $user_setup) {
$from_attr = substr($field, 0, 1) === '!';
$val = $from_attr ? $user_setup->get(substr($field, 1), array_get($input_data, substr($field, 1), $default)) : $val = array_get($input_data, $field, $default);
return htmlentities(substr($val, 0, 1) === '@' ? $notification->payload->get(substr($val, 1), $default) : $val);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment