mirror of
https://github.com/danog/phpdoc.git
synced 2024-11-29 20:19:03 +01:00
Fixes
This commit is contained in:
parent
12d8733995
commit
1ac05c37d8
@ -39,12 +39,7 @@ class ClassDoc extends GenericDoc
|
|||||||
{
|
{
|
||||||
$this->builder = $builder;
|
$this->builder = $builder;
|
||||||
$this->name = $reflectionClass->getName();
|
$this->name = $reflectionClass->getName();
|
||||||
$doc = $reflectionClass->getDocComment();
|
$doc = $reflectionClass->getDocComment() ?: '/** */';
|
||||||
if (!$doc) {
|
|
||||||
\fprintf(STDERR, $reflectionClass->getName()." has no PHPDOC".PHP_EOL);
|
|
||||||
$this->ignore = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$doc = $this->builder->getFactory()->create($doc);
|
$doc = $this->builder->getFactory()->create($doc);
|
||||||
|
|
||||||
parent::__construct($doc, $reflectionClass);
|
parent::__construct($doc, $reflectionClass);
|
||||||
|
@ -22,14 +22,6 @@ class FunctionDoc extends MethodDoc
|
|||||||
{
|
{
|
||||||
$this->builder = $builder;
|
$this->builder = $builder;
|
||||||
$this->name = $reflectionClass->getName();
|
$this->name = $reflectionClass->getName();
|
||||||
$doc = $reflectionClass->getDocComment();
|
|
||||||
if (!$doc) {
|
|
||||||
\fprintf(STDERR, $reflectionClass->getName()." has no PHPDOC".PHP_EOL);
|
|
||||||
$this->ignore = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$doc = $this->builder->getFactory()->create($doc);
|
|
||||||
|
|
||||||
parent::__construct($builder, $reflectionClass);
|
parent::__construct($builder, $reflectionClass);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -31,16 +31,7 @@ class MethodDoc extends GenericDoc
|
|||||||
{
|
{
|
||||||
$this->builder = $phpDocBuilder;
|
$this->builder = $phpDocBuilder;
|
||||||
$this->name = $method->getName();
|
$this->name = $method->getName();
|
||||||
$doc = $method->getDocComment();
|
$doc = $method->getDocComment() ?: '/** */';
|
||||||
if (!$doc) {
|
|
||||||
$this->ignore = true;
|
|
||||||
if ($method instanceof ReflectionMethod) {
|
|
||||||
\fprintf(STDERR, $method->getDeclaringClass()->getName().'::'.$method->getName().' has no PHPDOC!'.PHP_EOL);
|
|
||||||
} else {
|
|
||||||
\fprintf(STDERR, $method->getName()." has no PHPDOC!".PHP_EOL);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$doc = $this->builder->getFactory()->create($doc);
|
$doc = $this->builder->getFactory()->create($doc);
|
||||||
|
|
||||||
parent::__construct($doc, $method instanceof ReflectionMethod ? $method->getDeclaringClass() : $method);
|
parent::__construct($doc, $method instanceof ReflectionMethod ? $method->getDeclaringClass() : $method);
|
||||||
@ -84,7 +75,10 @@ class MethodDoc extends GenericDoc
|
|||||||
} elseif ($tag instanceof Generic && $tag->getName() === 'psalm-return') {
|
} elseif ($tag instanceof Generic && $tag->getName() === 'psalm-return') {
|
||||||
$this->psalmReturn = $tag;
|
$this->psalmReturn = $tag;
|
||||||
} elseif ($tag instanceof Generic && $tag->getName() === 'psalm-param') {
|
} elseif ($tag instanceof Generic && $tag->getName() === 'psalm-param') {
|
||||||
[$type, $description] = \explode(" $", $tag->getDescription(), 2);
|
$desc = $tag->getDescription();
|
||||||
|
$dollar = \strrpos($desc, '$');
|
||||||
|
$type = \substr($tag, 0, $dollar-1);
|
||||||
|
$description = \substr($tag, $dollar+1);
|
||||||
$description .= ' ';
|
$description .= ' ';
|
||||||
[$varName, $description] = \explode(" ", $description, 2);
|
[$varName, $description] = \explode(" ", $description, 2);
|
||||||
if (!$description && isset($params[$varName])) {
|
if (!$description && isset($params[$varName])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user