Skip to content
Merged
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
15 changes: 5 additions & 10 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: PHP-CS-Fixer

on:
push:
branches:
- release-3.0
pull_request:

name: PHP Check
jobs:
php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -14,18 +15,12 @@ jobs:

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

- name: Get extra arguments for PHP-CS-Fixer
id: phpcs-intersection
run: |
CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files_count }}" | tr ' ' '\n')
if echo "${CHANGED_FILES}" eq "1"; then CHANGED_FILES=""; fi
CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n')
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
echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV
echo "$EXTRA_ARGS" >> $GITHUB_ENV
Expand All @@ -34,4 +29,4 @@ jobs:
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no --allow-risky=yes ${{ env.PHPCS_EXTRA_ARGS }}
args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no --quiet --allow-risky=yes ${{ env.PHPCS_EXTRA_ARGS }}
2 changes: 1 addition & 1 deletion Sources/Actions/Admin/Smileys.php
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,7 @@ protected function import(string $smileyPath, bool $create = false): void

// Remove anything that isn't actually new from our list of files
foreach ($to_unset as $key => $ids) {
if (array_reduce($ids, function ($carry, $item) { return $carry * $item; }, true) == true) {
if (array_reduce($ids, fn($carry, $item) => $carry * $item, true) == true) {
unset($smiley_files[$key]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/PackageManager/PackageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3456,7 +3456,7 @@ protected function __construct()
$_REQUEST['sa'] = 'servers';
}

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

// MOD AUTHORS: integrate_package_get is deprecated. Use integrate_manage_packages instead.
if (!empty(Config::$backward_compatibility)) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Parsers/BBCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ protected function closeTags(): void
$look_for = strtolower(substr($this->message, $this->pos + 2, $pos2 - $this->pos - 2));

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

Expand Down