-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.power
More file actions
377 lines (343 loc) · 10.7 KB
/
code.power
File metadata and controls
377 lines (343 loc) · 10.7 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
/**
* Magic method to get a value from the registry.
*
* Allows for accessing registry data using object property syntax.
*
* @param string $name The name of the property to get.
*
* @return mixed The value of the property, or null if not found.
* @since 5.0.4
*/
public function __get($name);
/**
* Magic method to set a value in the registry.
*
* Allows for setting registry data using object property syntax.
*
* @param string $name The name of the property to set.
* @param mixed $value The value to set.
*
* @return void
* @since 5.0.4
*/
public function __set($name, $value);
/**
* Magic method to check if a property is set in the registry.
*
* Allows for using isset() on registry properties.
*
* @param string $name The name of the property to check.
*
* @return bool True if the property is set, false otherwise.
* @since 5.0.4
*/
public function __isset($name);
/**
* Magic method to unset a property in the registry.
*
* Allows for using unset() on registry properties.
*
* @param string $name The name of the property to unset.
*
* @return void
* @since 5.0.4
*/
public function __unset($name);
/**
* Magic method to clone the registry.
*
* Performs a deep copy of the registry data.
*
* @return void
* @since 5.0.4
*/
public function __clone();
/**
* Magic method to convert the registry to a string.
*
* Returns the registry data in JSON format.
*
* @return string The registry data in JSON format.
* @since 5.0.4
*/
public function __toString();
/**
* Loads data into the registry from a string using Joomla's format classes.
*
* @param string $data The data string to load.
* @param string $format The format of the data string. Supported formats: 'json', 'ini', 'xml', 'php'.
* @param array $options Options used by the formatter
*
* @return self
* @throws \InvalidArgumentException If the format is not supported.
* @since 5.0.4
*/
public function loadString(string $data, string $format = 'JSON', array $options = []): self;
/**
* Loads data into the registry from an object.
*
* @param object $object The data object to load.
*
* @return self
* @since 5.0.4
*/
public function loadObject(object $object): self;
/**
* Loads data into the registry from an array.
*
* The loaded data will be merged into the registry's existing data.
*
* @param array $array The array of data to load into the registry.
*
* @return self
* @since 5.0.4
*/
public function loadArray(array $array): self;
/**
* Loads data into the registry from a file.
*
* @param string $path The path to the file to load.
* @param string $format The format of the file. Supported formats: 'json', 'ini', 'xml', 'php'.
*
* @return self
* @throws \InvalidArgumentException If the file does not exist or is not readable.
* @throws \RuntimeException If the file cannot be read.
* @since 5.0.4
*/
public function loadFile(string $path, string $format = 'json'): self;
/**
* Sets a value into the registry using multiple keys.
*
* @param string $path Registry path (e.g. vdm.content.builder)
* @param mixed $value Value of entry
*
* @throws \InvalidArgumentException If any of the path values are not a number or string.
* @return self
* @since 3.2.0
*/
public function set(string $path, $value): self;
/**
* Adds content into the registry. If a key exists,
* it either appends or concatenates based on $asArray switch.
*
* @param string $path Registry path (e.g. vdm.content.builder)
* @param mixed $value Value of entry
* @param bool|null $asArray Determines if the new value should be treated as an array.
* Default is $addAsArray = false (if null) in base class.
* Override in child class allowed set class property $addAsArray = true.
*
* @throws \InvalidArgumentException If any of the path values are not a number or string.
* @return self
* @since 3.2.0
*/
public function add(string $path, $value, ?bool $asArray = null): self;
/**
* Retrieves a value (or sub-array) from the registry using multiple keys.
*
* @param string $path Registry path (e.g. vdm.content.builder)
* @param mixed $default Optional default value, returned if the internal doesn't exist.
*
* @throws \InvalidArgumentException If any of the path values are not a number or string.
* @return mixed The value or sub-array from the storage. Null if the location doesn't exist.
* @since 3.2.0
*/
public function get(string $path, $default = null): mixed;
/**
* Removes a value (or sub-array) from the registry using multiple keys.
*
* @param string $path Registry path (e.g. vdm.content.builder)
*
* @throws \InvalidArgumentException If any of the path values are not a number or string.
* @return self
* @since 3.2.0
*/
public function remove(string $path): self;
/**
* Checks the existence of a particular location in the registry using multiple keys.
*
* @param string $path Registry path (e.g. vdm.content.builder)
*
* @throws \InvalidArgumentException If any of the path values are not a number or string.
* @return bool True if the location exists, false otherwise.
* @since 3.2.0
*/
public function exists(string $path): bool;
/**
* Specify data which should be serialized to JSON.
*
* @return mixed Data which can be serialized by json_encode(),
* which is a value of any type other than a resource.
* @since 5.0.4
*/
public function jsonSerialize(): mixed;
/**
* Count elements of the registry.
*
* @return int The number of elements in the registry.
* @since 5.0.4
*/
public function count(): int;
/**
* Whether a given offset exists in the registry.
*
* @param mixed $offset An offset to check for.
*
* @return bool True if the offset exists, false otherwise.
* @since 5.0.4
*/
public function offsetExists(mixed $offset): bool;
/**
* Retrieve the value at a given offset.
*
* @param mixed $offset The offset to retrieve.
*
* @return mixed The value at the specified offset.
* @since 5.0.4
*/
public function offsetGet(mixed $offset): mixed;
/**
* Set the value at a given offset.
*
* @param mixed $offset The offset to assign the value to.
* @param mixed $value The value to set.
*
* @return void
* @since 5.0.4
*/
public function offsetSet(mixed $offset, mixed $value): void;
/**
* Unset the value at a given offset.
*
* @param mixed $offset The offset to unset.
*
* @return void
* @since 5.0.4
*/
public function offsetUnset(mixed $offset): void;
/**
* Retrieve an external iterator for the registry.
*
* @return \Traversable An instance of an object implementing Iterator or Traversable.
* @since 5.0.4
*/
public function getIterator(): \Traversable;
/**
* Get the registry data as an associative array.
*
* @return array The registry data.
* @since 5.0.4
*/
public function toArray(): array;
/**
* Get the registry data as an object.
*
* @return object The registry data converted to an object.
* @since 5.0.4
*/
public function toObject();
/**
* Converts the registry data to a string in the specified format.
*
* @param string $format The format to output the string in. Supported formats: 'json', 'ini', 'xml', 'php'.
* @param array $options Options used by the formatter.
*
* @return string The registry data in the specified format.
*
* @throws \InvalidArgumentException If the format is not supported.
* @since 5.0.4
*/
public function toString(string $format = 'JSON', array $options = []): string;
/**
* Flattens the registry data into a one-dimensional array.
*
* @param string|null $separator The separator for the key names.
* @param bool $full True to include the full path as keys.
*
* @return array The flattened data array.
* @since 5.0.4
*/
public function flatten(?string $separator = null, bool $full = false): array;
/**
* Sets a default value if not already set.
*
* @param string $path The registry path (e.g., 'vdm.content.builder').
* @param mixed $default The default value to set if the path does not exist.
*
* @return mixed The value of the path after the method call.
* @since 5.0.4
*/
public function def(string $path, $default);
/**
* Merges another registry into this one.
*
* The data from the source registry will be merged into this registry,
* overwriting any existing values with the same keys.
*
* @param Registryinterface $source The registry to merge with this one.
*
* @return self
* @since 5.0.4
*/
public function merge(Registryinterface $source): self;
/**
* Clears all data from the registry.
*
* @return self
* @since 5.0.4
*/
public function clear(): self;
/**
* Extracts a subset of the registry data based on a given path.
*
* @param string $path The registry path to extract.
* @param mixed $default Optional default value, returned if the path does not exist.
* @param string|null $separator The path separator.
*
* @return self A new Registry instance with the extracted data.
* @since 5.0.4
*/
public function extract(string $path, $default = null, ?string $separator = null): self;
/**
* Appends content into the registry.
*
* If a key exists, the value will be appended to the existing value.
*
* @param string $path The registry path (e.g., 'vdm.content.builder').
* @param mixed $value The value to append.
*
* @return self
* @since 5.0.4
*/
public function append(string $path, $value): self;
/**
* Gets the name of the registry.
*
* @return string|null The name of the registry.
* @since 5.0.4
*/
public function getName(): ?string;
/**
* Sets the name of the registry.
*
* @param string|null $name The name to set.
*
* @return self
* @since 5.0.4
*/
public function setName(?string $name): self;
/**
* Sets a separator value
*
* @param string|null $value The value to set.
*
* @return self
* @since 3.2.0
*/
public function setSeparator(?string $value): self;
/**
* Gets the current path separator used in registry paths.
*
* @return string|null The path separator.
* @since 5.0.4
*/
public function getSeparator(): ?string;