Skip to content

Commit

Permalink
fix phpdoc controller for empty interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Apr 28, 2016
1 parent f87acfa commit 101ec4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/controllers/PhpDocController.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,13 @@ protected function generateClassPropertyDocs($fileName)
return false;
}
if (count($classes) < 1) {
$interfaces = $this->match('#\ninterface (?<name>\w+)( extends .+)?\n\{(?<content>.+)\n\}(\n|$)#', $file);
$interfaces = $this->match('#\ninterface (?<name>\w+)( extends .+)?\n\{(?<content>.*)\n\}(\n|$)#', $file);
if (count($interfaces) == 1) {
return false;
} elseif (count($interfaces) > 1) {
$this->stderr("[ERR] There should be only one interface in a file: $fileName\n", Console::FG_RED);
} else {
$traits = $this->match('#\ntrait (?<name>\w+)\n\{(?<content>.+)\n\}(\n|$)#', $file);
$traits = $this->match('#\ntrait (?<name>\w+)\n\{(?<content>.*)\n\}(\n|$)#', $file);
if (count($traits) == 1) {
return false;
} elseif (count($traits) > 1) {
Expand Down

0 comments on commit 101ec4f

Please sign in to comment.