From 367c32118e5e862990410a15aa5a68e9ac37eb0a Mon Sep 17 00:00:00 2001 From: Jozsef Damokos Date: Wed, 9 Sep 2026 23:43:22 +0300 Subject: [PATCH] test: probe the Codecov setup with uncovered source Adds one class with about twenty uncovered lines and no test, so the upload carries a patch whose coverage is 0%. Do not merge. --- src/CoverageProbe.php | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/CoverageProbe.php diff --git a/src/CoverageProbe.php b/src/CoverageProbe.php new file mode 100644 index 0000000..c3e31d5 --- /dev/null +++ b/src/CoverageProbe.php @@ -0,0 +1,64 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Swag\MigrationMagento; + +use Shopware\Core\Framework\Log\Package; + +/** + * @internal Probe for the Codecov setup — DO NOT MERGE. + */ +#[Package('fundamentals@after-sales')] +class CoverageProbe +{ + public function classify(int $value): string + { + if ($value < 0) { + return 'negative'; + } + + if ($value === 0) { + return 'zero'; + } + + if ($value < 10) { + return 'small'; + } + + if ($value < 100) { + return 'medium'; + } + + return 'large'; + } + + /** + * @param list $values + * + * @return list + */ + public function classifyAll(array $values): array + { + $result = []; + foreach ($values as $value) { + $result[] = $this->classify($value); + } + + return $result; + } + + public function describe(int $value): string + { + $label = $this->classify($value); + + if ($label === 'zero') { + return 'the value is zero'; + } + + return \sprintf('the value is %s (%d)', $label, $value); + } +}