Skip to content

Commit 9be6d3a

Browse files
committed
Remove some phpstan references
1 parent 2eedc98 commit 9be6d3a

13 files changed

+132
-462
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor
2+
/build
3+
/composer.lock

composer.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "code-lts/cli-tools",
3+
"description": "Some CLI tools to manage input and output and errors formatting",
4+
"type": "library",
5+
"license": "MPL-2.0",
6+
"homepage": "https://github.com/code-lts/cli-tools",
7+
"readme": "https://github.com/code-lts/cli-tools/blob/main/README.md",
8+
"keywords": [
9+
"cli",
10+
"formatters"
11+
],
12+
"support": {
13+
"email": "[email protected]",
14+
"issues": "https://github.com/code-lts/cli-tools/issues",
15+
"source": "https://github.com/code-lts/cli-tools"
16+
},
17+
"authors": [
18+
{
19+
"name": "William Desportes",
20+
"email": "[email protected]",
21+
"homepage": "https://william.wdes.fr"
22+
},
23+
{
24+
"name": "Ondřej Mirtes",
25+
"email": "[email protected]",
26+
"homepage": "https://ondrej.mirtes.cz"
27+
}
28+
],
29+
"scripts": {
30+
"test": "phpunit",
31+
"phpstan": "phpstan analyse"
32+
},
33+
"require": {
34+
"php": "^7.1 || ^8.0"
35+
},
36+
"require-dev": {
37+
"phpunit/phpunit": "^7 || ^8 || ^9",
38+
"phpstan/phpstan": "^0.12"
39+
},
40+
"autoload": {
41+
"psr-4": {
42+
"CodeLts\\CliTools\\": "src/"
43+
}
44+
},
45+
"autoload-dev": {
46+
"psr-4": {
47+
"CodeLts\\CliTools\\Tests\\": "tests/"
48+
}
49+
}
50+
}

phpunit.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<phpunit
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.0/phpunit.xsd"
4+
colors="true"
5+
backupGlobals="false"
6+
bootstrap="vendor/autoload.php"
7+
>
8+
9+
<filter>
10+
<whitelist>
11+
<directory>src</directory>
12+
</whitelist>
13+
</filter>
14+
15+
<logging>
16+
<log type="coverage-html" target="build/coverage/html/"/>
17+
<log type="coverage-clover" target="build/logs/clover.xml"/>
18+
</logging>
19+
20+
<testsuites>
21+
<testsuite name="Unit tests">
22+
<directory suffix=".php">tests/</directory>
23+
</testsuite>
24+
</testsuites>
25+
26+
</phpunit>

src/ErrorFormatter/BaselineNeonErrorFormatter.php

-99
This file was deleted.

src/ErrorFormatter/JunitErrorFormatter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function formatErrors(
4949
{
5050
$result = '<?xml version="1.0" encoding="UTF-8"?>';
5151
$result .= sprintf(
52-
'<testsuite failures="%d" name="phpstan" tests="%d" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/junit-team/junit5/r5.5.1/platform-tests/src/test/resources/jenkins-junit.xsd">',
52+
'<testsuite failures="%d" name="cli-tools" tests="%d" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/junit-team/junit5/r5.5.1/platform-tests/src/test/resources/jenkins-junit.xsd">',
5353
$analysisResult->getTotalErrorsCount(),
5454
$analysisResult->getTotalErrorsCount()
5555
);
@@ -72,7 +72,7 @@ public function formatErrors(
7272
}
7373

7474
if (!$analysisResult->hasErrors()) {
75-
$result .= $this->createTestCase('phpstan', '');
75+
$result .= $this->createTestCase('cli-tools', '');
7676
}
7777

7878
$result .= '</testsuite>';

src/ErrorFormatter/TableErrorFormatter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function formatErrors(
5353
Output $output
5454
): int
5555
{
56-
$projectConfigFile = 'phpstan.neon';
56+
$projectConfigFile = 'cli-tools.neon';
5757
if ($analysisResult->getProjectConfigFile() !== null) {
5858
$projectConfigFile = $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile());
5959
}
@@ -66,7 +66,7 @@ public function formatErrors(
6666
if ($analysisResult->isDefaultLevelUsed()) {
6767
$output->writeLineFormatted('💡 Tip of the Day:');
6868
$output->writeLineFormatted(sprintf(
69-
"PHPStan is performing only the most basic checks.\nYou can pass a higher rule level through the <fg=cyan>--%s</> option\n(the default and current level is %d) to analyse code more thoroughly.",
69+
"cli-tools is performing only the most basic checks.\nYou can pass a higher rule level through the <fg=cyan>--%s</> option\n(the default and current level is %d) to analyse code more thoroughly.",
7070
AnalyseCommand::OPTION_LEVEL,
7171
AnalyseCommand::DEFAULT_LEVEL
7272
));

src/ErrorFormatter/TeamcityErrorFormatter.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
5656
}
5757

5858
$result .= $this->createTeamcityLine('inspectionType', [
59-
'id' => 'phpstan',
60-
'name' => 'phpstan',
61-
'category' => 'phpstan',
62-
'description' => 'phpstan Inspection',
59+
'id' => 'cli-tools',
60+
'name' => 'cli-tools',
61+
'category' => 'cli-tools',
62+
'description' => 'cli-tools Errors',
6363
]);
6464

6565
foreach ($fileSpecificErrors as $fileSpecificError) {
6666
$result .= $this->createTeamcityLine('inspection', [
67-
'typeId' => 'phpstan',
67+
'typeId' => 'cli-tools',
6868
'message' => $fileSpecificError->getMessage(),
6969
'file' => $this->relativePathHelper->getRelativePath($fileSpecificError->getFile()),
7070
'line' => $fileSpecificError->getLine(),
@@ -77,7 +77,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
7777

7878
foreach ($notFileSpecificErrors as $notFileSpecificError) {
7979
$result .= $this->createTeamcityLine('inspection', [
80-
'typeId' => 'phpstan',
80+
'typeId' => 'cli-tools',
8181
'message' => $notFileSpecificError,
8282
// the file is required
8383
'file' => $analysisResult->getProjectConfigFile() !== null ? $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile()) : '.',
@@ -87,7 +87,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
8787

8888
foreach ($warnings as $warning) {
8989
$result .= $this->createTeamcityLine('inspection', [
90-
'typeId' => 'phpstan',
90+
'typeId' => 'cli-tools',
9191
'message' => $warning,
9292
// the file is required
9393
'file' => $analysisResult->getProjectConfigFile() !== null ? $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile()) : '.',

tests/AbstractTestCase.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace CodeLts\CliTools\Tests;
6+
7+
use PHPUnit\Framework\TestCase;
8+
9+
class AbstractTestCase extends TestCase {
10+
11+
}

tests/ErrorFormatter/BaselineNeonErrorFormatterIntegrationTest.php

-101
This file was deleted.

0 commit comments

Comments
 (0)