Unverified Commit 82446c42 authored by imanghafoori's avatar imanghafoori Committed by Armando Lüscher

flatten the code

parent baa58d78
......@@ -159,15 +159,14 @@ class Message extends Entity
public function getFullCommand()
{
$text = $this->getProperty('text');
if (strpos($text, '/') === 0) {
$no_EOL = strtok($text, PHP_EOL);
$no_space = strtok($text, ' ');
//try to understand which separator \n or space divide /command from text
return strlen($no_space) < strlen($no_EOL) ? $no_space : $no_EOL;
if (strpos($text, '/') !== 0) {
return null;
}
$no_EOL = strtok($text, PHP_EOL);
$no_space = strtok($text, ' ');
return null;
//try to understand which separator \n or space divide /command from text
return strlen($no_space) < strlen($no_EOL) ? $no_space : $no_EOL;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment