Skip to content

Commit a373ec4

Browse files
committed
Safety improvements.
1 parent bdeb636 commit a373ec4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1423
-626
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -4,90 +4,90 @@ name: CI
44

55
# Controls when the action will run.
66
on:
7-
# Triggers the workflow on push or pull request events but only for the dev branch
8-
push:
9-
branches: [ 3.x, 2.x, 1.x ]
10-
pull_request:
11-
branches: [ 3.x, 2.x, 1.x ]
12-
release:
13-
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
14-
types: [published, created, edited]
7+
# Triggers the workflow on push or pull request events but only for the dev branch
8+
push:
9+
branches: [ 3.x, 2.x, 1.x ]
10+
pull_request:
11+
branches: [ 3.x, 2.x, 1.x ]
12+
release:
13+
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
14+
types: [ published, created, edited ]
1515

16-
# Allows you to run this workflow manually from the Actions tab
17-
workflow_dispatch:
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
1818

1919
# Set minimal permissions needed for Composer + GitHub Packages
2020
permissions:
21-
contents: read
21+
contents: read
2222

2323
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2424
jobs:
25-
# Analyse code by PHPStan
26-
phpstan:
27-
name: PHPStan
28-
runs-on: ubuntu-latest
29-
# This workflow is only of value to the ebics-api/ebics-client-php repository and
30-
# would always fail in forks
31-
if: github.repository == 'ebics-api/ebics-client-php'
32-
steps:
33-
- name: Checkout PR code
34-
uses: actions/checkout@v3
35-
with:
36-
ref: ${{ github.event.pull_request.head.ref }}
37-
repository: ${{ github.event.pull_request.head.repo.full_name }}
38-
- name: Setup PHP
39-
uses: shivammathur/setup-php@v2
40-
with:
41-
php-version: '8.1'
42-
- name: Composer Install
43-
run: composer install --no-scripts --no-progress --ansi
44-
- name: Run phpstan
45-
run: composer code-analyse
25+
# Analyse code by PHPStan
26+
phpstan:
27+
name: PHPStan
28+
runs-on: ubuntu-latest
29+
# This workflow is only of value to the ebics-api/ebics-client-php repository and
30+
# would always fail in forks
31+
if: github.repository == 'ebics-api/ebics-client-php'
32+
steps:
33+
- name: Checkout PR code
34+
uses: actions/checkout@v3
35+
with:
36+
ref: ${{ github.event.pull_request.head.ref }}
37+
repository: ${{ github.event.pull_request.head.repo.full_name }}
38+
- name: Setup PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: '8.5'
42+
- name: Composer Install
43+
run: composer install --no-scripts --no-progress --ansi
44+
- name: Run phpstan
45+
run: composer code-analyse
4646

47-
# Style code by Code Sniffer
48-
phpcs:
49-
name: PHPCS
50-
runs-on: ubuntu-latest
51-
# This workflow is only of value to the ebics-api/ebics-client-php repository and
52-
# would always fail in forks
53-
if: github.repository == 'ebics-api/ebics-client-php'
54-
steps:
55-
- name: Checkout PR code
56-
uses: actions/checkout@v3
57-
with:
58-
ref: ${{ github.event.pull_request.head.ref }}
59-
repository: ${{ github.event.pull_request.head.repo.full_name }}
60-
- name: Setup PHP
61-
uses: shivammathur/setup-php@v2
62-
with:
63-
php-version: '8.1'
64-
- name: Composer Install
65-
run: composer install --no-scripts --no-progress --ansi
66-
- name: Run phpcs
67-
run: composer code-style
47+
# Style code by Code Sniffer
48+
phpcs:
49+
name: PHPCS
50+
runs-on: ubuntu-latest
51+
# This workflow is only of value to the ebics-api/ebics-client-php repository and
52+
# would always fail in forks
53+
if: github.repository == 'ebics-api/ebics-client-php'
54+
steps:
55+
- name: Checkout PR code
56+
uses: actions/checkout@v3
57+
with:
58+
ref: ${{ github.event.pull_request.head.ref }}
59+
repository: ${{ github.event.pull_request.head.repo.full_name }}
60+
- name: Setup PHP
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: '8.5'
64+
- name: Composer Install
65+
run: composer install --no-scripts --no-progress --ansi
66+
- name: Run phpcs
67+
run: composer code-style
6868

69-
# Test code by PHPUnit
70-
phpunit:
71-
name: PHPUnit
72-
runs-on: ubuntu-latest
73-
# This workflow is only of value to ebics-api/ebics-client-php repository and
74-
# would always fail in forks
75-
if: github.repository == 'ebics-api/ebics-client-php'
76-
steps:
77-
- name: Checkout PR code
78-
uses: actions/checkout@v3
79-
with:
80-
ref: ${{ github.event.pull_request.head.ref }}
81-
repository: ${{ github.event.pull_request.head.repo.full_name }}
82-
- name: Setup PHP
83-
uses: shivammathur/setup-php@v2
84-
with:
85-
php-version: '8.1'
86-
- name: Composer Install
87-
run: composer install --no-scripts --no-progress --ansi
88-
- name: Prepare data
89-
run: unzip -P "$PASSWORD" ./tests/_data.zip -d .
90-
env:
91-
PASSWORD: ${{ secrets.PWD }}
92-
- name: Run phpunit
93-
run: composer code-test
69+
# Test code by PHPUnit
70+
phpunit:
71+
name: PHPUnit
72+
runs-on: ubuntu-latest
73+
# This workflow is only of value to ebics-api/ebics-client-php repository and
74+
# would always fail in forks
75+
if: github.repository == 'ebics-api/ebics-client-php'
76+
steps:
77+
- name: Checkout PR code
78+
uses: actions/checkout@v3
79+
with:
80+
ref: ${{ github.event.pull_request.head.ref }}
81+
repository: ${{ github.event.pull_request.head.repo.full_name }}
82+
- name: Setup PHP
83+
uses: shivammathur/setup-php@v2
84+
with:
85+
php-version: '8.5'
86+
- name: Composer Install
87+
run: composer install --no-scripts --no-progress --ansi
88+
- name: Prepare data
89+
run: unzip -P "$PASSWORD" ./tests/_data.zip -d .
90+
env:
91+
PASSWORD: ${{ secrets.PWD }}
92+
- name: Run phpunit
93+
run: composer code-test

.github/workflows/release.yml

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,70 +16,70 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- name: Checkout repository (with history & tags)
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
19+
- name: Checkout repository (with history & tags)
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
2323

24-
- name: Install jq
25-
run: sudo apt-get update && sudo apt-get install -y jq
24+
- name: Install jq
25+
run: sudo apt-get update && sudo apt-get install -y jq
2626

27-
- name: Get current and previous version
28-
id: versions
29-
shell: bash
30-
run: |
31-
# extract current version from composer.json
32-
CURR_VERSION=$(jq -r '.version // empty' composer.json)
33-
if [ -z "$CURR_VERSION" ] || [ "$CURR_VERSION" = "null" ]; then
34-
echo "composer.json has no .version field – aborting."
35-
exit 1
36-
fi
27+
- name: Get current and previous version
28+
id: versions
29+
shell: bash
30+
run: |
31+
# extract current version from composer.json
32+
CURR_VERSION=$(jq -r '.version // empty' composer.json)
33+
if [ -z "$CURR_VERSION" ] || [ "$CURR_VERSION" = "null" ]; then
34+
echo "composer.json has no .version field – aborting."
35+
exit 1
36+
fi
3737
38-
# get previous version from previous commit if composer.json existed there
39-
if git rev-parse HEAD~1 >/dev/null 2>&1; then
40-
if git show HEAD~1:composer.json >/dev/null 2>&1; then
41-
PREV_VERSION=$(git show HEAD~1:composer.json | jq -r '.version // empty')
38+
# get previous version from previous commit if composer.json existed there
39+
if git rev-parse HEAD~1 >/dev/null 2>&1; then
40+
if git show HEAD~1:composer.json >/dev/null 2>&1; then
41+
PREV_VERSION=$(git show HEAD~1:composer.json | jq -r '.version // empty')
42+
else
43+
PREV_VERSION=""
44+
fi
4245
else
4346
PREV_VERSION=""
4447
fi
45-
else
46-
PREV_VERSION=""
47-
fi
4848
49-
echo "curr=$CURR_VERSION" >> "$GITHUB_OUTPUT"
50-
echo "prev=$PREV_VERSION" >> "$GITHUB_OUTPUT"
49+
echo "curr=$CURR_VERSION" >> "$GITHUB_OUTPUT"
50+
echo "prev=$PREV_VERSION" >> "$GITHUB_OUTPUT"
5151
52-
- name: Continue only if version changed
53-
if: steps.versions.outputs.curr != steps.versions.outputs.prev
54-
run: |
55-
echo "Version changed: ${{ steps.versions.outputs.prev }} -> ${{ steps.versions.outputs.curr }}"
52+
- name: Continue only if version changed
53+
if: steps.versions.outputs.curr != steps.versions.outputs.prev
54+
run: |
55+
echo "Version changed: ${{ steps.versions.outputs.prev }} -> ${{ steps.versions.outputs.curr }}"
5656
57-
- name: Stop if version is unchanged
58-
if: steps.versions.outputs.curr == steps.versions.outputs.prev
59-
run: |
60-
echo "Version unchanged (${{ steps.versions.outputs.curr }}) – no tag needed."
61-
exit 0
57+
- name: Stop if version is unchanged
58+
if: steps.versions.outputs.curr == steps.versions.outputs.prev
59+
run: |
60+
echo "Version unchanged (${{ steps.versions.outputs.curr }}) – no tag needed."
61+
exit 0
6262
63-
- name: Check if tag already exists
64-
id: check_tag
65-
run: |
66-
TAG="v${{ steps.versions.outputs.curr }}"
67-
if git rev-parse "refs/tags/$TAG" >/dev/null 2>&1 || \
68-
git ls-remote --tags origin "refs/tags/$TAG" | grep -q .; then
69-
echo "exists=true" >> "$GITHUB_OUTPUT"
70-
else
71-
echo "exists=false" >> "$GITHUB_OUTPUT"
72-
fi
63+
- name: Check if tag already exists
64+
id: check_tag
65+
run: |
66+
TAG="v${{ steps.versions.outputs.curr }}"
67+
if git rev-parse "refs/tags/$TAG" >/dev/null 2>&1 || \
68+
git ls-remote --tags origin "refs/tags/$TAG" | grep -q .; then
69+
echo "exists=true" >> "$GITHUB_OUTPUT"
70+
else
71+
echo "exists=false" >> "$GITHUB_OUTPUT"
72+
fi
7373
74-
- name: Create and push tag (with v prefix)
75-
if: steps.check_tag.outputs.exists == 'false'
76-
run: |
77-
TAG="v${{ steps.versions.outputs.curr }}"
78-
git config user.name "github-actions[bot]"
79-
git config user.email "github-actions[bot]@users.noreply.github.com"
80-
git tag "$TAG"
81-
git push origin "$TAG"
74+
- name: Create and push tag (with v prefix)
75+
if: steps.check_tag.outputs.exists == 'false'
76+
run: |
77+
TAG="v${{ steps.versions.outputs.curr }}"
78+
git config user.name "github-actions[bot]"
79+
git config user.email "github-actions[bot]@users.noreply.github.com"
80+
git tag "$TAG"
81+
git push origin "$TAG"
8282
83-
- name: Info if tag already exists
84-
if: steps.check_tag.outputs.exists == 'true'
85-
run: echo "Tag v${{ steps.versions.outputs.curr }} already exists – nothing to do."
83+
- name: Info if tag already exists
84+
if: steps.check_tag.outputs.exists == 'true'
85+
run: echo "Tag v${{ steps.versions.outputs.curr }} already exists – nothing to do."

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.1
2+
3+
* Safety improvements.
4+
15
## 3.0
26

37
* Support large files upload.

README.md

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

1010
PHP library to communicate with a bank through <a href="https://en.wikipedia.org/wiki/Electronic_Banking_Internet_Communication_Standard" target="_blank">EBICS</a> protocol.
1111
PHP EBICS Client - https://ebics-api.github.io/ebics-client-php/
12-
Supported PHP versions - PHP 7.2 and higher
12+
Supported PHP versions - PHP 8.5 and higher
1313
Supported EBICS versions: 2.4, 2.5, 3.0; Encryption versions: E002, X002, A005, A006; Switching EBICS T/TS
1414

1515
# 💥 (Premium) EBICS API Client

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ebics-api/ebics-client-php",
3-
"version": "3.0.3",
3+
"version": "3.1.0",
44
"type": "library",
55
"description": "PHP library to communicate with bank through EBICS protocol.",
66
"keywords": [
@@ -22,7 +22,7 @@
2222
],
2323
"license": "MIT",
2424
"require": {
25-
"php": "^8.1",
25+
"php": "^8.5",
2626
"ext-bcmath": "*",
2727
"ext-curl": "*",
2828
"ext-dom": "*",
@@ -35,13 +35,12 @@
3535
"require-dev": {
3636
"ebics-api/cfonb-php": "^1.0",
3737
"ebics-api/mt942-php": "^1.0",
38-
"phpseclib/phpseclib": "~2.0.51",
39-
"phpstan/phpstan": "~1.9.18",
40-
"phpunit/phpunit": "~9.6.34",
38+
"phpstan/phpstan": "~2.1.42",
39+
"phpunit/phpunit": "~10.5.63",
4140
"psr/http-client": "^1.0",
4241
"psr/http-factory": "^1.1",
4342
"setasign/fpdf": "^1.8",
44-
"squizlabs/php_codesniffer": "~3.7.2"
43+
"squizlabs/php_codesniffer": "~3.13.5"
4544
},
4645
"autoload": {
4746
"psr-4": {

docker/docker-compose.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
container_name: php-cli-ebics-client-php
44
build:
55
context: php-cli
6-
image: php-cli-ebics-client-php:8.1.6-cli
6+
image: php-cli-ebics-client-php:8.5.4-cli
77
volumes:
88
- ~/.ssh:/home/root/.ssh
99
- ../:/var/www/ebics-client-php
@@ -12,18 +12,6 @@ services:
1212
tty: true
1313
extra_hosts:
1414
- "host.docker.internal:host-gateway"
15-
networks:
16-
ebics-client-php-net:
17-
ipv4_address: 172.111.0.3
15+
network_mode: "host"
1816
environment:
1917
PHP_IDE_CONFIG: "serverName=ebics-client-php"
20-
21-
networks:
22-
ebics-client-php-net:
23-
driver: bridge
24-
ipam:
25-
driver: default
26-
config:
27-
- subnet: 172.111.0.0/24
28-
driver_opts:
29-
com.docker.network.bridge.name: br_ecp

0 commit comments

Comments
 (0)