コード例 #1
0
 /**
  * Retourne le traducteur.
  * 
  * @return Aouka\Text\Interpretor\InterfaceInterpretor
  * @throws \Exception
  */
 protected function _getInterpretor()
 {
     if (!isset(self::$_aInterpretors[$this->_sManipulatorId])) {
         throw ExceptionType::badMethodCall("Aucun traducteur n'a été défini via la méthode Aouka\\Text\\Manipulator::setInterpretor().", Exception::FROM_SUB_HANDLER);
     }
     return self::$_aInterpretors[$this->_sManipulatorId];
 }
コード例 #2
0
ファイル: Regex.php プロジェクト: subtonix/aouka_lunch
 public static function __callStatic($sName, $aArguments)
 {
     // On passe en snake_case et en majsucule le nom de la fonction appelée
     $sConstName = strtoupper(preg_replace('([A-Z])', '_\\0', $sName));
     if (defined("self::{$sConstName}") && in_array(constant("self::{$sConstName}"), self::_getConstantsArray())) {
         array_unshift($aArguments, constant("self::{$sConstName}"));
         return call_user_func_array(array('self', 'create'), $aArguments);
     } else {
         throw ExceptionType::badMethodCall("La méthode statique " . __CLASS__ . "::{$sName}() n'existe pas.", Exception::FROM_REGEX);
     }
 }