mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
[cs] add and apply psr2
This commit is contained in:
committed by
Jaap van Otterdijk
parent
0294ce9b70
commit
a872e515bb
+1
-2
@@ -55,8 +55,7 @@ final class DocBlock
|
||||
Location $location = null,
|
||||
$isTemplateStart = false,
|
||||
$isTemplateEnd = false
|
||||
)
|
||||
{
|
||||
) {
|
||||
Assert::string($summary);
|
||||
Assert::boolean($isTemplateStart);
|
||||
Assert::boolean($isTemplateEnd);
|
||||
|
||||
@@ -98,6 +98,7 @@ class Description
|
||||
foreach ($this->tags as $tag) {
|
||||
$tags[] = '{' . $formatter->format($tag) . '}';
|
||||
}
|
||||
|
||||
return vsprintf($this->bodyTemplate, $tags);
|
||||
}
|
||||
|
||||
|
||||
@@ -188,5 +188,4 @@ class DescriptionFactory
|
||||
|
||||
return implode("\n", $lines);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ class Serializer
|
||||
$text = wordwrap($text, $wrapLength);
|
||||
return $text;
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
@@ -138,6 +139,7 @@ class Serializer
|
||||
if ($wrapLength !== null) {
|
||||
$tagText = wordwrap($tagText, $wrapLength);
|
||||
}
|
||||
|
||||
$tagText = str_replace("\n", "\n{$indent} * ", $tagText);
|
||||
|
||||
$comment .= "{$indent} * {$tagText}\n";
|
||||
|
||||
@@ -196,8 +196,7 @@ final class StandardTagFactory implements TagFactory
|
||||
$arguments = $this->getArgumentsForParametersFromWiring(
|
||||
$this->fetchParametersForHandlerFactoryMethod($handlerClassName),
|
||||
$this->getServiceLocatorWithDynamicParameters($context, $name, $body)
|
||||
)
|
||||
;
|
||||
);
|
||||
|
||||
return call_user_func_array([$handlerClassName, 'create'], $arguments);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
FqsenResolver $resolver = null,
|
||||
TypeContext $context = null
|
||||
)
|
||||
{
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::notEmpty($body);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
|
||||
|
||||
if (is_string($arguments) && strlen($arguments) > 0) {
|
||||
$arguments = explode(',', $arguments);
|
||||
foreach($arguments as &$argument) {
|
||||
foreach ($arguments as &$argument) {
|
||||
$argument = explode(' ', self::stripRestArg(trim($argument)), 2);
|
||||
if ($argument[0][0] === '$') {
|
||||
$argumentName = substr($argument[0], 1);
|
||||
@@ -214,9 +214,11 @@ final class Method extends BaseTag implements Factory\StaticMethod
|
||||
if (is_string($argument)) {
|
||||
$argument = [ 'name' => $argument ];
|
||||
}
|
||||
|
||||
if (! isset($argument['type'])) {
|
||||
$argument['type'] = new Void_();
|
||||
}
|
||||
|
||||
$keys = array_keys($argument);
|
||||
sort($keys);
|
||||
if ($keys !== [ 'name', 'type' ]) {
|
||||
|
||||
@@ -17,5 +17,5 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Reference;
|
||||
*/
|
||||
interface Reference
|
||||
{
|
||||
public function __toString();
|
||||
public function __toString();
|
||||
}
|
||||
|
||||
@@ -43,8 +43,7 @@ final class Return_ extends BaseTag implements Factory\StaticMethod
|
||||
TypeResolver $typeResolver = null,
|
||||
DescriptionFactory $descriptionFactory = null,
|
||||
TypeContext $context = null
|
||||
)
|
||||
{
|
||||
) {
|
||||
Assert::string($body);
|
||||
Assert::allNotNull([$typeResolver, $descriptionFactory]);
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ final class Source extends BaseTag implements Factory\StaticMethod
|
||||
if (isset($matches[2]) && $matches[2] !== '') {
|
||||
$lineCount = (int)$matches[2];
|
||||
}
|
||||
|
||||
$description = $matches[3];
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface
|
||||
return new DocBlock(
|
||||
$summary,
|
||||
$description ? $this->descriptionFactory->create($description, $context) : null,
|
||||
array_filter($this->parseTagBlock($tags, $context), function($tag) {
|
||||
array_filter($this->parseTagBlock($tags, $context), function ($tag) {
|
||||
return $tag instanceof Tag;
|
||||
}),
|
||||
$context,
|
||||
|
||||
Reference in New Issue
Block a user