/** * Validate item types * * @since 0.0.7 * * @access protected * * @param array $data Item config * @param string $key Optional. Array key to test in. Default is "types" * * @return bool True if valid, false if not */ protected static function validate_type($data, $key = 'type') { if (!in_array($data[$key], types::allowed_types())) { return false; } return true; }
/** * Validate test type * * @since 0.2.0 * * @param string $value * * @return bool */ public function allowed_type($value) { return in_array($value, types::allowed_types()); }