/** * Checks if the first line in the file has open tag and second line is not empty * * @param local_moodlecheck_file $file * @return array of found errors */ function local_moodlecheck_noemptysecondline(local_moodlecheck_file $file) { $tokens =& $file->get_tokens(); if ($tokens[0][0] == T_OPEN_TAG && !$file->is_whitespace_token(1) && $file->is_multiline_token(0) == 1) { return array(); } return array(array('line' => 2)); }