Commits

Rafał Kos committed 3ea8be6

bugfix: PHP Notice error in svnblame report

Comments (0)

Files changed (2)

CodeSniffer/Reports/Svnblame.php

         foreach ($report['files'] as $filename => $file) {
             $blames = $this->getSvnblameContent($filename);
 
-            foreach ($file['messages'] as $line => $lineErrors) {
+            foreach ($file['messages'] as $line => $lineErrors) {				
+				
                 $author = $this->getSvnAuthor($blames[($line - 1)]);
+				//return;
                 if ($author === false) {
                     continue;
                 }
                 $praise[$author]['bad']++;
 
                 foreach ($lineErrors as $column => $colErrors) {
-                    foreach ($colErrors as $error) {
-                        $errorsShown++;
+                    foreach ($colErrors as $error) {												
+                        $errorsShown++;						
                         $authors[$author]++;
 
                         if ($showSources === true) {
                         }
                     }
                 }
-
-                unset($blames[$line]);
+				
+                unset($blames[$line-1]);
             }//end foreach
 
             // No go through and give the authors some credit for

CodeSniffer/Reports/Svnblame2csv.php

         $command = "svn blame --non-interactive --username $svnUser --password $svnPass " . $filename;
 		$blames  = array()
 		
-		exec($command, $output);
+		exec($command, $blames);
         
         if (PHP_CODESNIFFER_VERBOSITY > 0) {
             echo 'DONE'.PHP_EOL;