Browse Source

DX: Fix Mess Detector violations (#8007)

Greg Korba 10 months ago
parent
commit
025ce394a2

+ 3 - 3
src/Console/Report/FixReport/XmlReporter.php

@@ -126,9 +126,9 @@ final class XmlReporter implements ReporterInterface
 
     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;
     }
 }

+ 3 - 1
src/Tokenizer/Analyzer/AttributeAnalyzer.php

@@ -110,7 +110,9 @@ final class AttributeAnalyzer
         }
 
         $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);
         }