Skip to content

Commit a872e51

Browse files
TomasVotrubajaapio
authored andcommitted
[cs] add and apply psr2
1 parent 0294ce9 commit a872e51

20 files changed

+43
-41
lines changed

easy-coding-standard.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
includes:
22
- temp/ecs/config/clean-code.neon
3+
- temp/ecs/config/psr2-checkers.neon
34

45
parameters:
56
skip:

src/DocBlock.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public function __construct(
5555
Location $location = null,
5656
$isTemplateStart = false,
5757
$isTemplateEnd = false
58-
)
59-
{
58+
) {
6059
Assert::string($summary);
6160
Assert::boolean($isTemplateStart);
6261
Assert::boolean($isTemplateEnd);

src/DocBlock/Description.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function render(Formatter $formatter = null)
9898
foreach ($this->tags as $tag) {
9999
$tags[] = '{' . $formatter->format($tag) . '}';
100100
}
101+
101102
return vsprintf($this->bodyTemplate, $tags);
102103
}
103104

src/DocBlock/DescriptionFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,4 @@ private function removeSuperfluousStartingWhitespace($contents)
188188

189189
return implode("\n", $lines);
190190
}
191-
192191
}

src/DocBlock/Serializer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ private function getSummaryAndDescriptionTextBlock(DocBlock $docblock, $wrapLeng
121121
$text = wordwrap($text, $wrapLength);
122122
return $text;
123123
}
124+
124125
return $text;
125126
}
126127

@@ -138,6 +139,7 @@ private function addTagBlock(DocBlock $docblock, $wrapLength, $indent, $comment)
138139
if ($wrapLength !== null) {
139140
$tagText = wordwrap($tagText, $wrapLength);
140141
}
142+
141143
$tagText = str_replace("\n", "\n{$indent} * ", $tagText);
142144

143145
$comment .= "{$indent} * {$tagText}\n";

src/DocBlock/StandardTagFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ private function createTag($body, $name, TypeContext $context)
196196
$arguments = $this->getArgumentsForParametersFromWiring(
197197
$this->fetchParametersForHandlerFactoryMethod($handlerClassName),
198198
$this->getServiceLocatorWithDynamicParameters($context, $name, $body)
199-
)
200-
;
199+
);
201200

202201
return call_user_func_array([$handlerClassName, 'create'], $arguments);
203202
}

src/DocBlock/Tags/Covers.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ public static function create(
4949
DescriptionFactory $descriptionFactory = null,
5050
FqsenResolver $resolver = null,
5151
TypeContext $context = null
52-
)
53-
{
52+
) {
5453
Assert::string($body);
5554
Assert::notEmpty($body);
5655

src/DocBlock/Tags/Method.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public static function create(
135135

136136
if (is_string($arguments) && strlen($arguments) > 0) {
137137
$arguments = explode(',', $arguments);
138-
foreach($arguments as &$argument) {
138+
foreach ($arguments as &$argument) {
139139
$argument = explode(' ', self::stripRestArg(trim($argument)), 2);
140140
if ($argument[0][0] === '$') {
141141
$argumentName = substr($argument[0], 1);
@@ -214,9 +214,11 @@ private function filterArguments($arguments)
214214
if (is_string($argument)) {
215215
$argument = [ 'name' => $argument ];
216216
}
217+
217218
if (! isset($argument['type'])) {
218219
$argument['type'] = new Void_();
219220
}
221+
220222
$keys = array_keys($argument);
221223
sort($keys);
222224
if ($keys !== [ 'name', 'type' ]) {

src/DocBlock/Tags/Reference/Reference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
*/
1818
interface Reference
1919
{
20-
public function __toString();
20+
public function __toString();
2121
}

src/DocBlock/Tags/Return_.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ public static function create(
4343
TypeResolver $typeResolver = null,
4444
DescriptionFactory $descriptionFactory = null,
4545
TypeContext $context = null
46-
)
47-
{
46+
) {
4847
Assert::string($body);
4948
Assert::allNotNull([$typeResolver, $descriptionFactory]);
5049

0 commit comments

Comments
 (0)