Exemple #1
0
 /**
  * Is given string irregular noun?
  *
  * @param string $word
  * @return bool
  */
 public static function isIrregular($word)
 {
     $lower = String::lower($word);
     return (bool) in_array($lower, self::$irregular) || array_key_exists($lower, self::$irregular);
 }
Exemple #2
0
 public function getLowercased($storage, $name)
 {
     $rawData = $storage->getStorage();
     return String::lower($rawData[$name]);
 }
Exemple #3
0
	private function parseTypeHints() {
		$line = $this->currentToken[2];
		 // remove function name and reference, we don't need it
		$token = $this->getNextToken();
		while($this->isAllowed($token, array("&", T_STRING, T_WHITESPACE))) {
			$token = $this->getNextToken();
		}
		while (!$this->isAllowed($token, ")")) {
			$name = String::lower($this->parseName());
			if(strlen($name) && !String::startsWith($name, '$') && FALSE === array_search($name, $this->reserved)) {
				$this->fileInfo[$this->currentFile][$this->namespace][self::NS_USED_CLASS][$name] = $line;
			}
			while(!$this->isAllowed($token, array(",",")"))) {
				$token = $this->getNextToken();
			}
			if(!$this->isAllowed($token, ")")) {
				$token = $this->getNextToken();
				if($this->isAllowed($token, array(T_NS_SEPARATOR, T_STRING))) {
					$this->returnToken($token);
				}
			}
		}
	}
Exemple #4
0
 public static function getImageTag($mail, $size = 32)
 {
     $hash = md5(\Nette\String::lower($mail));
     $src = "http://www.gravatar.com/avatar/{$hash}?d=mm&s={$size}";
     return Html::el('img')->src($src)->alt('')->width($size)->height($size);
 }