From 529b6ed70531bb43deaa0d095ae5bf46c8ec02ec Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Sat, 18 Oct 2025 14:26:11 +0200 Subject: [PATCH 1/6] Remove Travis CI config Travis hasn't run for 3y according to: https://app.travis-ci.com/github/nemiah/phpFinTS?serverType=git --- .travis.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1db343e2..00000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: php -install: composer install -script: - - ./disallowtabs.sh - - ./csfixer-check.sh - - ./phplint.sh ./lib/ - - ./vendor/bin/phpunit -dist: bionic -php: - - '8.0' - - '8.1.0' - - '8.2.0' From 5cce89b324e9ad9459d1e52cfd673080376e04da Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Sat, 18 Oct 2025 14:26:36 +0200 Subject: [PATCH 2/6] Add PHP CS Fixer as a GitHub Action --- .github/workflows/tests.yml | 17 ++++++++++++++++- csfixer-check.sh | 36 ------------------------------------ 2 files changed, 16 insertions(+), 37 deletions(-) delete mode 100755 csfixer-check.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 182c67c7..a4595b4c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -31,3 +31,18 @@ jobs: - name: Run PHPUnit run: ./vendor/bin/phpunit + + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/cache@v4 + with: + path: .php-cs-fixer.cache + key: ${{ runner.OS }}-${{ github.repository }}-phpcsfixer-${{ github.sha }} + restore-keys: | + ${{ runner.OS }}-${{ github.repository }}-phpcsfixer- + + - name: PHP-CS-Fixer + uses: docker://oskarstark/php-cs-fixer-ga diff --git a/csfixer-check.sh b/csfixer-check.sh deleted file mode 100755 index 9c76ae32..00000000 --- a/csfixer-check.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# When this is run as part of a Travis test for a pull request, then it ensures that none of the touched files has any -# PHP CS Fixer warnings. -# From: https://github.com/FriendsOfPHP/PHP-CS-Fixer#using-php-cs-fixer-on-ci - -if [ -z "$TRAVIS_COMMIT_RANGE" ] -then -# TRAVIS_COMMIT_RANGE "is empty for builds triggered by the initial commit of a new branch" -# From: https://docs.travis-ci.com/user/environment-variables/ - echo "Variable TRAVIS_COMMIT_RANGE not set, falling back to full git diff" - TRAVIS_COMMIT_RANGE=. -fi - -IFS=' -' -CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "$TRAVIS_COMMIT_RANGE") -if [ "$?" -ne "0" ] -then - echo "Error: git diff response code > 0, aborting" - exit 1 -fi - -if [ -z "${CHANGED_FILES}" ] -then - echo "0 changed files found, exiting" - exit 0 -fi - -# February 2022: PHP CS FIXER is currently not PHP 8.1 compatible: -# "you may experience code modified in a wrong way" -# "To ignore this requirement please set `PHP_CS_FIXER_IGNORE_ENV`." -export PHP_CS_FIXER_IGNORE_ENV="1" - -if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi -vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS} || (echo "php-cs-fixer failed" && exit 1) \ No newline at end of file From 9ff9f97132b20c811799aff9b0acf7316d432b09 Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Sat, 18 Oct 2025 14:38:31 +0200 Subject: [PATCH 3/6] Remove disallowtabs.sh It's not necessary anymore because PHP CS Fixer's `indentation_type` check covers this. --- disallowtabs.sh | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100755 disallowtabs.sh diff --git a/disallowtabs.sh b/disallowtabs.sh deleted file mode 100755 index 3d91702f..00000000 --- a/disallowtabs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -# When this is run as part of a Travis test for a pull request, then it ensures that none of the added lines (compared -# to the base branch of the pull request) use tabs for indentations. -# Adapted from https://github.com/mrc/git-hook-library/blob/master/pre-commit.no-tabs - -# Abort if any of the inner commands (particularly the git commands) fails. -set -e -set -o pipefail - -if [ -z ${TRAVIS_PULL_REQUEST} ]; then - echo "Expected environment variable TRAVIS_PULL_REQUEST" - exit 2 -elif [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then - echo "Not a Travis pull request, skipping." - exit 0 -fi - -# Make sure that we have a local copy of the relevant commits (otherwise git diff won't work). -git remote set-branches --add origin ${TRAVIS_BRNACH} -git fetch - -# Compute the diff from the PR's target branch to its HEAD commit. -target_branch="origin/${TRAVIS_BRANCH}" -the_diff=$(git diff "${target_branch}...HEAD") - -# Make sure that there are no tabs in the indentation part of added lines. -if echo "${the_diff}" | egrep '^\+\s* ' >/dev/null; then - echo -e "\e[31mError: The changes contain a tab for indentation\e[0m, which is against this repo's policy." - echo "Target branch: origin/${TRAVIS_BRANCH}" - echo "Commit range: ${TRAVIS_COMMIT_RANGE}" - echo "The following tabs were detected:" - echo "${the_diff}" | egrep '^(\+\s* |\+\+\+|@@)' - exit 1 -else - echo "No new tabs detected." -fi From a1806ce160a4b779d5090419ba252581c5767031 Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Sat, 18 Oct 2025 14:39:05 +0200 Subject: [PATCH 4/6] Replace Travis status badge with the one from GitHub Actions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c14ea9d6..84c3e1dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHP FinTS/HBCI library -[![Build Status](https://travis-ci.org/nemiah/phpFinTS.svg?branch=master)](https://travis-ci.org/nemiah/phpFinTS) +[![CI status](https://github.com/nemiah/phpFinTS/actions/workflows/tests.yml/badge.svg)](https://github.com/nemiah/phpFinTS/actions/workflows/tests.yml) A PHP library implementing the following functions of the FinTS/HBCI protocol: From 95d871ab09a20777d7863b9f068b309fc5d9cfdf Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Sun, 19 Oct 2025 17:49:54 +0200 Subject: [PATCH 5/6] Fix a minor PHP CS Fixer warning in SendSEPADirectDebit.php It's the last remaining warning across the code base. --- lib/Fhp/Action/SendSEPADirectDebit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Fhp/Action/SendSEPADirectDebit.php b/lib/Fhp/Action/SendSEPADirectDebit.php index 94630204..0976ed4f 100644 --- a/lib/Fhp/Action/SendSEPADirectDebit.php +++ b/lib/Fhp/Action/SendSEPADirectDebit.php @@ -11,8 +11,10 @@ use Fhp\Segment\Common\Kti; use Fhp\Segment\DME\HIDMESv1; use Fhp\Segment\DME\HIDMESv2; +use Fhp\Segment\DME\HKDMEv2; use Fhp\Segment\DSE\HIDSESv2; use Fhp\Segment\DSE\HIDXES; +use Fhp\Segment\DSE\HKDSEv2; use Fhp\Segment\SPA\HISPAS; use Fhp\Syntax\Bin; use Fhp\UnsupportedException; @@ -159,7 +161,7 @@ protected function createRequest(BPD $bpd, ?UPD $upd) . implode(', ', $supportedPainNamespaces)); } - /** @var mixed $hkdxe */ // TODO Put a new interface type here. + /** @var HKDMEv2|HKDSEv2|HIDXES $hkdxe */ $hkdxe = $hidxes->createRequestSegment(); $hkdxe->kontoverbindungInternational = Kti::fromAccount($this->account); $hkdxe->sepaDescriptor = $this->painNamespace; From 1f2e70d3b2836f942060f3abe51ce96633ad13ea Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Sat, 18 Oct 2025 21:53:14 +0200 Subject: [PATCH 6/6] Add -v --diff --dry-run to docker://oskarstark/php-cs-fixer-ga command https://github.com/OskarStark/php-cs-fixer-ga/issues/113 Now it matches the flags of our `composer cs` command. --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a4595b4c..228d6d56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,3 +46,5 @@ jobs: - name: PHP-CS-Fixer uses: docker://oskarstark/php-cs-fixer-ga + with: + args: -v --diff --dry-run