Skip to content

Commit 079f425

Browse files
Merge pull request SimpleMachines#9110 from Sesquipedalian/3.0/contint-php-cs-fixer
Fixes PHP-CS-Fixer workflow
2 parents 88be442 + 1011d89 commit 079f425

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
name: PHP-CS-Fixer
2+
13
on:
24
push:
35
branches:
46
- release-3.0
57
pull_request:
68

7-
name: PHP Check
89
jobs:
910
php-cs-fixer:
1011
name: PHP-CS-Fixer
@@ -14,18 +15,12 @@ jobs:
1415

1516
- name: Get changed files
1617
id: changed-files
17-
run: |
18-
if ${{ github.event_name == 'pull_request' }}; then
19-
echo "all_changed_files_count=$(git diff HEAD --name-only | xargs | grep '\.php$')" >> $GITHUB_OUTPUT
20-
else
21-
echo "all_changed_files_count=$(git diff ${{ github.event.before }}...${{ github.event.after }} --name-only | xargs | grep '\.php$')" >> $GITHUB_OUTPUT
22-
fi
18+
uses: tj-actions/changed-files@v38
2319

2420
- name: Get extra arguments for PHP-CS-Fixer
2521
id: phpcs-intersection
2622
run: |
27-
CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files_count }}" | tr ' ' '\n')
28-
if echo "${CHANGED_FILES}" eq "1"; then CHANGED_FILES=""; fi
23+
CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n')
2924
if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
3025
echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV
3126
echo "$EXTRA_ARGS" >> $GITHUB_ENV
@@ -34,4 +29,4 @@ jobs:
3429
- name: PHP-CS-Fixer
3530
uses: docker://oskarstark/php-cs-fixer-ga
3631
with:
37-
args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no --allow-risky=yes ${{ env.PHPCS_EXTRA_ARGS }}
32+
args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no --quiet --allow-risky=yes ${{ env.PHPCS_EXTRA_ARGS }}

Sources/Actions/Admin/Smileys.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,7 @@ protected function import(string $smileyPath, bool $create = false): void
24532453

24542454
// Remove anything that isn't actually new from our list of files
24552455
foreach ($to_unset as $key => $ids) {
2456-
if (array_reduce($ids, function ($carry, $item) { return $carry * $item; }, true) == true) {
2456+
if (array_reduce($ids, fn($carry, $item) => $carry * $item, true) == true) {
24572457
unset($smiley_files[$key]);
24582458
}
24592459
}

Sources/PackageManager/PackageManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3456,7 +3456,7 @@ protected function __construct()
34563456
$_REQUEST['sa'] = 'servers';
34573457
}
34583458

3459-
$temp = array_map(function ($sa) {return $this->subactions[$sa];}, $this->packageget_subactions);
3459+
$temp = array_map(fn($sa) => $this->subactions[$sa], $this->packageget_subactions);
34603460

34613461
// MOD AUTHORS: integrate_package_get is deprecated. Use integrate_manage_packages instead.
34623462
if (!empty(Config::$backward_compatibility)) {

Sources/Parsers/BBCodeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ protected function closeTags(): void
16921692
$look_for = strtolower(substr($this->message, $this->pos + 2, $pos2 - $this->pos - 2));
16931693

16941694
// A closing tag that doesn't match any open tags? Skip it.
1695-
if (!\in_array($look_for, array_map(function ($bbc) { return $bbc->tag; }, $this->open_bbc))) {
1695+
if (!\in_array($look_for, array_map(fn($bbc) => $bbc->tag, $this->open_bbc))) {
16961696
return;
16971697
}
16981698

0 commit comments

Comments
 (0)