From e61fbb8a59f4b06059911c14aebe295e06e5ab23 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 2 Feb 2015 11:30:24 +0100 Subject: [PATCH] Apply reviews of @stephpy and @Savageman. --- Ruler.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Ruler.php b/Ruler.php index e331f5e..b02b1e5 100644 --- a/Ruler.php +++ b/Ruler.php @@ -103,9 +103,9 @@ public function assert ( $rule, Context $context = null ) { return $this->getAsserter($context)->visit($rule); } - + /** - * Alias for interprete. Because interpret is the correct English spelling + * Alias to the self::interprete method. * * @access public * @param string $rule Rule. @@ -114,22 +114,23 @@ public function assert ( $rule, Context $context = null ) { */ public static function interpret ( $rule ) { - return static::interprete($rule); + return static::getInterpreter()->visit( + static::getCompiler()->parse($rule) + ); } /** * Short interpreter. * - * @access public - * @param string $rule Rule. - * @return \Hoa\Ruler\Model - * @throw \Hoa\Ruler\Exception + * @access public + * @param string $rule Rule. + * @return \Hoa\Ruler\Model + * @throw \Hoa\Ruler\Exception + * @deprecated Will be removed in 2.x. */ public static function interprete ( $rule ) { - return static::getInterpreter()->visit( - static::getCompiler()->parse($rule) - ); + return static::interpret($rule); } /**