Skip to content

Commit

Permalink
Merge ffd43ba into bfc666f
Browse files Browse the repository at this point in the history
  • Loading branch information
lulco committed Aug 10, 2018
2 parents bfc666f + ffd43ba commit 952eb65
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Translator.php
Expand Up @@ -148,8 +148,8 @@ public function translate($message, $count = NULL, $parameters = [], $domain = N
return $message; // what now?
}

if (!is_string($message)) {
throw new \Kdyby\Translation\InvalidArgumentException(sprintf('Message id must be a string, %s was given', gettype($message)));
if (!is_string($message) && !is_int($message)) {
throw new \Kdyby\Translation\InvalidArgumentException(sprintf('Message id must be a string or integer, %s was given', gettype($message)));
}

if (Strings::startsWith($message, '//')) {
Expand Down Expand Up @@ -182,8 +182,8 @@ public function translate($message, $count = NULL, $parameters = [], $domain = N
*/
public function trans($message, array $parameters = [], $domain = NULL, $locale = NULL)
{
if (!is_string($message)) {
throw new \Kdyby\Translation\InvalidArgumentException(sprintf('Message id must be a string, %s was given', gettype($message)));
if (!is_string($message) && !is_int($message)) {
throw new \Kdyby\Translation\InvalidArgumentException(sprintf('Message id must be a string or integer, %s was given', gettype($message)));
}

if ($domain === NULL) {
Expand All @@ -207,8 +207,8 @@ public function trans($message, array $parameters = [], $domain = NULL, $locale
*/
public function transChoice($message, $number, array $parameters = [], $domain = NULL, $locale = NULL)
{
if (!is_string($message)) {
throw new \Kdyby\Translation\InvalidArgumentException(sprintf('Message id must be a string, %s was given', gettype($message)));
if (!is_string($message) && !is_int($message)) {
throw new \Kdyby\Translation\InvalidArgumentException(sprintf('Message id must be a string or integer, %s was given', gettype($message)));
}

if ($domain === NULL) {
Expand Down

0 comments on commit 952eb65

Please sign in to comment.