Browse Source

fix phpdoc controller for empty interfaces

tags/2.0.8
Carsten Brandt 9 years ago
parent
commit
101ec4fb59
  1. 4
      build/controllers/PhpDocController.php

4
build/controllers/PhpDocController.php

@ -589,13 +589,13 @@ class PhpDocController extends Controller
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) {

Loading…
Cancel
Save