Skip to content

Commit

Permalink
Removed some warnings. (#317)
Browse files Browse the repository at this point in the history
* Removed some warnings in drupal launcher and in-project.

* Skip early instead.
  • Loading branch information
arturolinares authored and jmolivas committed Feb 17, 2018
1 parent f998ed7 commit f9dbf4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Utils/ChainDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ public function getChainCommands()
$chainMetadata = $this->getFileMetadata($file);

$chain = Yaml::parse($chainMetadata);
if (!array_key_exists('command', $chain)) {
if (!$chain || !array_key_exists('command', $chain)) {
continue;
}
if (!array_key_exists('name', $chain['command'])) {
if (!is_array($chain['command']) || !array_key_exists('name', $chain['command'])) {
continue;
}
$name = $chain['command']['name'];
$description = '';
if (array_key_exists('description', $chain['command'])) {
if (is_array($chain['command']) && array_key_exists('description', $chain['command'])) {
$description = $chain['command']['description'];
}
$chainCommands[$name] = [
Expand Down
3 changes: 3 additions & 0 deletions src/Utils/ConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ public function getSites()
];

foreach ($environments as $environment => $config) {
if (!array_key_exists('type', $config)) {
throw new \UnexpectedValueException("The 'type' parameter is required in sites configuration.");
}
if ($config['type'] !== 'local') {
if (array_key_exists('host', $config)) {
$targetInformation['remote'] = true;
Expand Down

0 comments on commit f9dbf4b

Please sign in to comment.