Skip to content

Commit

Permalink
Merge pull request #427 from hugopeek/master
Browse files Browse the repository at this point in the history
Fix undefined array key "service" warnings
  • Loading branch information
muzzwood authored Mar 16, 2023
2 parents 0725764 + 3803232 commit 1653c33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Command/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ public function getPackage($package, array $options = array())
$path .= 'model/';
}

if ($options['service']) {
if (isset($options['service'])) {
$path .= $package . '/';
$this->modx->getService($package, $options['service'], $path);
} else {
$this->modx->addPackage($package, $path);
}
} else {
$this->modx->addPackage($package, $path);
}
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/Command/ExtractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ public function getPackage($package, array $options = array())
$path .= 'model/';
}

if ($options['service']) {
$path .= $package . '/';
$this->modx->getService($package, $options['service'], $path);
} else {
$this->modx->addPackage($package, $path);
}
if (isset($options['service'])) {
$path .= $package . '/';
$this->modx->getService($package, $options['service'], $path);
} else {
$this->modx->addPackage($package, $path);
}
}

/**
Expand Down

0 comments on commit 1653c33

Please sign in to comment.