Exception gives more flexible error handling.

Marcos Neves


On Mon, Aug 19, 2013 at 12:01 PM, Vance Lucas <notifications@github.com>wrote:

> In src/Valitron/Validator.php:
>
> > @@ -44,8 +44,8 @@ public function __construct($data, $fields = array(), $lang = null, $langDir = n
> >          // set langDir in the follow order: constructor param, static::$_langDir, default to package lang dir
> >          $langDir = $langDir ?: static::langDir();
> >
> > -        static::langDir($langDir);
> > -        static::lang($lang);
> > +        // Load language file in directory
> > +        static::$_ruleMessages = include rtrim($langDir, '/') . '/' . $lang . '.php';
>
> I'd be okay with the E_FATAL in this case, but if you want to code/test
> the Exception scenario, then I would be fine with it and merge it in too.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/vlucas/valitron/pull/24/files#r5844354>
> .
>