PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.6.0
Defender Security – Malware Scanner, Login Security & Firewall v5.6.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / yaml.php

yaml.php in Defender Security – Malware Scanner, Login Security & Firewall 5.6.0, at vendor/thecodingmachine/safe/generated/yaml.php

98 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\YamlException;
6
7 /**
8 * Convert all or part of a YAML document stream read from a file to a PHP variable.
9 *
10 * @param string $filename Path to the file.
11 * @param int $pos Document to extract from stream (-1 for all
12 * documents, 0 for first document, ...).
13 * @param int|null $ndocs If ndocs is provided, then it is filled with the
14 * number of documents found in stream.
15 * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML
16 * tag =&gt; callable mappings. See
17 * parse callbacks for more
18 * details.
19 * @return mixed Returns the value encoded in input in appropriate
20 * PHP type. If pos is -1 an
21 * array will be returned with one entry for each document found
22 * in the stream.
23 * @throws YamlException
24 *
25 */
26 function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
27 {
28 error_clear_last();
29 $result = \yaml_parse_file($filename, $pos, $ndocs, $callbacks);
30 if ($result === false) {
31 throw YamlException::createFromPhpError();
32 }
33 return $result;
34 }
35
36
37 /**
38 * Convert all or part of a YAML document stream read from a URL to a PHP variable.
39 *
40 * @param string $url url should be of the form "scheme://...". PHP
41 * will search for a protocol handler (also known as a wrapper) for that
42 * scheme. If no wrappers for that protocol are registered, PHP will emit
43 * a notice to help you track potential problems in your script and then
44 * continue as though filename specifies a regular file.
45 * @param int $pos Document to extract from stream (-1 for all
46 * documents, 0 for first document, ...).
47 * @param int|null $ndocs If ndocs is provided, then it is filled with the
48 * number of documents found in stream.
49 * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML
50 * tag =&gt; callable mappings. See
51 * parse callbacks for more
52 * @return mixed Returns the value encoded in input in appropriate
53 * PHP type. If pos is
54 * -1 an array will be returned with one entry
55 * for each document found in the stream.
56 * @throws YamlException
57 *
58 */
59 function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
60 {
61 error_clear_last();
62 $result = \yaml_parse_url($url, $pos, $ndocs, $callbacks);
63 if ($result === false) {
64 throw YamlException::createFromPhpError();
65 }
66 return $result;
67 }
68
69
70 /**
71 * Convert all or part of a YAML document stream to a PHP variable.
72 *
73 * @param string $input The string to parse as a YAML document stream.
74 * @param int $pos Document to extract from stream (-1 for all
75 * documents, 0 for first document, ...).
76 * @param int|null $ndocs If ndocs is provided, then it is filled with the
77 * number of documents found in stream.
78 * @param array $callbacks Content handlers for YAML nodes. Associative array of YAML
79 * tag =&gt; callable mappings. See
80 * parse callbacks for more
81 * details.
82 * @return mixed Returns the value encoded in input in appropriate
83 * PHP type. If pos is -1 an
84 * array will be returned with one entry for each document found
85 * in the stream.
86 * @throws YamlException
87 *
88 */
89 function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
90 {
91 error_clear_last();
92 $result = \yaml_parse($input, $pos, $ndocs, $callbacks);
93 if ($result === false) {
94 throw YamlException::createFromPhpError();
95 }
96 return $result;
97 }
98