Skip to content

Commit

Permalink
Use array_key_exists instead of in_array + array_keys (#1991)
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and rhukster committed Apr 28, 2018
1 parent 40ba5e9 commit 4ab0a60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/src/Grav/Console/Gpm/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected function serve()
//We're done installing dependencies. Install the actual packages
foreach ($this->data as $data) {
foreach ($data as $package_name => $package) {
if (in_array($package_name, array_keys($dependencies))) {
if (array_key_exists($package_name, $dependencies)) {
$this->output->writeln("<green>Package " . $package_name . " already installed as dependency</green>");
} else {
$is_valid_destination = Installer::isValidDestination($this->destination . DS . $package->install_path);
Expand Down

0 comments on commit 4ab0a60

Please sign in to comment.