Skip to content

Commit

Permalink
Throw proper error when trying to access methods that are not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pol Dellaiera authored and Pol Dellaiera committed Jun 3, 2015
1 parent e21233c commit 47c126a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Messenger/LegacyMessenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Drupal\Core\Messenger\MessengerInterface;

/**
* TODO
* Class that manage the messages in Drupal.
*
* @codeCoverageIgnore
*/
Expand All @@ -23,15 +23,15 @@ public function getMessages() {
}

public function getMessagesByType($type) {
$messages = drupal_get_messages();
$messages = $this->getMessages();
return isset($messages[$type]) ? $messages[$type] : $messages;
}

public function deleteMessages() {
// TODO
throw new \BadMethodCallException('LegacyMessenger::deleteMessages is not implemented.');
}

public function deleteMessagesByType($type) {
// TODO
throw new \BadMethodCallException('LegacyMessenger::deleteMessagesByType is not implemented.');
}
}

0 comments on commit 47c126a

Please sign in to comment.