### Install CI-Report-Converter using Docker
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
Pulls the latest Docker image for CI-Report-Converter and runs the help command. This is a convenient way to use the tool without local installation.
```shell
docker run --rm jbzoo/ci-report-converter --help
```
--------------------------------
### Install CI-Report-Converter using Composer
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
Installs the CI-Report-Converter package and its dependencies using Composer. After installation, the tool can be accessed via the vendor bin directory.
```shell
composer require jbzoo/ci-report-converter
php ./vendor/bin/ci-report-converter --help
```
--------------------------------
### Install CI-Report-Converter using PHAR
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
Downloads the latest PHAR release of CI-Report-Converter, makes it executable, and demonstrates how to run the help command. This method provides a standalone executable.
```shell
wget https://github.com/JBZoo/CI-Report-Converter/releases/latest/download/ci-report-converter.phar
chmod +x ./ci-report-converter.phar
./ci-report-converter.phar --help
```
--------------------------------
### Testing Commands for CI-Report-Converter
Source: https://github.com/jbzoo/ci-report-converter/blob/master/CLAUDE.md
Commands for running PHPUnit tests with different configurations and for executing example tests to generate fixtures. This helps ensure the library's functionality and correctness.
```bash
php ./vendor/bin/phpunit
php ./vendor/bin/phpunit --configuration ./phpunit.xml.dist
make test-example
```
--------------------------------
### Essential Development Commands for CI-Report-Converter
Source: https://github.com/jbzoo/ci-report-converter/blob/master/CLAUDE.md
These commands are essential for building, testing, and maintaining the CI-Report-Converter project. They cover dependency installation, Phar file creation, and code style checks.
```makefile
make build
make test
make test-all
make codestyle
```
--------------------------------
### Build Commands for CI-Report-Converter
Source: https://github.com/jbzoo/ci-report-converter/blob/master/CLAUDE.md
Commands used to build the project artifacts, including standalone Phar executables, Docker images, and development symlinks. These are crucial for deployment and local development setups.
```makefile
make build-phar
make build-docker
make create-symlink
```
--------------------------------
### Undeclared Static Method in PHPUnit Tests
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This snippet addresses issues related to static calls to undeclared methods within the JBZoo PHPUnit test suite. It specifically targets the `setUp` method, indicating potential problems with test setup or base class implementations. These issues are critical as they can lead to runtime errors, especially in PHP 8.0+.
```php
vendor/jbzoo/phpunit/src/AbstractCodestyleTest.php:66: PhanUndeclaredStaticMethod Static call to undeclared method \JBZoo\PHPUnit\PHPUnit::setUp
vendor/jbzoo/phpunit/src/AbstractCopyrightTest.php:268: PhanUndeclaredStaticMethod Static call to undeclared method \JBZoo\PHPUnit\PHPUnit::setUp
```
--------------------------------
### Log TeamCity Test Started Event
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/test-cases/ConverterTeamCityTest/testJUnit.txt
This snippet shows how to log a 'testStarted' event from TeamCity. It records the start of a test, including its name and location hint. This is essential for tracking the beginning of test executions.
```text
##teamcity[testStarted name='testCompareArrays' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testCompareArrays' flowId='159753']
```
--------------------------------
### TeamCity Service Messages for Metrics
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
Examples of how to report various code metrics to TeamCity using service messages. This allows for visualization and tracking of code quality metrics directly within the TeamCity dashboard.
```bash
# Example for JUnit.xml metrics
# Assume 'teamcity:stats' is a command or script that processes the file and outputs TeamCity service messages.
# Example command might look like: ci-report-converter --input tests/fixtures/origin/phpunit/junit-nested.xml --output teamcity:stats
```
```bash
# Example for PHPUnitClover.xml metrics
# ci-report-converter --input tests/fixtures/origin/phpunit/clover.xml --output teamcity:stats
```
```bash
# Example for PHPDepend.xml metrics
# ci-report-converter --input tests/fixtures/origin/pdepend/pdepend-old.xml --output teamcity:stats
```
```bash
# Example for PHPloc.json metrics
# ci-report-converter --input tests/fixtures/origin/phploc/json.json --output teamcity:stats
```
```bash
# Example for PHPMetrics.xml metrics
# ci-report-converter --input tests/fixtures/origin/phpmetrics/phpmetrics.xml --output teamcity:stats
```
--------------------------------
### GitHub Action Workflow for Linting and Conversion
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
A GitHub Actions workflow to set up PHP, install dependencies, run PHP Code Sniffer, and convert the resulting checkstyle report to GitHub Annotations format using the CI-Report-Converter action. This workflow is triggered on pull requests.
```yaml
name: Linters
on:
pull_request:
branches:
- "*"
jobs:
linters:
name: PHPcs
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer
- name: Install Dependencies
run: composer install
- name: PHP Code Sniffer
run: ./vendor/bin/phpcs --report=checkstyle --standard=PSR12 -q ./src > ./build/phpcs-checkstyle.xml
- name: Converting checkstyle.xml to Github Annotations
uses: jbzoo/ci-report-converter@master
with:
input-file: build/phpcs-checkstyle.xml
```
--------------------------------
### Avoid Static Access to JBZoo Utils Xml (PHP)
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpmd/phpmd.html
This snippet highlights the use of static access to the '\JBZoo\Utils\Xml' class. Similar to other static access examples, this can impact testability. Evaluate if dependency injection or alternative approaches could improve the design.
```PHP
$node = $document->createElement($this->elementName, Xml::escape($this->description));
```
--------------------------------
### PHP: Access to Constant GET on Unknown Class JBZoo\HttpClient\Request
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpstan/table.md
This error 'Access to constant GET on an unknown class JBZoo\HttpClient\Request' in phpunit/src/functions/tools.php means the class JBZoo\HttpClient\Request is not recognized when trying to access a constant named GET. Verify the class is loaded and the constant exists.
```php
params' on '\plgSystemJBDump'. This suggests issues with Joomla environment setup or access to its constants and properties.
```php
vendor/jbzoo/jbdump/joomla/jbdump.php:48: PhanUndeclaredConstant Reference to undeclared constant \JPATH_ROOT. This will cause a thrown Error in php 8.0+. (Did you mean \PATH_ROOT)
vendor/jbzoo/jbdump/joomla/jbdump.php:48: PhanUndeclaredProperty Reference to undeclared property \plgSystemJBDump->params
```
--------------------------------
### TeamCity Test Start Reporting
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/test-cases/ConverterPmdCpdTest/testToTeamCity.txt
Signals the beginning of an individual test case within a test suite. It includes the test name, a location hint, and a flow ID.
```text
##teamcity[testStarted name='src/Helper.php:16-40 (24 lines)' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Helper.php' flowId='42']
```
--------------------------------
### PHPUnit Test Failure Assertion
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/test-cases/ConverterPlainTextTest/testJUnitNested.txt
This snippet illustrates a typical PHPUnit assertion failure for string comparison. It highlights the expected and actual values that caused the test to fail, indicating a discrepancy in the string content.
```php
Failed asserting that two strings are identical.
---
Expected
+++
Actual
@@ @@
-'132'
+'123'
```
--------------------------------
### Build and Test Project using Make Commands
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
This snippet outlines the standard development workflow for contributing to the project using Make commands. It includes steps for forking the repository, building the project, making local changes, and running tests and code style checks. These commands are essential for validating contributions before creating a pull request.
```shell
# Fork the repo and build project
make build
# Make your local changes
# Run all tests and check code style
make test
make codestyle
# Create your pull request and check all tests in CI
```
--------------------------------
### TeamCity Test Suite Start Reporting
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/test-cases/ConverterPmdCpdTest/testToTeamCity.txt
Indicates the start of a test suite in TeamCity. It includes the name of the test suite and a flow ID for correlation.
```text
##teamcity[testSuiteStarted name='PMD Copy/Paste Detector' flowId='42']
```
--------------------------------
### PHP: Incorrect Return Type in get() Method
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
The `get()` method in `JBDump` is declared to return `\JBDump` but returns `false`. This mismatch prevents static analysis from correctly inferring the return type, potentially causing type-related errors downstream.
```php
vendor/jbzoo/jbdump/class.jbdump.php:634: PhanTypeMismatchReturnProbablyReal Returning false of type false but get() is declared to return \JBDump (no real type) (the inferred real return type has nothing in common with the declared phpdoc return type)
```
--------------------------------
### Symfony Console Application Initialization Issues
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This snippet highlights issues with the initialization and usage of the Symfony Console Application. It includes calls to the constructor and methods like 'add', 'setDefaultCommand', and 'run' on an undeclared 'Symfony\Component\Console\Application' class. This indicates a potential missing dependency or incorrect usage of the Symfony Console component.
```php
vendor/jbzoo/composer-diff/composer-diff.php:41: PhanUndeclaredClassMethod Call to method __construct from undeclared class \Symfony\Component\Console\Application
vendor/jbzoo/composer-diff/composer-diff.php:42: PhanUndeclaredClassMethod Call to method add from undeclared class \Symfony\Component\Console\Application
vendor/jbzoo/composer-diff/composer-diff.php:43: PhanUndeclaredClassMethod Call to method setDefaultCommand from undeclared class \Symfony\Component\Console\Application
vendor/jbzoo/composer-diff/composer-diff.php:44: PhanUndeclaredClassMethod Call to method run from undeclared class \Symfony\Component\Console\Application
```
--------------------------------
### CI Report Conversion Command Help
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
Displays the help information for the 'convert' command in the ci-report-converter tool. It details available options for input/output formats, file paths, and various other configurations for report conversion. This command is executed using PHP and the command-line interface.
```bash
$ php ./vendor/bin/ci-report-converter convert --help
Description:
Convert one report format to another one
Usage:
convert [options]
Options:
-S, --input-format=INPUT-FORMAT Source format. Available options: checkstyle, junit, phpmd-json, phpmnd, pmd-cpd, psalm-json [default: "checkstyle"]
-I, --input-file[=INPUT-FILE] File path with the original report format. If not set or empty, then the STDIN is used.
-T, --output-format=OUTPUT-FORMAT Target format. Available options: gitlab-json, github-cli, junit, plain, tc-inspections, tc-tests [default: "tc-tests"]
-O, --output-file[=OUTPUT-FILE] File path with the result report format. If not set or empty, then the STDOUT is used.
-R, --root-path[=ROOT-PATH] If option is set, all absolute file paths will be converted to relative once. [default: "."]
-N, --suite-name=SUITE-NAME Set custom name of root group/suite (if it's possible).
-F, --tc-flow-id[=TC-FLOW-ID] Custom flowId in TeamCity output. Default value is PID of the tool.
-Q, --non-zero-code[=NON-ZERO-CODE] Will exit with the code=1, if any violations are found. [default: "no"]
--no-progress Disable progress bar animation for logs. It will be used only for text output format.
--mute-errors Mute any sort of errors. So exit code will be always "0" (if it's possible).
It has major priority then --non-zero-on-error. It's on your own risk!
--stdout-only For any errors messages application will use StdOut instead of StdErr. It's on your own risk!
--non-zero-on-error None-zero exit code on any StdErr message.
--timestamp Show timestamp at the beginning of each message.It will be used only for text output format.
--profile Display timing and memory usage information.
--output-mode=OUTPUT-MODE Output format. Available options:
text - Default text output format, userfriendly and easy to read.
cron - Shortcut for crontab. It's basically focused on human-readable logs output.
It's combination of --timestamp --profile --stdout-only --no-progress -vv.
logstash - Logstash output format, for integration with ELK stack.
[default: "text"]
--cron Alias for --output-mode=cron. Deprecated!
-h, --help Display help for the given command. When no command is given display help for the list command
--silent Do not output any message
-q, --quiet Only errors are displayed. All other output is suppressed
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```
--------------------------------
### Display Help for TeamCity Stats Command
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
This command displays detailed help information for the `teamcity:stats` command, outlining its purpose, usage, and all available options. It's useful for understanding how to configure the tool for pushing code metrics to TeamCity.
```bash
php ./vendor/bin/ci-report-converter teamcity:stats --help
```
--------------------------------
### Main CLI Executable for CI-Report-Converter
Source: https://github.com/jbzoo/ci-report-converter/blob/master/CLAUDE.md
The primary command-line interface for the CI-Report-Converter library. It can be accessed directly or via a symlink created during the build process.
```bash
./ci-report-converter
./vendor/bin/ci-report-converter
```
--------------------------------
### Handle PHP Errors and Warnings
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/test-cases/ConverterGithubTest/testGithubActionsPrinter.txt
Demonstrates how to capture and report errors and warnings in PHP files. This includes specific file, line, and column information, along with decoded messages.
```php
```
--------------------------------
### PHP: Address missing class instantiation 'JConfig'
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpstan/raw.txt
The error 'Instantiated class JConfig not found' indicates that the code is attempting to create an instance of the `JConfig` class, but this class is not available in the current scope or autoloading path. This could be due to a missing dependency, incorrect namespace usage, or a typo in the class name. Ensure that the `JConfig` class is correctly imported or autoloaded.
```php
```
--------------------------------
### Symfony Output Formatter Style Constructor Issue
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This entry points out an issue with calling the constructor of 'Symfony\Component\Console\Formatter\OutputFormatterStyle' from an undeclared class context. This suggests a problem with how the output formatter styles are being initialized or referenced.
```php
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:52: PhanUndeclaredClassMethod Call to method __construct from undeclared class \Symfony\Component\Console\Formatter\OutputFormatterStyle
```
--------------------------------
### Format Description as List using Helper::descAsList in PHP
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpmd/phpmd.html
This code snippet shows how to format a description and related details into a list format using the Helper::descAsList method. This is useful for presenting structured information, such as details from an analysis report. It depends on the Helper class.
```php
return Helper::descAsList([
'' => htmlspecialchars_decode($data->get('description')),
'Rule' => "{$data->get('ruleSet')} / {$data->get('rule')} / Priority: {$data->get('priority')}",
]);
```
```php
return Helper::descAsList([
'File Path' => $data->get('full_path'),
'Snippet' => $snippet,
]);
```
--------------------------------
### Avoid Static Access to Factory::convert in Convert.php
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpmd/phpmd.html
This snippet shows the usage of static access to `Factory::convert` within the `executeAction` method of `Convert.php`. It illustrates how to initiate the conversion process by passing source code, formats, and configuration options to the `convert` method.
```php
$targetFormat = $this->getFormat('output-format');
$result = Factory::convert($sourceCode, $sourceFormat, $targetFormat, [
'root_path' => $this->getOption('root-path'),
'suite_name' => $this->getOption('suite-name'),
```
--------------------------------
### Configure CI-Report-Converter GitHub Action
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
Configure the CI-Report-Converter GitHub Action to process input files and generate reports in different formats. It supports various input and output formats, error code handling, and path manipulation. Dependencies include the action itself. Inputs are file paths and format types, while outputs can be files or standard output.
```yaml
- uses: jbzoo/ci-report-converter@master # or see the specific version on releases page
with:
# File path with the original report format. If not set or empty, then the STDIN is used.
# Required: true
input-file: ./build/checkstyle.xml
# Source format. Available options: checkstyle, junit, phpmd-json, phpmnd, pmd-cpd, psalm-json
# Default value: checkstyle
# Required: true
input-format: checkstyle
# Will exit with the code=1, if any violations are found.
# Default value: no
non-zero-code: yes
# File path with the result report format. If not set or empty, then the STDOUT is used.
output-file: ./build/junit.xml
# Target format. Available options: gitlab-json, github-cli, junit, plain, tc-inspections, tc-tests
# Default value: github-cli
# Required: true
output-format: junit
# If option is set, all absolute file paths will be converted to relative once.
# Default value: .
root-path: ./custom/project/path
# Set custom name of root group/suite (if it's possible).
# Required: true
suite-name: My Tests
```
--------------------------------
### PHP: Reflection Error JPlugin Not Found in jbdump/joomla/jbdump.php
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpstan/table.md
A reflection error 'JPlugin not found' in jbdump/joomla/jbdump.php indicates that the JPlugin class, likely part of a Joomla framework, is not accessible during reflection. This could be due to environment setup or missing dependencies.
```php
addTestCase('Test Name');
$case->time = 0.001824;
$case->file = $filename;
$case->line = $line;
$case->class = $class;
$case->classname = $className;
$case->assertions = 5;
$case->stdOut = 'Some std output';
$case->errOut = 'Some err output';
$case->failure = new SourceCaseOutput('Failure', 'Failure Message', 'Failure Details');
$case->error = new SourceCaseOutput('Error', 'Error Message', 'Error Details');
$case->warning = new SourceCaseOutput('Warning', 'Warning Message', 'Warning Details');
$case->skipped = new SourceCaseOutput('Skipped', 'Skipped Message', 'Skipped Details');
echo (new JUnitConverter())->fromInternal($suite);
```
```xml
Failure Details
Warning Details
Error Details
Some std output
Some err output
```
--------------------------------
### Symfony Process Component Usage Issues
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This entry concerns the usage of the Symfony Process component, specifically a call to 'fromShellCommandline' on an undeclared 'Symfony\Component\Process\Process' class. It also flags the constructor of 'Symfony\Component\Process\Exception\ProcessFailedException' being called from an undeclared class.
```php
vendor/jbzoo/composer-diff/src/Comparator.php:122: PhanUndeclaredClassMethod Call to method fromShellCommandline from undeclared class \Symfony\Component\Process\Process
vendor/jbzoo/composer-diff/src/Comparator.php:129: PhanUndeclaredClassMethod Call to method __construct from undeclared class \Symfony\Component\Process\Exception\ProcessFailedException
```
--------------------------------
### TeamCity Build Statistic Value (JUnit:errors)
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/test-cases/ConverterTeamCityStatsTest/testJUnitXml.txt
Reports the number of errors encountered during JUnit test execution. Errors typically indicate problems with the test framework or environment setup rather than application logic failures.
```teamcity
##teamcity[buildStatisticValue key='Tests / Errors (JUnit:errors)' value='3' flowId='1']
```
--------------------------------
### Symfony Console Output and Input Interface Method Calls
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This snippet focuses on undeclared method calls made on Symfony Console's Output and Input interfaces. It specifically flags calls to 'getFormatter' on OutputInterface and 'getOption' on InputInterface, suggesting these methods might not be available or correctly accessed.
```php
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:48: PhanUndeclaredClassMethod Call to method getFormatter from undeclared class \Symfony\Component\Console\Output\OutputInterface
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:70: PhanUndeclaredClassMethod Call to method getOption from undeclared class \Symfony\Component\Console\Input\InputInterface
```
--------------------------------
### PHP: Create DOMDocument using static access
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpmd/phpmd.html
This snippet demonstrates the creation of a DOMDocument object using static access to the Xml class. The issue flagged is the avoidance of static access in favor of dependency injection or instance methods where appropriate. No specific input or output is detailed, but it's part of XML report generation.
```php
$document = Xml::createDomDocument();
```
--------------------------------
### PHP Argument Type Coercion Issues in JBDump
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/psalm/text.txt
This section addresses 'ArgumentTypeCoercion' errors in the JBDump class. These occur when a function or method receives an argument of a type different from what it expects. Examples include passing an array to 'set_exception_handler' instead of a callable, and passing a list type to 'min' and 'max' functions which expect a non-empty array.
```php
ArgumentTypeCoercion: Argument 1 of set_exception_handler expects callable(Throwable):void|null, parent type array{JBDump&static, "_exceptionHandler"} provided
ArgumentTypeCoercion: Argument 1 of min expects non-empty-array, parent type list provided
ArgumentTypeCoercion: Argument 1 of max expects non-empty-array, parent type list provided
```
--------------------------------
### TeamCity Test Execution Messages (PHP)
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/test-cases/ConverterTeamCityTest/testJUnit.txt
These messages represent TeamCity's service messages for tracking PHPUnit test execution. They cover the start, end, and various outcomes of individual tests, including failures, skips, and incomplete statuses. These messages are typically generated by a CI tool or test runner integrating with TeamCity.
```bash
##teamcity[testCount count='14' flowId='159753']
##teamcity[testSuiteStarted name='JBZoo\PHPUnit\ExampleTest' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest' flowId='159753']
##teamcity[testStarted name='testValid' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testValid' flowId='159753']
##teamcity[testFinished name='testValid' duration='7' flowId='159753']
##teamcity[testStarted name='testInValid' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testInValid' flowId='159753']
##teamcity[testFailed name='testInValid' message='Failed asserting that false is true.' details=' /Users/smetdenis/Work/projects/jbzoo-ci-report-converter/vendor/jbzoo/phpunit/src/functions/aliases.php:107|n /Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php:40|n ' duration='1' flowId='159753']
##teamcity[testFinished name='testInValid' duration='1' flowId='159753']
##teamcity[testStarted name='testSkipped' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testSkipped' flowId='159753']
##teamcity[testIgnored name='testSkipped' duration='0' flowId='159753']
##teamcity[testFinished name='testSkipped' duration='0' flowId='159753']
##teamcity[testStarted name='testIncomplete' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testIncomplete' flowId='159753']
##teamcity[testIgnored name='testIncomplete' duration='1' flowId='159753']
##teamcity[testFinished name='testIncomplete' duration='1' flowId='159753']
##teamcity[testStarted name='testFail' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testFail' flowId='159753']
##teamcity[testFailed name='testFail' message='Some reason to fail' details=' /Users/smetdenis/Work/projects/jbzoo-ci-report-converter/vendor/jbzoo/phpunit/src/functions/aliases.php:51|n /Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php:55|n ' duration='0' flowId='159753']
##teamcity[testFinished name='testFail' duration='0' flowId='159753']
##teamcity[testStarted name='testEcho' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testEcho' flowId='159753']
Some echo output
##teamcity[testFinished name='testEcho' duration='0' flowId='159753']
##teamcity[testStarted name='testStdOutput' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testStdOutput' flowId='159753']
##teamcity[testFinished name='testStdOutput' duration='1' flowId='159753']
##teamcity[testStarted name='testErrOutput' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testErrOutput' flowId='159753']
##teamcity[testFinished name='testErrOutput' duration='0' flowId='159753']
##teamcity[testStarted name='testNoAssert' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testNoAssert' flowId='159753']
##teamcity[testFailed name='testNoAssert' duration='0' flowId='159753']
##teamcity[testFinished name='testNoAssert' duration='0' flowId='159753']
##teamcity[testStarted name='testNotice' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testNotice' flowId='159753']
##teamcity[testFailed name='testNotice' message='Undefined variable: aaa' details=' /Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php:82|n ' duration='0' flowId='159753']
##teamcity[testFinished name='testNotice' duration='0' flowId='159753']
##teamcity[testStarted name='testWarning' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testWarning' flowId='159753']
##teamcity[testFailed name='testWarning' message='Some warning' details=' /Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php:87|n ' duration='0' flowId='159753']
##teamcity[testFinished name='testWarning' duration='0' flowId='159753']
##teamcity[testStarted name='testException' locationHint='php_qn:///Users/smetdenis/Work/projects/jbzoo-ci-report-converter/tests/ExampleTest.php::\JBZoo\PHPUnit\ExampleTest::testException' flowId='159753']
```
--------------------------------
### Symfony Console Command and Input/Output Type Declarations
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This section details problems with type declarations for classes extending Symfony Console commands and for input/output parameters. It points out undeclared extended classes, type properties for input and output interfaces, and type parameters for input and output.
```php
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:29: PhanUndeclaredExtendedClass Class extends undeclared class \Symfony\Component\Console\Command\Command
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:35: PhanUndeclaredTypeProperty Property \JBZoo\ComposerDiff\Commands\AbstractCommand->input has undeclared type \Symfony\Component\Console\Input\InputInterface
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:41: PhanUndeclaredTypeProperty Property \JBZoo\ComposerDiff\Commands\AbstractCommand->output has undeclared type \Symfony\Component\Console\Output\OutputInterface
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:46: PhanUndeclaredTypeParameter Parameter $input has undeclared type \Symfony\Component\Console\Input\InputInterface
vendor/jbzoo/composer-diff/src/Commands/AbstractCommand.php:46: PhanUndeclaredTypeParameter Parameter $output has undeclared type \Symfony\Component\Console\Output\OutputInterface
```
--------------------------------
### PHP: Correct Undeclared Method Call in ComposerGraph CommandBuild
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This identifies an `PhanUndeclaredMethod` error for calling `setName` on the `CommandBuild` class in the Composer Graph project. This implies that the `setName` method is either not defined in the class or is being called incorrectly.
```php
vendor/jbzoo/composer-graph/src/CommandBuild.php:60: PhanUndeclaredMethod Call to undeclared method \JBZoo\ComposerGraph\CommandBuild::setName
```
--------------------------------
### PHP: Handle 'No error to ignore' in CovCatcher
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phpstan/raw.txt
The messages 'No error to ignore is reported on line X' within `CovCatcher.php` suggest that the error suppression mechanism in the `CovCatcher` class might be misconfigured or not detecting expected errors. While not a runtime error, it indicates a potential issue with the code's error handling or testing setup. Review the logic that determines which errors should be ignored.
```php
shouldIgnoreError($errorLevel)) {
// // This message might be logged if no error is suppressed:
// // error_log('No error to ignore');
// return;
// }
// // Process the error...
// }
//
// private function shouldIgnoreError(int $errorLevel): bool {
// // Implementation to decide if error should be ignored.
// // If this always returns true when it shouldn't, the message appears.
// return true; // Placeholder - actual logic needed
// }
// }
?>
```
--------------------------------
### CI Report Converter Flow Diagram
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
A Mermaid diagram illustrating the data flow and supported transformations within the CI-Report-Converter. It shows input formats like CheckStyle and JUnit feeding into the converter, which then outputs to formats like GitLab JSON, JUnit XML, and TeamCity reports.
```mermaid
graph LR;
checkstyle_src("CheckStyle.xml");
ci-report-converter(("CI-Report
Converter"));
github-cli_target("GitHub Actions - CLI");
gitlab-json_target("GitLab - JSON");
junit_src("JUnit.xml");
junit_target("JUnit.xml");
phpmd-json_src("PHPmd.json");
phpmnd_src("PHPmnd.xml");
plain_target("Plain Text");
pmd-cpd_src("PmdCpd.xml");
psalm-json_src("Psalm.json");
tc-inspections_target("TeamCity - Inspections");
tc-tests_target("TeamCity - Tests");
checkstyle_src ==> ci-report-converter;
ci-report-converter ==> github-cli_target;
ci-report-converter ==> gitlab-json_target;
ci-report-converter ==> junit_target;
ci-report-converter ==> plain_target;
ci-report-converter ==> tc-inspections_target;
ci-report-converter ==> tc-tests_target;
junit_src ==> ci-report-converter;
phpmd-json_src ==> ci-report-converter;
phpmnd_src ==> ci-report-converter;
pmd-cpd_src ==> ci-report-converter;
psalm-json_src ==> ci-report-converter;
linkStyle default interpolate basis;
```
--------------------------------
### GitHub Actions (API)
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
Shows how to utilize the GithubActions format class to generate output compatible with GitHub Actions workflow commands for annotations.
```APIDOC
## GitHub Actions (API)
### Description
Use the `GithubActions` class to generate output messages that can be interpreted by GitHub Actions as annotations (errors, warnings, etc.) within your workflow runs.
### Method
N/A (SDK Usage)
### Endpoint
N/A (SDK Usage)
### Parameters
N/A (SDK Usage)
### Request Example
```php
use JBZoo\CIReportConverter\Formats\GithubActions\GithubActions;
$ghActions = new GithubActions();
$case0 = $ghActions->addCase('src/Root.php');
$case0->line = 789;
$case0->column = null;
$case0->message = 'Something went wrong #0';
$suite1 = $ghActions->addSuite('src/File.php');
$case1 = $suite1->addCase('src/Class.php');
$case1->line = 123;
$case1->column = 4;
$case1->message = 'Something went wrong #1';
echo $ghActions->__toString();
```
### Response
#### Success Response (200)
Returns a string formatted with GitHub Actions workflow commands.
#### Response Example
```
::error file=src/Root.php,line=789::Something went wrong #0
::group::src/File.php
::error file=src/Class.php,line=123,col=4::Something went wrong #1
::endgroup::
```
```
--------------------------------
### Generate GitHub Actions Report using PHP SDK
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
This snippet illustrates the use of the CI Report Converter's PHP SDK to generate reports in the GitHub Actions workflow command format. It involves creating `GithubActions` objects and adding cases with their respective file, line, column, and message details. The output is then printed, suitable for direct use in GitHub Actions.
```php
use JBZoo\CIReportConverter\Formats\GithubActions\GithubActions;
$ghActions = new GithubActions();
$case0 = $ghActions->addCase('src/Root.php');
$case0->line = 789;
$case0->column = null;
$case0->message = 'Something went wrong #0';
$suite1 = $ghActions->addSuite('src/File.php');
$case1 = $suite1->addCase('src/Class.php');
$case1->line = 123;
$case1->column = 4;
$case1->message = 'Something went wrong #1';
echo $ghActions->__toString();
```
```text
::error file=src/Root.php,line=789::Something went wrong #0
::group::src/File.php
::error file=src/Class.php,line=123,col=4::Something went wrong #1
::endgroup::
```
--------------------------------
### Convert Phan (Checkstyle) to CI Report format
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
This command runs Phan with Checkstyle output mode and pipes the results to the CI Report Converter. This integration allows CI systems to consume Phan's static analysis findings.
```shell
php ./vendor/bin/phan.phar --directory=./src --output-mode=checkstyle | ./ci-report-converter.phar
```
--------------------------------
### Undeclared Constant in Copyright Test
Source: https://github.com/jbzoo/ci-report-converter/blob/master/tests/fixtures/origin/phan/html.html
This snippet highlights a critical issue in the `AbstractCopyrightTest.php` file where a reference is made to an undeclared constant `PROJECT_ROOT`. This problem is particularly severe as it is flagged to cause a thrown `Error` in PHP 8.0 and later versions, indicating a potential break in the copyright validation logic.
```php
vendor/jbzoo/phpunit/src/AbstractCopyrightTest.php:51: PhanUndeclaredConstant Reference to undeclared constant \PROJECT_ROOT. This will cause a thrown Error in php 8.0+.
```
--------------------------------
### Configure TeamCity Stats Command Options
Source: https://github.com/jbzoo/ci-report-converter/blob/master/README.md
This section details the various options available for the `teamcity:stats` command. These options allow users to specify input/output formats and files, control TeamCity flow IDs, manage progress bars, error reporting, output modes (text, cron, logstash), and verbosity levels.
```bash
php ./vendor/bin/ci-report-converter teamcity:stats \
--input-format=junit-xml \
--input-file=report.xml \
--output-file=teamcity_output.log \
--root-path=./src \
--tc-flow-id=build-123 \
--mute-errors \
--output-mode=text \
--verbose
```