Split multiline documentation by different lines.
This commit is contained in:
parent
b2c838f7bb
commit
1edde0e808
|
@ -101,6 +101,7 @@ abstract class TlDocumentationGenerator
|
||||||
{
|
{
|
||||||
$lines = array_filter(array_map('trim', file($tl_scheme_file)));
|
$lines = array_filter(array_map('trim', file($tl_scheme_file)));
|
||||||
$description = '';
|
$description = '';
|
||||||
|
$description_line_count = 0;
|
||||||
$current_class = '';
|
$current_class = '';
|
||||||
$is_function = false;
|
$is_function = false;
|
||||||
$need_class_description = false;
|
$need_class_description = false;
|
||||||
|
@ -120,8 +121,13 @@ abstract class TlDocumentationGenerator
|
||||||
$this->printError('Wrong comment');
|
$this->printError('Wrong comment');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($line[2] === '@' || $line[2] === '-') {
|
if ($line[2] === '@') {
|
||||||
$description .= trim(substr($line, 2 + intval($line[2] === '-'))).' ';
|
if (substr($line, 2, 7) !== '@class ') {
|
||||||
|
$description_line_count++;
|
||||||
|
}
|
||||||
|
$description .= trim(substr($line, 2)).' ';
|
||||||
|
} elseif ($line[2] === '-') {
|
||||||
|
$description .= trim(substr($line, 3)).' ';
|
||||||
} else {
|
} else {
|
||||||
$this->printError('Unexpected comment');
|
$this->printError('Unexpected comment');
|
||||||
}
|
}
|
||||||
|
@ -240,6 +246,8 @@ abstract class TlDocumentationGenerator
|
||||||
|
|
||||||
if (array_keys($info) !== array_keys($known_fields)) {
|
if (array_keys($info) !== array_keys($known_fields)) {
|
||||||
$this->printError("Have wrong documentation for class `$class_name`");
|
$this->printError("Have wrong documentation for class `$class_name`");
|
||||||
|
} else if ($description_line_count !== 1 && $description_line_count !== count($known_fields) + 1) {
|
||||||
|
$this->printError("Documentation for fields of class `$class_name` must be split to different lines");
|
||||||
}
|
}
|
||||||
|
|
||||||
$base_class_name = $current_class ?: $this->getBaseClassName($is_function);
|
$base_class_name = $current_class ?: $this->getBaseClassName($is_function);
|
||||||
|
@ -274,6 +282,7 @@ abstract class TlDocumentationGenerator
|
||||||
}
|
}
|
||||||
|
|
||||||
$description = '';
|
$description = '';
|
||||||
|
$description_line_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user