Skip to content

Commit

Permalink
Refs #927 - Fix PHP 5.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mrook committed Oct 11, 2012
1 parent 895db67 commit 50f07c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions classes/phing/tasks/ext/phpcpd/PHPCPDTask.php
Expand Up @@ -267,11 +267,14 @@ public function main()
$this->log('Processing files...');

if ($oldVersion) {
$detector = new PHPCPD_Detector(new PHPCPD_Detector_Strategy_Default());
$detectorClass = 'PHPCPD_Detector';
$strategyClass = 'PHPCPD_Detector_Strategy_Default';
} else {
$detector = new \SebastianBergmann\PHPCPD\Detector\Detector(new \SebastianBergmann\PHPCPD\Detector\Strategy\DefaultStrategy());
$detectorClass = '\\SebastianBergmann\\PHPCPD\\Detector\\Detector';
$strategyClass = '\\SebastianBergmann\\PHPCPD\\Detector\\Strategy\\DefaultStrategy';
}


$detector = new $detectorClass(new $strategyClass);
$clones = $detector->copyPasteDetection(
$filesToParse,
$this->_minLines,
Expand Down

0 comments on commit 50f07c7

Please sign in to comment.