Skip to content

Commit d086931

Browse files
authored
Merge pull request #56 from hollodotme/issue-54/remove-obsolete-root-dir
Removed obsolete root dir in stub, Application and TestReporterCommand
2 parents 245ba34 + 4888095 commit d086931

File tree

3 files changed

+1
-44
lines changed

3 files changed

+1
-44
lines changed

composer/bin/test-reporter

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,5 @@ if (!defined('PHP_TEST_REPORTER_COMPOSER_INSTALL')) {
2828
);
2929
}
3030

31-
$rootDir = realpath(dirname(PHP_TEST_REPORTER_COMPOSER_INSTALL) . '/..');
32-
33-
$app = new Application($rootDir, 'Code Climate PHP Test Reporter', Version::VERSION);
31+
$app = new Application('Code Climate PHP Test Reporter', Version::VERSION);
3432
$app->run();

src/Application.php

-21
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@
1111
*/
1212
class Application extends BaseApplication
1313
{
14-
/**
15-
* Path to project root directory.
16-
* @var string
17-
*/
18-
private $rootDir;
19-
20-
/**
21-
* Constructor.
22-
*
23-
* @param string $rootDir Path to project root directory.
24-
* @param string $name The name of the application
25-
* @param string $version The version of the application
26-
*/
27-
public function __construct($rootDir, $name = 'UNKNOWN', $version = 'UNKNOWN')
28-
{
29-
$this->rootDir = $rootDir;
30-
31-
parent::__construct($name, $version);
32-
}
33-
3414
// internal method
3515

3616
/**
@@ -63,7 +43,6 @@ protected function getDefaultCommands()
6343
protected function createTestReporterCommand()
6444
{
6545
$command = new TestReporterCommand();
66-
$command->setRootDir($this->rootDir);
6746

6847
return $command;
6948
}

src/ConsoleCommands/TestReporterCommand.php

-20
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
*/
1515
class TestReporterCommand extends Command
1616
{
17-
/**
18-
* Path to project root directory.
19-
* @var string
20-
*/
21-
protected $rootDir;
22-
2317
/**
2418
* {@inheritdoc}
2519
* @see \Symfony\Component\Console\Command\Command::configure()
@@ -79,18 +73,4 @@ protected function execute(InputInterface $input, OutputInterface $output)
7973

8074
return $ret;
8175
}
82-
83-
// accessor
84-
85-
/**
86-
* Set root directory.
87-
*
88-
* @param string $rootDir Path to project root directory.
89-
*
90-
* @return void
91-
*/
92-
public function setRootDir($rootDir)
93-
{
94-
$this->rootDir = $rootDir;
95-
}
9676
}

0 commit comments

Comments
 (0)