Skip to content

Commit 3122b8c

Browse files
hollodotmeHolger Woltersdorf
authored andcommitted
Removed obsolete root dir in stub, Application and TestReporterCommand
1 parent 245ba34 commit 3122b8c

File tree

3 files changed

+11
-54
lines changed

3 files changed

+11
-54
lines changed

composer/bin/test-reporter

Lines changed: 1 addition & 3 deletions
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

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,7 @@
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-
34-
// internal method
14+
// internal method
3515

3616
/**
3717
* {@inheritdoc}
@@ -56,14 +36,13 @@ protected function getDefaultCommands()
5636
return $defaultCommands;
5737
}
5838

59-
/**
60-
* Create TestReporterCommand.
61-
* @return TestReporterCommand
62-
*/
63-
protected function createTestReporterCommand()
64-
{
65-
$command = new TestReporterCommand();
66-
$command->setRootDir($this->rootDir);
39+
/**
40+
* Create TestReporterCommand.
41+
* @return TestReporterCommand
42+
*/
43+
protected function createTestReporterCommand()
44+
{
45+
$command = new TestReporterCommand();
6746

6847
return $command;
6948
}

src/ConsoleCommands/TestReporterCommand.php

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@
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()
2620
*/
2721
protected function configure()
2822
{
29-
$this
23+
$this
3024
->setName('test-reporter')
3125
->setDescription('Code Climate PHP Test Reporter')
3226
->addOption(
@@ -78,19 +72,5 @@ protected function execute(InputInterface $input, OutputInterface $output)
7872
}
7973

8074
return $ret;
81-
}
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-
}
75+
}
9676
}

0 commit comments

Comments
 (0)