Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Use SebastianBergmann\Version to manage the version number
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Apr 4, 2013
1 parent a8da082 commit 5d83afa
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 93 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ phpcpd

This is the list of changes for the phpcpd 1.4 release series.

phpcpd 1.4.1
------------

* The [Version](http://github.com/sebastianbergmann/version) component is now used to manage the version number.

phpcpd 1.4.0
------------

Expand Down
6 changes: 5 additions & 1 deletion build/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<file baseinstalldir="/" name="autoload.php" role="php" />
<file baseinstalldir="/" name="CodeClone.php" role="php" />
<file baseinstalldir="/" name="CodeCloneMap.php" role="php" />
<file baseinstalldir="/" name="Version.php" role="php" />
</dir>
</dir>
<file baseinstalldir="/" name="phpcpd.php" role="script">
Expand Down Expand Up @@ -89,6 +88,11 @@
<channel>pear.phpunit.de</channel>
<min>1.0.4</min>
</package>
<package>
<name>Version</name>
<channel>pear.phpunit.de</channel>
<min>1.0.0</min>
</package>
<extension>
<name>tokenizer</name>
</extension>
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"sebastian/finder-facade": "dev-master",
"phpunit/php-timer": ">=1.0.4",
"symfony/finder": ">=2.1.2",
"theseer/fdomdocument": "dev-master"
"theseer/fdomdocument": "dev-master",
"sebastian/version": ">=1.0.0"
},
"minimum-stability": "dev",
"autoload": {
Expand Down
12 changes: 10 additions & 2 deletions src/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
namespace SebastianBergmann\PHPCPD\TextUI
{
use SebastianBergmann\FinderFacade\FinderFacade;
use SebastianBergmann\Version;
use SebastianBergmann\PHPCPD\Detector\Detector;
use SebastianBergmann\PHPCPD\Detector\Strategy\DefaultStrategy;
use SebastianBergmann\PHPCPD\Log\PMD;
use SebastianBergmann\PHPCPD\Version;

/**
* TextUI frontend for PHPCPD.
Expand All @@ -60,6 +60,14 @@
*/
class Command
{
private $version;

public function __construct()
{
$version = new Version('1.4.1', __DIR__);
$this->version = $version->getVersion();
}

/**
* Main method.
*/
Expand Down Expand Up @@ -295,7 +303,7 @@ protected function showHelp()
protected function printVersionString()
{
printf(
"phpcpd %s by Sebastian Bergmann.\n\n", Version::id()
"phpcpd %s by Sebastian Bergmann.\n\n", $this->version
);
}
}
Expand Down
87 changes: 0 additions & 87 deletions src/Version.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
*/

require_once 'SebastianBergmann/FinderFacade/autoload.php';
require_once 'SebastianBergmann/Version/autoload.php';
require_once 'PHP/Timer/Autoload.php';
require_once 'ezc/Base/base.php';

Expand All @@ -58,8 +59,7 @@ function($class) {
'sebastianbergmann\\phpcpd\\log\\abstractxmllogger' => '/Log/AbstractXmlLogger.php',
'sebastianbergmann\\phpcpd\\log\\pmd' => '/Log/PMD.php',
'sebastianbergmann\\phpcpd\\textui\\command' => '/TextUI/Command.php',
'sebastianbergmann\\phpcpd\\textui\\resultprinter' => '/TextUI/ResultPrinter.php',
'sebastianbergmann\\phpcpd\\version' => '/Version.php'
'sebastianbergmann\\phpcpd\\textui\\resultprinter' => '/TextUI/ResultPrinter.php'
);
}
$cn = strtolower($class);
Expand Down
1 change: 1 addition & 0 deletions src/autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
*/

require_once 'SebastianBergmann/FinderFacade/autoload.php';
require_once 'SebastianBergmann/Version/autoload.php';
require_once 'PHP/Timer/Autoload.php';
require_once 'ezc/Base/base.php';

Expand Down

0 comments on commit 5d83afa

Please sign in to comment.