diff --git a/readme.md b/readme.md index 73cfae7db7..18715a51ce 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,8 @@ An international PHP extension for DateTime. [http://carbon.nesbot.com](http://carbon.nesbot.com) ```php +toDateTimeString()); diff --git a/src/Carbon/Traits/Localization.php b/src/Carbon/Traits/Localization.php index 57c3086c01..bcfd4b4070 100644 --- a/src/Carbon/Traits/Localization.php +++ b/src/Carbon/Traits/Localization.php @@ -178,7 +178,8 @@ public static function getTranslationMessageWith($translator, string $key, strin { if (!($translator instanceof TranslatorBagInterface && $translator instanceof TranslatorInterface)) { throw new InvalidTypeException( - 'Translator does not implement '.TranslatorInterface::class.' and '.TranslatorBagInterface::class.'.' + 'Translator does not implement '.TranslatorInterface::class.' and '.TranslatorBagInterface::class.'. '. + (is_object($translator) ? get_class($translator) : gettype($translator)).' has been given.' ); } diff --git a/tests/Carbon/LocalizationTest.php b/tests/Carbon/LocalizationTest.php index a25c3a7334..a588d37628 100644 --- a/tests/Carbon/LocalizationTest.php +++ b/tests/Carbon/LocalizationTest.php @@ -734,7 +734,8 @@ public function testTranslationCustomWithCustomTranslator() $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage( 'Translator does not implement Symfony\Contracts\Translation\TranslatorInterface '. - 'and Symfony\Component\Translation\TranslatorBagInterface.' + 'and Symfony\Component\Translation\TranslatorBagInterface. '. + 'Symfony\Component\Translation\IdentityTranslator has been given.' ); $date = Carbon::create(2018, 1, 1, 0, 0, 0); diff --git a/tests/CarbonImmutable/LocalizationTest.php b/tests/CarbonImmutable/LocalizationTest.php index 675b15529f..6f578dced1 100644 --- a/tests/CarbonImmutable/LocalizationTest.php +++ b/tests/CarbonImmutable/LocalizationTest.php @@ -695,7 +695,8 @@ public function testTranslationCustomWithCustomTranslator() $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage( 'Translator does not implement Symfony\Contracts\Translation\TranslatorInterface '. - 'and Symfony\Component\Translation\TranslatorBagInterface.' + 'and Symfony\Component\Translation\TranslatorBagInterface. '. + 'Symfony\Component\Translation\IdentityTranslator has been given.' ); $date = Carbon::create(2018, 1, 1, 0, 0, 0);