File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -181,11 +181,15 @@ public function patchBeforeBuildconfForWindows(TargetPackage $package): void
181181 // Fix PHP VS version
182182 // get vs version
183183 $ vc = WindowsUtil::findVisualStudio ();
184- $ vc_matches = match ($ vc ['major_version ' ]) {
185- '17 ' => ['VS17 ' , 'Visual C++ 2022 ' ],
186- '16 ' => ['VS16 ' , 'Visual C++ 2019 ' ],
187- default => ['unknown ' , 'unknown ' ],
188- };
184+ if ($ vc === false ) {
185+ $ vc_matches = ['unknown ' , 'unknown ' ];
186+ } else {
187+ $ vc_matches = match ($ vc ['major_version ' ]) {
188+ '17 ' => ['VS17 ' , 'Visual C++ 2022 ' ],
189+ '16 ' => ['VS16 ' , 'Visual C++ 2019 ' ],
190+ default => ['unknown ' , 'unknown ' ],
191+ };
192+ }
189193 // patch php-src/win32/build/confutils.js
190194 FileSystem::replaceFileStr (
191195 "{$ package ->getSourceDir ()}\\win32 \\build \\confutils.js " ,
You can’t perform that action at this time.
0 commit comments