From 0b1d2b3f78c06160e1061bf4d29898efa26dac2d Mon Sep 17 00:00:00 2001 From: Olivier Laviale Date: Tue, 23 Aug 2016 22:40:32 +0200 Subject: [PATCH] Implemented #8 --- lib/DateTime/Shared.php | 4 ++-- tests/AbstractDateTimeTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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() {