public function setLanguage($lang = 'en', $langDir = __DIR__ . '/lang/')
    {
        $this->lang    = $lang;
        $this->langDir = $langDir;

        $langFile = realpath($langDir . $lang . '.php');
        if (!file_exists($langFile)) {
            throw new \InvalidArgumentException('No such file: ' . $langDir . $lang . '.php');
        }

        $callable = require $langFile;
        $callable($this);

        return $this;
    }
public function setLanguage($lang = 'en', $langDir = __DIR__ . '/lang/')
    {
        $this->lang    = $lang;
        $this->langDir = $langDir;

        $langFile = realpath($langDir . $lang . '.php');
        if (!file_exists($langFile)) {
            throw new \InvalidArgumentException('No such file: ' . $langDir . $lang . '.php');
        }

        $callable = require $langFile;
        $callable($this);

        return $this;
    }
public function setLanguage ( $ lang = 'en' , $ langDir = __DIR__ . '/lang/' ) { $ this -> lang = $ lang ; $ this -> langDir = $ langDir ; $ langFile = realpath ( $ langDir . $ lang . '.php' ) ; if ( ! file_exists ( $ langFile ) ) { throw new \ InvalidArgumentException ( 'No such file: ' . $ langDir . $ lang . '.php' ) ; } $ callable = require $ langFile ; $ callable ( $ this ) ; return $ this ; }
Set the rules of this Validator.

@param string $lang
@param string $langDir
@return Validator
Set the rules of this Validator .