Skip to content

Commit e10456e

Browse files
committed
refactor(badges): Reformat README badges for clarity
- Display each badge on a new line in `README.md`. - Update `TraitReadme.php` to generate badges without trailing spaces and ensure proper newline separation. - Suppress `UnusedClass` and `PossiblyUnusedReturnValue` in `psalm.xml`. - Correct indentation in `main.yml` workflow permissions.
1 parent abf61e3 commit e10456e

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
name: CI
1414
permissions:
15-
contents: read
15+
contents: read
1616

1717
on:
1818
pull_request:

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# JBZoo / Codestyle
22

3-
[![CI](https://github.com/JBZoo/Codestyle/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Codestyle/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Codestyle/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Codestyle?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Codestyle/coverage.svg)](https://shepherd.dev/github/JBZoo/Codestyle) [![Psalm Level](https://shepherd.dev/github/JBZoo/Codestyle/level.svg)](https://shepherd.dev/github/JBZoo/Codestyle) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/codestyle/badge)](https://www.codefactor.io/repository/github/jbzoo/codestyle/issues)
4-
[![Stable Version](https://poser.pugx.org/jbzoo/codestyle/version)](https://packagist.org/packages/jbzoo/codestyle/) [![Total Downloads](https://poser.pugx.org/jbzoo/codestyle/downloads)](https://packagist.org/packages/jbzoo/codestyle/stats) [![Dependents](https://poser.pugx.org/jbzoo/codestyle/dependents)](https://packagist.org/packages/jbzoo/codestyle/dependents?order_by=downloads) [![GitHub License](https://img.shields.io/github/license/jbzoo/codestyle)](https://github.com/JBZoo/Codestyle/blob/master/LICENSE)
3+
[![CI](https://github.com/JBZoo/Codestyle/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Codestyle/actions/workflows/main.yml?query=branch%3Amaster)
4+
[![Coverage Status](https://coveralls.io/repos/github/JBZoo/Codestyle/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Codestyle?branch=master)
5+
[![Psalm Coverage](https://shepherd.dev/github/JBZoo/Codestyle/coverage.svg)](https://shepherd.dev/github/JBZoo/Codestyle)
6+
[![Psalm Level](https://shepherd.dev/github/JBZoo/Codestyle/level.svg)](https://shepherd.dev/github/JBZoo/Codestyle)
7+
[![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/codestyle/badge)](https://www.codefactor.io/repository/github/jbzoo/codestyle/issues)
8+
9+
[![Stable Version](https://poser.pugx.org/jbzoo/codestyle/version)](https://packagist.org/packages/jbzoo/codestyle/)
10+
[![Total Downloads](https://poser.pugx.org/jbzoo/codestyle/downloads)](https://packagist.org/packages/jbzoo/codestyle/stats)
11+
[![Dependents](https://poser.pugx.org/jbzoo/codestyle/dependents)](https://packagist.org/packages/jbzoo/codestyle/dependents?order_by=downloads)
12+
[![GitHub License](https://img.shields.io/github/license/jbzoo/codestyle)](https://github.com/JBZoo/Codestyle/blob/master/LICENSE)
13+
514

615
Comprehensive collection of QA tools and code quality standards for PHP 8.2+ projects. Provides configurations and wrappers for PHPStan, Psalm, PHP-CS-Fixer, PHPUnit, PHPMD, Phan and other popular code analysis tools.
716

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@
2626
<PossiblyUnusedMethod errorLevel="suppress"/>
2727
<InvalidOperand errorLevel="suppress"/>
2828
<MissingOverrideAttribute errorLevel="suppress"/>
29+
<UnusedClass errorLevel="suppress"/>
30+
<PossiblyUnusedReturnValue errorLevel="suppress"/>
2931
</issueHandlers>
3032
</psalm>

src/PHPUnit/TraitReadme.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,20 @@ public function testReadmeHeader(): void
112112
/** @phpstan-ignore-next-line */
113113
$tmpBadge = $this->{$testMethod}();
114114
if ($tmpBadge !== null) {
115-
$expectedBadges[$badgeName] = "{$tmpBadge} ";
115+
$expectedBadges[$badgeName] = "{$tmpBadge}";
116116
}
117117
} else {
118118
fail("Method not found: '{$testMethod}'");
119119
}
120120
}
121121
}
122122

123-
$expectedBadgeLine = \str_replace(" \n", "\n", \implode("\n", [
123+
$expectedBadgeLine = \implode("\n", [
124124
$this->getTitle(),
125125
'',
126-
\trim(\implode('', \array_filter($expectedBadges))),
126+
\trim(\implode("\n", \array_filter($expectedBadges))),
127127
'',
128-
'',
129-
]));
128+
]);
130129

131130
isFileContains($expectedBadgeLine, PROJECT_ROOT . '/README.md');
132131
}

0 commit comments

Comments
 (0)