|
|
|
@ -170,7 +170,7 @@ class PhpDocController extends Controller
|
|
|
|
|
$namespaceLine = ''; |
|
|
|
|
$contentAfterNamespace = false; |
|
|
|
|
foreach($lines as $i => $line) { |
|
|
|
|
if (substr(trim($line), 0, 9) === 'namespace') { |
|
|
|
|
if (substr_compare(trim($line), 'namespace', 0, 9) === 0) { |
|
|
|
|
$namespace = $i; |
|
|
|
|
$namespaceLine = trim($line); |
|
|
|
|
} elseif ($namespace !== false && trim($line) !== '') { |
|
|
|
@ -275,13 +275,13 @@ class PhpDocController extends Controller
|
|
|
|
|
|
|
|
|
|
// TODO move these checks to different action |
|
|
|
|
$lines = explode("\n", $newDoc); |
|
|
|
|
if (trim($lines[1]) == '*' || substr(trim($lines[1]), 0, 3) == '* @') { |
|
|
|
|
if (trim($lines[1]) == '*' || substr_compare(trim($lines[1]), '* @', 0, 3) === 0) { |
|
|
|
|
$this->stderr("[WARN] Class $className has no short description.\n", Console::FG_YELLOW, Console::BOLD); |
|
|
|
|
} |
|
|
|
|
foreach ($lines as $line) { |
|
|
|
|
if (substr(trim($line), 0, 9) == '* @since ') { |
|
|
|
|
if (substr_compare(trim($line), '* @since ', 0, 9) === 0) { |
|
|
|
|
$seenSince = true; |
|
|
|
|
} elseif (substr(trim($line), 0, 10) == '* @author ') { |
|
|
|
|
} elseif (substr_compare(trim($line), '* @author ', 0, 10) === 0) { |
|
|
|
|
$seenAuthor = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -350,13 +350,13 @@ class PhpDocController extends Controller
|
|
|
|
|
$propertyPart = false; |
|
|
|
|
$propertyPosition = false; |
|
|
|
|
foreach ($lines as $i => $line) { |
|
|
|
|
if (substr(trim($line), 0, 12) == '* @property ') { |
|
|
|
|
if (substr_compare(trim($line), '* @property ', 0, 12) === 0) { |
|
|
|
|
$propertyPart = true; |
|
|
|
|
} elseif ($propertyPart && trim($line) == '*') { |
|
|
|
|
$propertyPosition = $i; |
|
|
|
|
$propertyPart = false; |
|
|
|
|
} |
|
|
|
|
if (substr(trim($line), 0, 10) == '* @author ' && $propertyPosition === false) { |
|
|
|
|
if (substr_compare(trim($line), '* @author ', 0, 10) === 0 && $propertyPosition === false) { |
|
|
|
|
$propertyPosition = $i - 1; |
|
|
|
|
$propertyPart = false; |
|
|
|
|
} |
|
|
|
|