Skip to content

Commit 6d9a0f4

Browse files
committed
Update NewCommand.php
use the `extension_loaded` method to check if the 'zip' extension is loaded rather than checking for a class in the extension. while probably an edge case, a their could be a user defined `\ZipArchive` class that would cause this conditional to pass, even when the extension is not loaded.
1 parent 8a4a953 commit 6d9a0f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NewCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function configure()
4040
*/
4141
protected function execute(InputInterface $input, OutputInterface $output)
4242
{
43-
if (! class_exists('ZipArchive')) {
43+
if (! extension_loaded('zip')) {
4444
throw new RuntimeException('The Zip PHP extension is not installed. Please install it and try again.');
4545
}
4646

0 commit comments

Comments
 (0)