* @throws LanguagePathReadProtectedException If $languageBasePath is
* read-protected
*/
- public static final function createLanguageSystem ($languageBasePath = '') {
+ public static final function createLanguageSystem (string $languageBasePath = '') {
// Get a new instance
$langInstance = new LanguageSystem();
* @param $languageBasePath The relative base path for all language files
* @return void
*/
- protected final function setLanguageBasePath ($languageBasePath) {
+ protected final function setLanguageBasePath (string $languageBasePath) {
// And set it
$this->languageBasePath = (string) $languageBasePath;
}
* @param $langCode The language code for the current application
* @return void
*/
- protected final function setLanguageCode ($langCode) {
- // Cast it
- $langCode = (string) $langCode;
-
+ protected final function setLanguageCode (string $langCode) {
// And set it (only 2 chars)
$this->langCode = substr($langCode, 0, 2);
}
* @param $messageId The message id we shall find in the cache variable
* @return $messageText The plain message text
*/
- public function getMessage ($messageId) {
+ public function getMessage (string $messageId) {
// Default is missing message text
$messageText = sprintf('!%s!',
$messageId