diff --git a/lib/DateTime/Shared.php b/lib/DateTime/Shared.php index fae646c..02d4e3f 100644 --- a/lib/DateTime/Shared.php +++ b/lib/DateTime/Shared.php @@ -346,7 +346,7 @@ public function change(array $options, $cascade = false) * * @return mixed * - * @throws \RuntimeException if {@link $localizer} is not defined. + * @throws \LogicException if {@link $localizer} is not defined. */ public function localize($locale = 'en') { @@ -354,7 +354,7 @@ public function localize($locale = 'en') if (!$localizer) { - throw new \RuntimeException("Localizer is not defined yet."); + throw new \LogicException("Localizer is not defined yet."); } return $localizer($this, $locale); diff --git a/tests/AbstractDateTimeTest.php b/tests/AbstractDateTimeTest.php index b1762a6..43fe435 100644 --- a/tests/AbstractDateTimeTest.php +++ b/tests/AbstractDateTimeTest.php @@ -928,7 +928,7 @@ public function test_json_serialize() } /** - * @expectedException \RuntimeException + * @expectedException \LogicException */ public function test_localize_should_throw_an_exception_if_the_localizer_is_not_defined_yet() {