tests/ParserTests/Item.php
/**
	 * Return a friendly error message related to this item.
	 * @param string $desc The error description.
	 * @param ?string $text Optional additional context.
	 * @return string The error message string, including the line number and
	 *   filename of this item.
	 */
Return a friendly error message related to this item.
@param string $desc The error description.
@param ?string $text Optional additional context.
@return string The error message string, including the line number and
filename of this item.
Return a friendly error message related to this item . @param string $desc The error description . @param ?string $text Optional additional context . @return string The error message string including the line number and filename of this item .
public function errorMsg( string $desc, ?string $text = null ):string {
		$start = $this->lineNumStart;
		$end = $this->lineNumEnd;
		$lineDesc = $end > $start ? "lines $start-$end" : "line $start";
		$fileDesc = $this->filename;
		$extraText = $text ? ": $text" : "";
		return "$desc on $lineDesc of $fileDesc$extraText";
	}
public function errorMsg ( string $ desc , ? string $ text = null ) : string { $ start = $ this -> lineNumStart ; $ end = $ this -> lineNumEnd ; $ lineDesc = $ end > $ start ? " lines  $ start - $ end " : " line  $ start " ; $ fileDesc = $ this -> filename ; $ extraText = $ text ? " :  $ text " : " " ; return " $ desc  on  $ lineDesc  of  $ fileDesc $ extraText " ; }
Return a friendly error message related to this item.
Return a friendly error message related to this item .