Skip to content

Commit

Permalink
Enhance random functions
Browse files Browse the repository at this point in the history
  • Loading branch information
iranianpep committed Jul 18, 2017
1 parent 2c66d11 commit 5c3a063
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 1 addition & 5 deletions src/Botonomous/AbstractCommandContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,14 @@ public function getAll()
public function getAllAsObject($key = null)
{
$commands = $this->getAll();

if (!empty($commands)) {
foreach ($commands as $commandKey => $commandDetails) {
if (!empty($key) && $commandKey !== $key) {
continue;
}

$commandDetails['key'] = $commandKey;

$mappedObject = $this->mapToCommandObject($commandDetails);

$commands[$commandKey] = $mappedObject;
$commands[$commandKey] = $this->mapToCommandObject($commandDetails);
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/Botonomous/listener/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,11 @@ public function setEvent(Event $event)
private function loadEvent()
{
$request = $this->getRequest();

if (!isset($request['event'])) {
return;
}

$request = $request['event'];

if (!isset($request['type'])) {
throw new \Exception('Event type must be specified');
}
Expand Down

0 comments on commit 5c3a063

Please sign in to comment.