-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathprocessors.php
More file actions
46 lines (40 loc) · 1.46 KB
/
processors.php
File metadata and controls
46 lines (40 loc) · 1.46 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
<?php
function error_section_value_error_between(
DOMDocument $dom,
string $parameter,
string $min,
string $max
): DOMElement {
$min_tag_name = is_numeric($min) ? 'literal' : 'constant';
$max_tag_name = is_numeric($max) ? 'literal' : 'constant';
$min_tag = '<' . $min_tag_name . '>' . $min . '</' . $min_tag_name . '>';
$max_tag = '<' . $max_tag_name . '>' . $max . '</' . $max_tag_name . '>';
$xml = str_replace(
['PARAMETER_NAME', 'MIN_TAG', 'MAX_TAG'],
[$parameter, $min_tag, $max_tag],
VALUE_ERROR_BETWEEN_ERROR_SECTION,
);
$localDom = new DOMDocument();
$localDom->loadXML($xml);
return $dom->importNode($localDom->documentElement, true);
}
function error_section_value_error_between_changelog(
DOMDocument $dom,
string $version,
string $parameter,
string $min,
string $max
): DOMElement {
$min_tag_name = is_numeric($min) ? 'literal' : 'constant';
$max_tag_name = is_numeric($max) ? 'literal' : 'constant';
$min_tag = '<' . $min_tag_name . '>' . $min . '</' . $min_tag_name . '>';
$max_tag = '<' . $max_tag_name . '>' . $max . '</' . $max_tag_name . '>';
$xml = str_replace(
['VERSION', 'PARAMETER_NAME', 'MIN_TAG', 'MAX_TAG'],
[$version, $parameter, $min_tag, $max_tag],
VALUE_ERROR_BETWEEN_CHANGELOG,
);
$localDom = new DOMDocument();
$localDom->loadXML($xml);
return $dom->importNode($localDom->documentElement, true);
}