locale = $locale; $type = gettype($locale); if ($type === 'string') { $message = "'{$locale}' is not a valid locale identifier"; } else { $message = "A valid locale should be a string, {$type} received"; } parent::__construct($message, \Punic\Exception::INVALID_LOCALE, $previous); } /** * Retrieves the bad locale. */ public function getLocale() { return $this->locale; } }