Skip to content

Commit

Permalink
[EasyStandard] Hotfix/Fix PhpDocCommentRector (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
DKeeper committed Mar 18, 2021
1 parent 533ffca commit 0315374
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/EasyStandard/src/Rector/PhpDocCommentRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private function checkGenericTagValueNode(AttributeAwarePhpDocTagNode $attribute
$valueAsArray[1] = Strings::substring($valueAsArray[1], 0, -1);
}

$valueAsArray[1] = Strings::firstLower(Strings::trim($valueAsArray[1]));
$valueAsArray[1] = Strings::firstUpper(Strings::trim($valueAsArray[1]));

$newValue = implode(') ', $valueAsArray);

Expand Down Expand Up @@ -261,7 +261,7 @@ private function checkVarTagValueNode(AttributeAwarePhpDocTagNode $attributeAwar
return;
}

$newDescription = Strings::firstLower(Strings::trim($varTagValueNode->description));
$newDescription = Strings::firstUpper(Strings::trim($varTagValueNode->description));

if ($this->isLineEndingWithAllowed($newDescription)) {
$newDescription = Strings::substring($newDescription, 0, -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ declare(strict_types=1);

$someClass = new \stdClass();

/** @var \App\Tests\FactoryMuffinWrapper $factoryMuffin my comments */
/** @var \App\Tests\FactoryMuffinWrapper $factoryMuffin My comments */
$someClass->test = 'test';
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare(strict_types=1);

$someClass = new \stdClass();

/** @var \App\Tests\FactoryMuffinWrapper $factoryMuffin my comments */
/** @var \App\Tests\FactoryMuffinWrapper $factoryMuffin My comments */
$someClass->test = 'test';

?>
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ClassHasCorrectPhpDoc
/**
* My property.
*
* @Assert\NotNull() some description
* @Assert\NotNull() Some description
*
* @see Another code
*
Expand Down Expand Up @@ -88,7 +88,7 @@ class ClassHasCorrectPhpDoc
/**
* Some text.
*
* @var mixed[]|string $value may be refactor
* @var mixed[]|string $value May be refactor
*/
if (\is_array($value)) {
foreach ($value as $key2 => $value2) {
Expand All @@ -100,7 +100,7 @@ class ClassHasCorrectPhpDoc
*
* Another text 2.
*
* @var string[] $test3 some text
* @var string[] $test3 Some text
*/
$test3['123'] = '123';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ClassHasIncorrectPhpDoc
/**
* My property comment.
*
* @Assert\NotNull() some description
* @Assert\NotNull() Some description
*
* @see Another code
*
Expand Down Expand Up @@ -148,7 +148,7 @@ class ClassHasIncorrectPhpDoc
/**
* Some text.
*
* @var mixed[]|string $value may be refactor
* @var mixed[]|string $value May be refactor
*/
if (\is_array($value)) {
// Try to loop
Expand All @@ -159,7 +159,7 @@ class ClassHasIncorrectPhpDoc
/**
* Another text.
*
* @var string[] $test3 some text
* @var string[] $test3 Some text
*/
$test3['123'] = '123';
}
Expand Down

0 comments on commit 0315374

Please sign in to comment.