/** * Get text command from the message, if any. * * A blank message is treated as a subscribe command. * * @since 1.0.0 * @return string Text command if found, otherwise empty. */ protected function get_text_command() { $stripped_text = $this->get_message_text(); if (preg_match('/^\\s*$/', $stripped_text, $matches)) { return self::$subscribe_method; } $subscribe_matcher = new Prompt_Subscribe_Matcher($stripped_text); if ($subscribe_matcher->matches()) { return self::$subscribe_method; } $unsubscribe_matcher = new Prompt_Unsubscribe_Matcher($stripped_text); if ($unsubscribe_matcher->matches()) { return self::$unsubscribe_method; } return ''; }