[cs] add and apply psr2

This commit is contained in:
TomasVotruba
2017-11-12 21:23:54 +01:00
committed by Jaap van Otterdijk
parent 0294ce9b70
commit a872e515bb
20 changed files with 43 additions and 41 deletions
+1
View File
@@ -98,6 +98,7 @@ class Description
foreach ($this->tags as $tag) {
$tags[] = '{' . $formatter->format($tag) . '}';
}
return vsprintf($this->bodyTemplate, $tags);
}
-1
View File
@@ -188,5 +188,4 @@ class DescriptionFactory
return implode("\n", $lines);
}
}
+2
View File
@@ -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";
+1 -2
View File
@@ -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);
}
+1 -2
View File
@@ -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);
+3 -1
View File
@@ -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' ]) {
+1 -1
View File
@@ -17,5 +17,5 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Reference;
*/
interface Reference
{
public function __toString();
public function __toString();
}
+1 -2
View File
@@ -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]);
+1
View File
@@ -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];
}