Вход Регистрация
Файл: concrete5.7.5.6/concrete/vendor/punic/punic/code/Exception/InvalidLocale.php
Строк: 39
<?php

namespace PunicException;

/**
 * An exception raised when an invalid locale specification has been hit.
 */
class InvalidLocale extends PunicException
{
    protected 
$locale;

    
/**
     * Initializes the instance.
     *
     * @param mixed $locale The bad locale
     * @param Exception $previous The previous exception used for the exception chaining
     */
    
public function __construct($locale$previous null)
    {
        
$this->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($messagePunicException::INVALID_LOCALE$previous);
    }

    
/**
     * Retrieves the bad locale.
     *
     * @return mixed
     */
    
public function getLocale()
    {
        return 
$this->locale;
    }
}
Онлайн: 2
Реклама