Permalink
Browse files

Refs #927 - Fix PHP 5.2 compatibility

  • Loading branch information...
1 parent 895db67 commit 50f07c760d1698a8c049b5938e9a892efef32ab6 @mrook mrook committed Oct 11, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 classes/phing/tasks/ext/phpcpd/PHPCPDTask.php
@@ -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,

0 comments on commit 50f07c7

Please sign in to comment.