File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,16 @@ $modified = [];
30
30
$ file = __DIR__ . DIRECTORY_SEPARATOR . 'composer.json ' ;
31
31
32
32
if (is_file ($ file )) {
33
- if ($ contents = file_get_contents ($ file )) {
34
- if ($ array = json_decode ($ contents , true )) {
33
+ $ contents = file_get_contents ($ file );
34
+
35
+ if ((string ) $ contents !== '' ) {
36
+ $ array = json_decode ($ contents , true );
37
+
38
+ if (is_array ($ array )) {
35
39
if ($ dev ) {
36
40
$ array ['minimum-stability ' ] = 'dev ' ;
37
41
$ array ['prefer-stable ' ] = true ;
38
-
39
- if (! isset ($ array ['repositories ' ])) {
40
- $ array ['repositories ' ] = [];
41
- }
42
+ $ array ['repositories ' ] = $ array ['repositories ' ] ?? [];
42
43
43
44
$ found = false ;
44
45
@@ -111,8 +112,8 @@ foreach ($files as $file) {
111
112
}
112
113
}
113
114
114
- if (empty ( $ modified) ) {
115
- echo 'No files modified ' . PHP_EOL ;
115
+ if ($ modified !== [] ) {
116
+ echo 'No files modified. ' . PHP_EOL ;
116
117
} else {
117
118
echo 'The following files were modified: ' . PHP_EOL ;
118
119
You can’t perform that action at this time.
0 commit comments