-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext_args.v
More file actions
123 lines (92 loc) · 3.02 KB
/
Copy pathcontext_args.v
File metadata and controls
123 lines (92 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module vphp
import vphp.zend as _
// 获取当前 PHP 函数调用的所有参数
pub fn (ctx Context) get_args() []ZVal {
return ctx.ex.args()
}
// ======== 参数读取 ========
pub fn (ctx Context) arg_raw(index int) ZVal {
return ctx.ex.arg(index)
}
// Low-level borrowed view; prefer `arg_borrowed_zbox()` for ownership-facing
pub fn (ctx Context) arg_borrowed_zbox(index int) RequestBorrowedZBox {
return ctx.ex.arg_borrowed_zbox(index)
}
pub fn (ctx Context) arg_borrowed_zbox_opt(index int) ?RequestBorrowedZBox {
return ctx.ex.arg_borrowed_zbox_opt(index)
}
pub fn (ctx Context) arg_any_zbox(index int) RequestBorrowedZBox {
return ctx.arg_borrowed_zbox(index)
}
pub fn (ctx Context) arg_value(index int) PhpValue {
return ctx.ex.arg_value(index)
}
pub fn (ctx Context) arg_null(index int) ?PhpNull {
return ctx.arg_at(index).null_value()
}
pub fn (ctx Context) arg_bool(index int) ?PhpBool {
return ctx.arg_at(index).bool_value()
}
pub fn (ctx Context) arg_int(index int) ?PhpInt {
return ctx.arg_at(index).int_value()
}
pub fn (ctx Context) arg_double(index int) ?PhpDouble {
return ctx.arg_at(index).double_value()
}
pub fn (ctx Context) arg_string(index int) ?PhpString {
return ctx.arg_at(index).string_value()
}
pub fn (ctx Context) arg_scalar(index int) ?PhpScalar {
return ctx.arg_at(index).scalar()
}
pub fn (ctx Context) arg_v_scalar(index int) !VScalarValue {
return VScalarValue.from_zval(ctx.arg_val(index))
}
pub fn (ctx Context) arg_v_scalar_opt(index int) ?VScalarValue {
return VScalarValue.from_zval(ctx.arg_val(index)) or { return none }
}
pub fn (ctx Context) arg_array(index int) ?PhpArray {
return ctx.arg_at(index).array()
}
pub fn (ctx Context) arg_object(index int) ?PhpObject {
return ctx.arg_at(index).object()
}
pub fn (ctx Context) arg_callable(index int) ?PhpCallable {
return ctx.arg_at(index).callable()
}
pub fn (ctx Context) arg_resource(index int) ?PhpResource {
return ctx.arg_at(index).resource()
}
pub fn (ctx Context) arg_reference(index int) ?PhpReference {
return ctx.arg_at(index).reference()
}
pub fn (ctx Context) arg_iterable(index int) ?PhpIterable {
return ctx.arg_at(index).iterable()
}
pub fn (ctx Context) arg_iterator(index int) ?PhpIterator {
return ctx.arg_at(index).iterator()
}
pub fn (ctx Context) arg_throwable(index int) ?PhpThrowable {
return ctx.arg_at(index).throwable()
}
pub fn (ctx Context) arg_enum_case(index int) ?PhpEnumCase {
return ctx.arg_at(index).enum_case()
}
pub fn (ctx Context) arg_owned_request_zbox(index int) RequestOwnedZBox {
return ctx.arg_at(index).request_owned_zbox()
}
pub fn (ctx Context) arg_owned_persistent_zbox(index int) PersistentOwnedZBox {
return ctx.arg_at(index).persistent_owned_zbox()
}
pub fn (ctx Context) arg[T](index int) T {
return ctx.ex.v_arg[T](index)
}
pub fn (ctx Context) arg_opt[T](index int) ?T {
return ctx.ex.v_arg_opt[T](index)
}
pub fn (ctx Context) arg_val(index int) ZVal {
return ctx.ex.arg_or_null(index)
}
pub fn (ctx Context) arg_raw_obj(index int) voidptr {
return ctx.arg_at(index).raw_obj()
}