Skip to content

Commit ef8c1e1

Browse files
authored
Composer: Allow lowest php version: 5.3 (#65)
1 parent 6fcf345 commit ef8c1e1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "staabm/annotate-pull-request-from-checkstyle",
33
"license" : "MIT",
44
"require" : {
5-
"php" : "^7.0 || ^8.0",
5+
"php" : "^5.3 || ^7.0 || ^8.0",
6+
"ext-libxml" : "*",
67
"ext-simplexml" : "*"
78
},
89
"require-dev" : {

cs2pr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $colorize = false;
2323
$gracefulWarnings = false;
2424

2525
// parameters
26-
$params = [];
26+
$params = array();
2727
foreach ($argv as $arg) {
2828
if (substr($arg, 0, 2) === '--') {
2929
$option = substr($arg, 2);
@@ -73,7 +73,7 @@ if ($root === false) {
7373
fwrite(STDERR, 'Error: Unknown error. Expecting checkstyle formatted xml input.' ."\n\n");
7474
}
7575
fwrite(STDERR, $xml);
76-
76+
7777
exit(2);
7878
}
7979

@@ -110,7 +110,7 @@ function annotateCheck($type, $filename, $line, $message, $colorize)
110110
// newlines need to be encoded
111111
// see https://github.com/actions/starter-workflows/issues/68#issuecomment-581479448
112112
$message = str_replace("\n", '%0A', $message);
113-
113+
114114
if ($colorize) {
115115
echo "\033[".($type==='error' ? '91' : '93')."m\n";
116116
}
@@ -127,10 +127,10 @@ function relativePath($path)
127127

128128
function annotateType($type)
129129
{
130-
if (in_array($type, ['error', 'failure'])) {
130+
if (in_array($type, array('error', 'failure'))) {
131131
return 'error';
132132
}
133-
if (in_array($type, ['info', 'notice'])) {
133+
if (in_array($type, array('info', 'notice'))) {
134134
return 'notice';
135135
}
136136
return 'warning';

0 commit comments

Comments
 (0)