Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Command/ErrorFormatter/CheckstyleErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PHPStan\File\RelativePathHelper;
use function count;
use function htmlspecialchars;
use function PHPStan\debugScope;
use function sprintf;
use const ENT_COMPAT;
use const ENT_XML1;
Expand Down Expand Up @@ -116,12 +117,28 @@
}
$relativeFilePath = $this->relativePathHelper->getRelativePath(
$absolutePath,
);

Check failure on line 120 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 120 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

$files[$relativeFilePath][] = $fileSpecificError;

Check failure on line 122 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 122 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.
}

Check failure on line 123 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

No error with identifier variable.undefined is reported on line 123. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 123 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

No error with identifier variable.undefined is reported on line 123. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

return $files;
}

Check failure on line 126 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 126 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

/** @param 1 $i */
public function demoErrorAnnotations(int $i): array

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip is transitively unused

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Check failure on line 129 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoErrorAnnotations() return type has no value type specified in iterable type array. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 missingType.iterableValue: https://phpstan.org/error-identifiers/missingType.iterableValue 💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
{
if ($i === 1) {

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.

Check failure on line 131 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Strict comparison using === between 1 and 1 will always evaluate to true. 🪪 identical.alwaysTrue: https://phpstan.org/error-identifiers/identical.alwaysTrue 💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.dist.
echo 1; // @phpstan-ignore variable.undefined

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)

Check failure on line 132 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

No error with identifier variable.undefined is reported on line 132. 🔧 Can be fixed automatically. Run PHPStan again with --fix. 🪪 ignore.unmatchedIdentifier: https://phpstan.org/error-identifiers/ignore.unmatchedIdentifier (non-ignorable)
}

debugScope();

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)

Check failure on line 135 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

__phpstanPropertyInitialization(relativePathHelper) (Yes): mixed $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) $i (Yes): 1 __phpstanParameterVariableOriginalValue(i) (Yes): 1 native __phpstanPropertyInitialization(relativePathHelper) (Yes): mixed native $this (Yes): $this(PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter) native $i (Yes): 1 native __phpstanParameterVariableOriginalValue(i) (Yes): int 🪪 phpstan.debugScope: https://phpstan.org/error-identifiers/phpstan.debugScope (non-ignorable)
return [$this->demoWithoutTip()];
}

private function demoWithoutTip(): int
{
return 'not an int';

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type

Check failure on line 141 in src/Command/ErrorFormatter/CheckstyleErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Method PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter::demoWithoutTip() should return int but returns string. 🪪 return.type: https://phpstan.org/error-identifiers/return.type
}

}
49 changes: 48 additions & 1 deletion src/Command/ErrorFormatter/GithubErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

namespace PHPStan\Command\ErrorFormatter;

use PHPStan\Analyser\Error;
use PHPStan\Command\AnalysisResult;
use PHPStan\Command\Output;
use PHPStan\DependencyInjection\AutowiredParameter;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\File\RelativePathHelper;
use Symfony\Component\Console\Formatter\OutputFormatter;
use function array_walk;
use function explode;
use function implode;
use function ltrim;
use function preg_replace;
use function sprintf;
use function str_contains;
use function str_replace;

/**
Expand All @@ -30,6 +35,13 @@ public function __construct(

public function formatErrors(AnalysisResult $analysisResult, Output $output): int
{
$projectConfigFile = 'phpstan.neon';
if ($analysisResult->getProjectConfigFile() !== null) {
$projectConfigFile = $this->relativePathHelper->getRelativePath($analysisResult->getProjectConfigFile());
}

$tipFormatter = new OutputFormatter(false);

foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) {
$metas = [
'file' => $this->relativePathHelper->getRelativePath($fileSpecificError->getFile()),
Expand All @@ -40,7 +52,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
$value = sprintf('%s=%s', $key, (string) $value);
});

$message = $fileSpecificError->getMessage();
$message = $this->buildFileSpecificMessage($fileSpecificError, $tipFormatter, $projectConfigFile);
$message = $this->formatMessage($message);

$line = sprintf('::error %s::%s', implode(',', $metas), $message);
Expand Down Expand Up @@ -71,6 +83,41 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
return $analysisResult->hasErrors() ? 1 : 0;
}

/**
* Mimics the TableErrorFormatter's layout: the message is followed by
* the fixable marker, the identifier and the tip on separate lines.
*/
private function buildFileSpecificMessage(Error $error, OutputFormatter $tipFormatter, string $projectConfigFile): string
{
$message = $error->getMessage();
if ($error->getFixedErrorDiffs() !== []) {
$message .= "\n🔧 Can be fixed automatically. Run PHPStan again with --fix.";
}

$identifier = $error->getIdentifier();
if ($identifier !== null) {
$message .= sprintf("\n🪪 %s: https://phpstan.org/error-identifiers/%s", $identifier, $identifier);
if (!$error->canBeIgnored()) {
$message .= ' (non-ignorable)';
}
}

$tip = $error->getTip();
if ($tip !== null) {
$tip = str_replace('%configurationFile%', $projectConfigFile, $tip);
$tip = $tipFormatter->format(ConsoleTagEscaper::escape($tip)) ?? $tip;
if (str_contains($tip, "\n")) {
foreach (explode("\n", $tip) as $tipLine) {
$message .= "\n💡 " . ltrim($tipLine, ' •');
}
} else {
$message .= "\n💡 " . $tip;
}
}

return $message;
}

private function formatMessage(string $message): string
{
// newlines need to be encoded
Expand Down
17 changes: 17 additions & 0 deletions src/Command/ErrorFormatter/RawErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace PHPStan\Command\ErrorFormatter;

use Exception;
use PHPStan\Command\AnalysisResult;
use PHPStan\Command\Output;
use PHPStan\DependencyInjection\AutowiredService;
Expand Down Expand Up @@ -45,8 +46,24 @@
$output->writeRaw(sprintf('?:?:%s', $warning));
$output->writeLineFormatted('');
}

Check failure on line 49 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception might not have property $foo. 💡 Exception might not have property $bar.

Check failure on line 49 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception might not have property $foo. 💡 Exception might not have property $bar.
return $analysisResult->hasErrors() ? 1 : 0;
}

Check failure on line 51 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 51 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

public function demoErrorAnnotations(): void

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused

Check failure on line 53 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

Unused PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoErrorAnnotations 🪪 shipmonk.deadMethod: https://phpstan.org/error-identifiers/shipmonk.deadMethod 💡 Thus PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape is transitively unused
{
$this->demoObjectShape(new Exception());

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception might not have property $foo. 💡 Exception might not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception might not have property $foo. 💡 Exception might not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception might not have property $foo. 💡 Exception might not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception does not have property $foo. 💡 Exception does not have property $bar.

Check failure on line 55 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Parameter #1 $o of method PHPStan\Command\ErrorFormatter\RawErrorFormatter::demoObjectShape() expects object{foo: int, bar: string}, Exception given. 🪪 argument.type: https://phpstan.org/error-identifiers/argument.type 💡 Exception might not have property $foo. 💡 Exception might not have property $bar.
$rocket = '🚀 launch 😃';
if ($rocket === '🐢 slow') {

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.6, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.5, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.3, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.6, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.2, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (ubuntu-latest, 8.4, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.6, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (macos-latest, 8.5, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / Run with Turbo Extension (windows-latest, 8.2, nts, make phpstan)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse

Check failure on line 57 in src/Command/ErrorFormatter/RawErrorFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Strict comparison using === between '🚀 launch 😃' and '🐢 slow' will always evaluate to false. 🪪 identical.alwaysFalse: https://phpstan.org/error-identifiers/identical.alwaysFalse
return;
}
}

/**
* @param object{foo: int, bar: string} $o
*/
private function demoObjectShape(object $o): void
{
}

}
34 changes: 32 additions & 2 deletions tests/PHPStan/Command/ErrorFormatter/GithubErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace PHPStan\Command\ErrorFormatter;

use PHPStan\Analyser\Error;
use PHPStan\Analyser\FixedErrorDiff;
use PHPStan\Command\AnalysisResult;
use PHPStan\File\FuzzyRelativePathHelper;
use PHPStan\File\NullRelativePathHelper;
use PHPStan\Testing\ErrorFormatterTestCase;
Expand Down Expand Up @@ -47,7 +50,7 @@ public static function dataFormatterOutputProvider(): iterable
'::error file=folder with unicode 😃/file name with "spaces" and unicode 😃.php,line=2,col=0::Bar%0ABar2
::error file=folder with unicode 😃/file name with "spaces" and unicode 😃.php,line=4,col=0::Foo
::error file=foo.php,line=1,col=0::Foo<Bar>
::error file=foo.php,line=5,col=0::Bar%0ABar2
::error file=foo.php,line=5,col=0::Bar%0ABar2%0A💡 a tip
',
];

Expand All @@ -69,7 +72,7 @@ public static function dataFormatterOutputProvider(): iterable
'::error file=folder with unicode 😃/file name with "spaces" and unicode 😃.php,line=2,col=0::Bar%0ABar2
::error file=folder with unicode 😃/file name with "spaces" and unicode 😃.php,line=4,col=0::Foo
::error file=foo.php,line=1,col=0::Foo<Bar>
::error file=foo.php,line=5,col=0::Bar%0ABar2
::error file=foo.php,line=5,col=0::Bar%0ABar2%0A💡 a tip
::error ::first generic error
::error ::second generic<error>
',
Expand Down Expand Up @@ -110,4 +113,31 @@ public function testFormatErrors(
$this->assertSame($expected, $this->getOutputContent(), sprintf('%s: output do not match', $message));
}

public function testFormatErrorsLikeTable(): void
{
$relativePathHelper = new FuzzyRelativePathHelper(new NullRelativePathHelper(), self::DIRECTORY_PATH, [], '/');
$formatter = new GithubErrorFormatter($relativePathHelper);

$errors = [
new Error('Fixable error', self::DIRECTORY_PATH . '/foo.php', 1, identifier: 'foo.bar', fixedErrorDiffs: [new FixedErrorDiff('foo.php', 'hash', 'diff')]),
new Error('Non-ignorable error', self::DIRECTORY_PATH . '/foo.php', 2, canBeIgnored: false, identifier: 'foo.baz'),
new Error('Multi-line tip', self::DIRECTORY_PATH . '/foo.php', 3, tip: "• First line\n• Second <fg=cyan>line</> in %configurationFile%"),
new Error('Tip with type', self::DIRECTORY_PATH . '/foo.php', 4, tip: 'Use array<int, string> instead.'),
];

$this->assertSame(1, $formatter->formatErrors(
new AnalysisResult($errors, [], [], [], [], false, self::DIRECTORY_PATH . '/phpstan.neon', true, 0, false, []),
$this->getOutput(),
));

$this->assertSame(
'::error file=foo.php,line=1,col=0::Fixable error%0A🔧 Can be fixed automatically. Run PHPStan again with --fix.%0A🪪 foo.bar: https://phpstan.org/error-identifiers/foo.bar
::error file=foo.php,line=2,col=0::Non-ignorable error%0A🪪 foo.baz: https://phpstan.org/error-identifiers/foo.baz (non-ignorable)
::error file=foo.php,line=3,col=0::Multi-line tip%0A💡 First line%0A💡 Second line in phpstan.neon
::error file=foo.php,line=4,col=0::Tip with type%0A💡 Use array<int, string> instead.
',
$this->getOutputContent(),
);
}

}
Loading