Skip to content

Commit c4838ad

Browse files
author
Philipp Handle
committed
phpdoc upgrades, compatibility layer
1 parent 7b8b6d7 commit c4838ad

20 files changed

+118
-53
lines changed

bin/app.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616

1717
return $version;
1818
})('bmitch/churn-php'));
19-
$application->add(AssessComplexityCommand::newInstance());
20-
$application->add($run = RunCommand::newInstance());
19+
$method = method_exists($application, 'addCommand')
20+
? 'addCommand'
21+
: 'add';
22+
$application->{$method}(AssessComplexityCommand::newInstance());
23+
$application->{$method}($run = RunCommand::newInstance());
2124
$application->setDefaultCommand($run->getName());
2225

2326
return $application;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"phpcs",
8787
"phpcs --standard=phpcs-tests.xml",
8888
"psalm",
89-
"phpstan"
89+
"phpstan --memory-limit=-1"
9090
]
9191
}
9292
}

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ parameters:
1212
reportUnmatchedIgnoredErrors: true
1313
ignoreErrors:
1414
- '/^Casting to .+ something that''s already/'
15+
- "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Application and 'addCommand' will always evaluate to true#"
16+
- "#Variable method call on Symfony\\\\Component\\\\Console\\\\Application#"
1517

1618
checkTooWideReturnTypesInProtectedAndPublicMethods: true
1719
checkUninitializedProperties: true

tests/EndToEnd/FossilTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,28 @@ final class FossilTest extends BaseTestCase
1616
*/
1717
private $commandTester;
1818

19-
/** @return void */
19+
/**
20+
* Test setup
21+
*/
2022
#[\Override]
21-
protected function setUp()
23+
protected function setUp(): void
2224
{
2325
parent::setUp();
2426

2527
$application = new Application('churn-php', 'test');
26-
$application->add(RunCommand::newInstance());
28+
$method = \method_exists($application, 'addCommand')
29+
? 'addCommand'
30+
: 'add';
31+
$application->{$method}(RunCommand::newInstance());
2732
$command = $application->find('run');
2833
$this->commandTester = new CommandTester($command);
2934
}
3035

31-
/** @return void */
36+
/**
37+
* Test teardown
38+
*/
3239
#[\Override]
33-
protected function tearDown()
40+
protected function tearDown(): void
3441
{
3542
parent::tearDown();
3643

tests/EndToEnd/MercurialTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,28 @@ final class MercurialTest extends BaseTestCase
1616
*/
1717
private $commandTester;
1818

19-
/** @return void */
19+
/**
20+
* Test setup
21+
*/
2022
#[\Override]
21-
protected function setUp()
23+
protected function setUp(): void
2224
{
2325
parent::setUp();
2426

2527
$application = new Application('churn-php', 'test');
26-
$application->add(RunCommand::newInstance());
28+
$method = \method_exists($application, 'addCommand')
29+
? 'addCommand'
30+
: 'add';
31+
$application->{$method}(RunCommand::newInstance());
2732
$command = $application->find('run');
2833
$this->commandTester = new CommandTester($command);
2934
}
3035

31-
/** @return void */
36+
/**
37+
* Test teardown
38+
*/
3239
#[\Override]
33-
protected function tearDown()
40+
protected function tearDown(): void
3441
{
3542
parent::tearDown();
3643

tests/EndToEnd/SubversionTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,28 @@ final class SubversionTest extends BaseTestCase
1616
*/
1717
private $commandTester;
1818

19-
/** @return void */
19+
/**
20+
* Test setup
21+
*/
2022
#[\Override]
21-
protected function setUp()
23+
protected function setUp(): void
2224
{
2325
parent::setUp();
2426

2527
$application = new Application('churn-php', 'test');
26-
$application->add(RunCommand::newInstance());
28+
$method = \method_exists($application, 'addCommand')
29+
? 'addCommand'
30+
: 'add';
31+
$application->{$method}(RunCommand::newInstance());
2732
$command = $application->find('run');
2833
$this->commandTester = new CommandTester($command);
2934
}
3035

31-
/** @return void */
36+
/**
37+
* Test teardown
38+
*/
3239
#[\Override]
33-
protected function tearDown()
40+
protected function tearDown(): void
3441
{
3542
parent::tearDown();
3643

tests/Integration/Command/AssessComplexityCommandTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,28 @@ final class AssessComplexityCommandTest extends BaseTestCase
1616
*/
1717
private $commandTester;
1818

19-
/** @return void */
19+
/**
20+
* Test setup
21+
*/
2022
#[\Override]
21-
protected function setUp()
23+
protected function setUp(): void
2224
{
2325
parent::setUp();
2426

2527
$application = new Application('churn-php', 'test');
26-
$application->add(AssessComplexityCommand::newInstance());
28+
$method = \method_exists($application, 'addCommand')
29+
? 'addCommand'
30+
: 'add';
31+
$application->{$method}(AssessComplexityCommand::newInstance());
2732
$command = $application->find('assess-complexity');
2833
$this->commandTester = new CommandTester($command);
2934
}
3035

31-
/** @return void */
36+
/**
37+
* Test teardown
38+
*/
3239
#[\Override]
33-
protected function tearDown()
40+
protected function tearDown(): void
3441
{
3542
parent::tearDown();
3643

tests/Integration/Command/RunCommandTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,28 @@ final class RunCommandTest extends BaseTestCase
2828
*/
2929
private $tmpFile;
3030

31-
/** @return void */
31+
/**
32+
* Test setup
33+
*/
3234
#[\Override]
33-
protected function setUp()
35+
protected function setUp(): void
3436
{
3537
parent::setUp();
3638

3739
$application = new Application('churn-php', 'test');
38-
$application->add(RunCommand::newInstance());
40+
$method = \method_exists($application, 'addCommand')
41+
? 'addCommand'
42+
: 'add';
43+
$application->{$method}(RunCommand::newInstance());
3944
$command = $application->find('run');
4045
$this->commandTester = new CommandTester($command);
4146
}
4247

43-
/** @return void */
48+
/**
49+
* Test teardown
50+
*/
4451
#[\Override]
45-
protected function tearDown()
52+
protected function tearDown(): void
4653
{
4754
parent::tearDown();
4855

tests/Integration/File/FileFinderTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ final class FileFinderTest extends BaseTestCase
1515
*/
1616
private $fileFinder;
1717

18-
/** @return void */
18+
/**
19+
* Test setup
20+
*/
1921
#[\Override]
20-
public function setUp()
22+
public function setUp(): void
2123
{
2224
parent::setUp();
2325

tests/Integration/ManifestTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ final class ManifestTest extends BaseTestCase
1616
*/
1717
private $manifest;
1818

19-
/** @return void */
19+
/**
20+
* Test setup
21+
*/
2022
#[\Override]
21-
public function setUp()
23+
public function setUp(): void
2224
{
2325
parent::setUp();
2426

0 commit comments

Comments
 (0)