Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions generator/src/DocPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ public function detectFalsyFunction(): bool
if (preg_match('/&false;\s+on\s+failure/m', $returnValuesSection)) {
return true;
}
if (preg_match('/&false;\s+otherwise/m', $returnValuesSection) && !preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection)) {

if (preg_match('/&false;\s+otherwise/m', $returnValuesSection) && (preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === 0 || preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === false)) {
return true;
}
if (preg_match('/may\s+return\s+&false;/m', $returnValuesSection) && !preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection)) {

if (preg_match('/may\s+return\s+&false;/m', $returnValuesSection) && (preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === 0 || preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === false)) {
return true;
}
if (preg_match('/&false;\s+if\s+an\s+error\s+occurred/m', $returnValuesSection)) {
Expand Down Expand Up @@ -211,7 +213,7 @@ public function getMethodSynopsis(): array
// handlers, callbacks, and other callable-type arguments, not the function itself.
$fileDescriptionSection = $this->extractSection('description', $file);

if (!preg_match_all('/<\/?methodsynopsis[\s\S]*?>[\s\S]*?<\/methodsynopsis>/m', $fileDescriptionSection, $functions, PREG_SET_ORDER, 0)) {
if (preg_match_all('/<\/?methodsynopsis[\s\S]*?>[\s\S]*?<\/methodsynopsis>/m', $fileDescriptionSection, $functions, PREG_SET_ORDER, 0) === 0 || preg_match_all('/<\/?methodsynopsis[\s\S]*?>[\s\S]*?<\/methodsynopsis>/m', $fileDescriptionSection, $functions, PREG_SET_ORDER, 0) === false) {
return [];
}

Expand Down
Loading