Skip to content

Commit

Permalink
DX: Fix Mess Detector violations (#8007)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wirone committed May 14, 2024
1 parent 77dc410 commit 025ce39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Console/Report/FixReport/XmlReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ private function createMemoryElement(float $memory, \DOMDocument $dom): \DOMElem

private function createAboutElement(\DOMDocument $dom, string $about): \DOMElement
{
$XML = $dom->createElement('about');
$XML->setAttribute('value', $about);
$xml = $dom->createElement('about');
$xml->setAttribute('value', $about);

return $XML;
return $xml;
}
}
4 changes: 3 additions & 1 deletion src/Tokenizer/Analyzer/AttributeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public static function collectOne(Tokens $tokens, int $index): AttributeAnalysis
}

$startIndex = $index;
if ($tokens[$prevIndex = $tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) {
$prevIndex = $tokens->getPrevMeaningfulToken($index);

if ($tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) {
// Include comments/PHPDoc if they are present
$startIndex = $tokens->getNextNonWhitespace($prevIndex);
}
Expand Down

0 comments on commit 025ce39

Please sign in to comment.