@@ -31,11 +31,16 @@ class ResponseFactory
31
31
32
32
protected $ encryptHistory ;
33
33
34
+ /***
35
+ * @param string $name The name of the root view
36
+ * @return void
37
+ */
34
38
public function setRootView (string $ name ): void
35
39
{
36
40
$ this ->rootView = $ name ;
37
41
}
38
42
43
+
39
44
/**
40
45
* @param string|array|Arrayable $key
41
46
* @param mixed $value
@@ -52,6 +57,7 @@ public function share($key, $value = null): void
52
57
}
53
58
54
59
/**
60
+ * @param string|null $key
55
61
* @param mixed $default
56
62
* @return mixed
57
63
*/
@@ -64,19 +70,27 @@ public function getShared(?string $key = null, $default = null)
64
70
return $ this ->sharedProps ;
65
71
}
66
72
67
- public function flushShared (): void
73
+
74
+ /**
75
+ * @return void
76
+ */
77
+ public function flushShared ()
68
78
{
69
79
$ this ->sharedProps = [];
70
80
}
71
81
72
82
/**
73
83
* @param Closure|string|null $version
84
+ * @return void
74
85
*/
75
86
public function version ($ version ): void
76
87
{
77
88
$ this ->version = $ version ;
78
89
}
79
90
91
+ /**
92
+ * @return string
93
+ */
80
94
public function getVersion (): string
81
95
{
82
96
$ version = $ this ->version instanceof Closure
@@ -86,11 +100,18 @@ public function getVersion(): string
86
100
return (string ) $ version ;
87
101
}
88
102
103
+ /**
104
+ * @return void
105
+ */
89
106
public function clearHistory (): void
90
107
{
91
108
session (['inertia.clear_history ' => true ]);
92
109
}
93
110
111
+ /**
112
+ * @param bool $encrypt
113
+ * @return void
114
+ */
94
115
public function encryptHistory ($ encrypt = true ): void
95
116
{
96
117
$ this ->encryptHistory = $ encrypt ;
@@ -104,34 +125,48 @@ public function lazy(callable $callback): LazyProp
104
125
return new LazyProp ($ callback );
105
126
}
106
127
128
+ /**
129
+ * @param callable $callback
130
+ * @return OptionalProp
131
+ */
107
132
public function optional (callable $ callback ): OptionalProp
108
133
{
109
134
return new OptionalProp ($ callback );
110
135
}
111
136
137
+ /**
138
+ *
139
+ * @param callable $callback
140
+ * @param string $group
141
+ * @return DeferProp
142
+ */
112
143
public function defer (callable $ callback , string $ group = 'default ' ): DeferProp
113
144
{
114
145
return new DeferProp ($ callback , $ group );
115
146
}
116
147
117
148
/**
118
149
* @param mixed $value
150
+ * @return MergeProp
119
151
*/
120
152
public function merge ($ value ): MergeProp
121
153
{
122
154
return new MergeProp ($ value );
123
155
}
124
156
125
157
/**
126
- * @param mixed $value
158
+ * @param mixed $value
159
+ * @return AlwaysProp
127
160
*/
128
161
public function always ($ value ): AlwaysProp
129
162
{
130
163
return new AlwaysProp ($ value );
131
164
}
132
165
133
166
/**
134
- * @param array|Arrayable $props
167
+ * @param string $component
168
+ * @param array|Arrayable $props
169
+ * @return Response
135
170
*/
136
171
public function render (string $ component , $ props = []): Response
137
172
{
@@ -150,6 +185,7 @@ public function render(string $component, $props = []): Response
150
185
151
186
/**
152
187
* @param string|SymfonyRedirect $url
188
+ * @return SymfonyResponse
153
189
*/
154
190
public function location ($ url ): SymfonyResponse
155
191
{
0 commit comments