-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathprocessors.php
More file actions
38 lines (32 loc) · 1.16 KB
/
processors.php
File metadata and controls
38 lines (32 loc) · 1.16 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
<?php
function error_section_value_error_between(
string $parameter,
string $min,
string $max
): string {
$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 . '>';
return str_replace(
['PARAMETER_NAME', 'MIN_TAG', 'MAX_TAG'],
[$parameter, $min_tag, $max_tag],
VALUE_ERROR_BETWEEN_ERROR_SECTION,
);
}
function error_section_value_error_between_changelog(
string $version,
string $parameter,
string $min,
string $max
): string {
$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 . '>';
return str_replace(
['VERSION', 'PARAMETER_NAME', 'MIN_TAG', 'MAX_TAG'],
[$version, $parameter, $min_tag, $max_tag],
VALUE_ERROR_BETWEEN_CHANGELOG,
);
}