예제 #1
0
 /**
  * @param $expression
  * @return bool
  */
 public static function translate($expression)
 {
     if ((String::isValid($expression) || Number::isValid($expression)) && Collection::existsKey(self::$translationMapping, $expression)) {
         $expression = self::$translationMapping[$expression];
     }
     return $expression;
 }
예제 #2
0
 public function __construct($sFileRealPath)
 {
     if (Filesystem::isFile($sFileRealPath)) {
         $this->aDmDictionary = (require $sFileRealPath);
         foreach ($this->aDmDictionary as $sCategory => $aFeatureList) {
             foreach ($aFeatureList as $sDmFeature => $sDmFeatureTranslation) {
                 $this->aDmFeature[$sDmFeature] = $sCategory;
                 if (!Number::isValid($sDmFeature)) {
                     $this->aDmTranslation[$sDmFeature] = $sDmFeatureTranslation;
                 }
             }
         }
     }
 }
예제 #3
0
 function testNumberIsValid()
 {
     $this->assertTrue(Number::isValid(500));
 }