Skip to content
Permalink
Browse files

[core:getData] Add misc and application to excludeNamespace (#343)

  • Loading branch information...
harold20 authored and jmolivas committed Apr 26, 2018
1 parent e03c899 commit c897e0493de2a731743d87aab1d728aa0d5bb3f2
Showing with 28 additions and 21 deletions.
  1. +28 −21 src/Application.php
@@ -692,8 +692,11 @@ public function getData($filterNamespaces = null, $excludeNamespaces = [], $excl
->get('application.languages');
$data = [];
foreach ($singleCommands as $singleCommand) {
$data['commands']['misc'][] = $this->commandData($singleCommand);
// Exclude misc if it is inside the $excludeNamespaces array.
if (!in_array('misc', $excludeNamespaces)) {
foreach ($singleCommands as $singleCommand) {
$data['commands']['misc'][] = $this->commandData($singleCommand);
}
}
$namespaces = array_filter(
@@ -760,25 +763,29 @@ public function getData($filterNamespaces = null, $excludeNamespaces = [], $excl
];
}
$data['application'] = [
'namespaces' => $namespaces,
'options' => $options,
'arguments' => $arguments,
'languages' => $languages,
'messages' => [
'title' => $this->trans('application.gitbook.messages.title'),
'note' => $this->trans('application.gitbook.messages.note'),
'note_description' => $this->trans('application.gitbook.messages.note-description'),
'command' => $this->trans('application.gitbook.messages.command'),
'options' => $this->trans('application.gitbook.messages.options'),
'option' => $this->trans('application.gitbook.messages.option'),
'details' => $this->trans('application.gitbook.messages.details'),
'arguments' => $this->trans('application.gitbook.messages.arguments'),
'argument' => $this->trans('application.gitbook.messages.argument'),
'examples' => $this->trans('application.gitbook.messages.examples')
],
'examples' => []
];
// Exclude application if it is inside the $excludeNamespaces array.
if (!in_array('application', $excludeNamespaces)) {
$data['application'] = [
'namespaces' => $namespaces,
'options' => $options,
'arguments' => $arguments,
'languages' => $languages,
'messages' => [
'title' => $this->trans('application.gitbook.messages.title'),
'note' => $this->trans('application.gitbook.messages.note'),
'note_description' => $this->trans('application.gitbook.messages.note-description'),
'command' => $this->trans('application.gitbook.messages.command'),
'options' => $this->trans('application.gitbook.messages.options'),
'option' => $this->trans('application.gitbook.messages.option'),
'details' => $this->trans('application.gitbook.messages.details'),
'arguments' => $this->trans('application.gitbook.messages.arguments'),
'argument' => $this->trans('application.gitbook.messages.argument'),
'examples' => $this->trans('application.gitbook.messages.examples')
],
'examples' => []
];
}
return $data;
}

0 comments on commit c897e04

Please sign in to comment.
You can’t perform that action at this time.