for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MiniGameMessageApp\Message;
use MessageApp\Event\UnableToCreateUserEvent;
use MessageApp\Event\UserEvent;
use MessageApp\Parser\Exception\MessageParserException;
use MiniGame\GameResult;
class MessageTextExtractor
{
/**
* Extract the message from the game result.
*
* @param object $object
* @param string $languageIso
* @return string
*/
public function extractMessage($object, $languageIso)
$languageIso
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
// TODO retrieve and translate the message / remove getAsMessage
if ($object instanceof GameResult) {
return $object->getAsMessage();
}
if ($object instanceof UnableToCreateUserEvent) {
return $object->getReason();
if ($object instanceof UserEvent) {
if ($object instanceof MessageParserException) {
return $object->getMessage();
return null;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.