From 865413a6fbb7500608e1a1f134273381a38f0c54 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 14 Jan 2010 16:12:12 +0100 Subject: [PATCH] Cleanup. --- PHPUnit/Util/Metrics/File.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/PHPUnit/Util/Metrics/File.php b/PHPUnit/Util/Metrics/File.php index d7c3dc36d85..37ebfae1477 100644 --- a/PHPUnit/Util/Metrics/File.php +++ b/PHPUnit/Util/Metrics/File.php @@ -96,7 +96,10 @@ protected function __construct($filename, &$codeCoverage = array()) $this->filename = $filename; - $this->countLines(); + foreach (PHPUnit_Util_File::countLines($this->filename) as $name => $value) { + $this->$name = $value; + } + $this->setCoverage($codeCoverage); foreach (PHPUnit_Util_File::getClassesInFile($filename) as $className => $class) { @@ -219,7 +222,7 @@ public function getLines() */ public function getTokens() { - return token_get_all(file_get_contents($this->filename)); + return token_get_all(file_get_contents($this->filename)); } /** @@ -301,13 +304,5 @@ protected function calculateCodeCoverage(&$codeCoverage) $this->locExecutable = $statistics['locExecutable']; $this->locExecuted = $statistics['locExecuted']; } - - /** - */ - protected function countLines() - { - foreach (PHPUnit_Util_File::countLines($this->filename) as $name => $value) - $this->$name = $value; - } } ?>