src/Translation/Language/Definition.php
/**
	 * Checks whether the definition's original text matches the specified text.
	 *
	 * @param string $text
	 * @return bool
	 */
Checks whether the definition's original text matches the specified text.
@param string $text
@return bool
Checks whether the definition ' s original text matches the specified text . @param string $text @return bool
public function is($text) {
		$original = (!is_null($this->formattedText)) ? $this->formattedText : $this->getOriginal();
		if ($text == $original) {
			return true;
		}
		$isCaseInsensitive = $this->hasFlag('i');
		$isIgnoringWhitespace = $this->hasFlag('x');
		if ($isCaseInsensitive) {
			$original = strtolower($original);
			$text = strtolower($text);
			if ($original == $text) {
				return true;
			}
		}
		if ($isIgnoringWhitespace) {
			$text = preg_replace('/\s+/', ' ', trim($text));
			$original = preg_replace('/\s+/', ' ', trim($original));
			if ($original == $text) {
				return true;
			}
		}
		return false;
	}
public function is ( $ text ) { $ original = ( ! is_null ( $ this -> formattedText ) ) ? $ this -> formattedText : $ this -> getOriginal ( ) ; if ( $ text == $ original ) { return true ; } $ isCaseInsensitive = $ this -> hasFlag ( 'i' ) ; $ isIgnoringWhitespace = $ this -> hasFlag ( 'x' ) ; if ( $ isCaseInsensitive ) { $ original = strtolower ( $ original ) ; $ text = strtolower ( $ text ) ; if ( $ original == $ text ) { return true ; } } if ( $ isIgnoringWhitespace ) { $ text = preg_replace ( '/\s+/' , ' ' , trim ( $ text ) ) ; $ original = preg_replace ( '/\s+/' , ' ' , trim ( $ original ) ) ; if ( $ original == $ text ) { return true ; } } return false ; }
Checks whether the definition's original text matches the specified text.
Checks whether the definition ' s original text matches the specified text .