/** * xapp option shortcut function for xapp_has_option this will use xapp_has_option with third parameter strict = true * so option value has to be a valid value other then null, false, empty array. see xapp_has_option * * @see xapp_has_option * @param null|string $key expects the options key name to check * @param null|object|string|array $mixed expects value according to explanation above * @return bool */ function xapp_is_option($key = null, &$mixed = null) { if ($key !== null) { if (is_array($mixed)) { return xapp_is('value', $mixed[$key]); } else { if (xapped()) { return Xapp::hasOption($key, $mixed, true); } else { if (is_object($mixed) && xapp_can_options($mixed)) { return array_key_exists($key, $mixed->options) && xapp_is('value', $mixed->options[$key]) ? true : false; } else { if (is_string($mixed) && xapp_can_options($mixed)) { return array_key_exists($key, $mixed::$options) && xapp_is('value', $mixed::$options[$key]) ? true : false; } } } } } return false; }