Browse Source

fixed postioning of property tags in php-doc command

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
df21e10c5d
  1. 14
      build/controllers/PhpDocController.php

14
build/controllers/PhpDocController.php

@ -105,16 +105,18 @@ class PhpDocController extends Controller
if ($oldDoc != $newDoc) {
$fileContent = file($file);
$start = $ref->getStartLine();
$docStart = $start - count(explode("\n", $oldDoc));
$fileContent = explode("\n", file_get_contents($file));
$start = $ref->getStartLine() - 2;
$docStart = $start - count(explode("\n", $oldDoc)) + 1;
$newFileContent = array();
foreach($fileContent as $i => $line) {
$n = count($fileContent);
for($i = 0; $i < $n; $i++) {
if ($i > $start || $i < $docStart) {
$newFileContent[] = $line;
$newFileContent[] = $fileContent[$i];
} else {
$newFileContent[] = trim($newDoc);
$i = $start;
}
}
@ -163,7 +165,7 @@ class PhpDocController extends Controller
$propertyPart = false;
}
if (substr(trim($line), 0, 10) == '* @author ' && $propertyPosition === false) {
$propertyPosition = $i;
$propertyPosition = $i - 1;
$propertyPart = false;
}
if ($propertyPart) {

Loading…
Cancel
Save