Skip to content

Commit 803a160

Browse files
CodeDreddGregor BeckerStyleCIBot
authored
feat!: Add larastan, update Request Response, move to only laravel 9 compatibility (#195)
* feat(laravel-soap-179)!: Add PHP 8.1 Support & Laravel 9 BREAKING CHANGE: raised php lvl min to 8.0, disabled commands (because wsdlToPhp package is not compatible with php 8), renamed functions Migration form v2 to v3: - `setHandler` renamed to `setTransport` - `getHandler` renamed to `getHandler` - `withHandlerOptions` renamed to `withGuzzleClientOptions` * refactor(laravel-soap-179): Apply review discussion - Added Flattingloader - Using SoapActionDetector - bit more code clean up to PHP 8 standard * refactor(laravel-soap-179): Update last not working middlewares * Apply fixes from StyleCI (#191) Co-authored-by: StyleCI Bot <[email protected]> * Apply fixes from StyleCI (#192) Co-authored-by: StyleCI Bot <[email protected]> * fix(laravel-soap-179): Response body not working with soap fault error * fix: update unit test workflow * fix: update test workflow & cleanUp unit test * fix!: response & request BREAKING CHANGE: Remove laravel 8 support so it aligns with laravel versioning * feat: Add larastan & PHP CS Fixer workflow * chore: fix workflow * chore: PhpStan Lvl 3 * chore: add phpstan workflow * chore: update test workflow * chore: update composer version workflows * chore: use evaluate to find soapfault string * Fix styling * Fix styling * Apply fixes from StyleCI (#196) Co-authored-by: StyleCI Bot <[email protected]> * Fix styling Co-authored-by: Gregor Becker <[email protected]> Co-authored-by: StyleCI Bot <[email protected]> Co-authored-by: CodeDredd <[email protected]>
1 parent 217a3b1 commit 803a160

32 files changed

+1382
-1688
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
ref: ${{ github.head_ref }}
14+
15+
- name: Run PHP CS Fixer
16+
uses: docker://oskarstark/php-cs-fixer-ga
17+
with:
18+
args: --config=.php_cs.dist.php --allow-risky=yes
19+
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: Fix styling

.github/workflows/phpstan.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon'
8+
9+
jobs:
10+
phpstan:
11+
name: phpstan
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.1'
20+
coverage: none
21+
22+
- name: Install composer dependencies
23+
uses: ramsey/composer-install@v2
24+
25+
- name: Run PHPStan
26+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/tests.yml

Lines changed: 72 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,81 @@
1-
name: test
1+
name: Unit Tests
22

3-
on: push
3+
on:
4+
pull_request: null
5+
6+
env:
7+
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
8+
COMPOSER_ROOT_VERSION: "dev-master"
49

510
jobs:
6-
phpunit:
11+
provide_php_versions_json:
712
runs-on: ubuntu-latest
813

914
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v2
15+
# git clone + use PHP + composer install
16+
- uses: actions/checkout@v2
17+
- uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: 8.0
20+
tools: composer:v2
1221

13-
- name: Setup PHP
14-
uses: shivammathur/setup-php@v2
15-
with:
16-
php-version: '8.0'
17-
extensions: mbstring, intl
18-
ini-values: post_max_size=256M, max_execution_time=180
19-
coverage: xdebug
20-
tools: php-cs-fixer, phpunit
22+
- run: composer install --no-progress --ansi
23+
24+
-
25+
# to see the output
26+
run: vendor/bin/easy-ci php-versions-json
27+
28+
# here we create the json, we need the "id:" so we can use it in "outputs" bellow
29+
30+
-
31+
id: output_data
32+
run: echo "::set-output name=matrix::$(vendor/bin/easy-ci php-versions-json)"
33+
34+
# here, we save the result of this 1st phase to the "outputs"
35+
outputs:
36+
matrix: ${{ steps.output_data.outputs.matrix }}
37+
38+
unit_tests:
39+
needs: provide_php_versions_json
40+
41+
runs-on: ubuntu-latest
2142

22-
- name: Composer dependencies
23-
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
php: ${{ fromJson(needs.provide_php_versions_json.outputs.matrix) }}
47+
48+
name: PHP ${{ matrix.php }} tests
49+
50+
steps:
51+
- uses: actions/checkout@v2
52+
# required for "git tag" presence for changelog-linker git tags resolver; default is 1
53+
# https://github.com/actions/checkout#fetch-all-tags
54+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
55+
56+
# see https://github.com/shivammathur/setup-php
57+
- uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: ${{ matrix.php }}
60+
extensions: mbstring, intl
61+
ini-values: post_max_size=256M, max_execution_time=180
62+
coverage: xdebug
63+
tools: php-cs-fixer, phpunit, composer:v2
64+
65+
# composer install cache - https://github.com/ramsey/composer-install
66+
-
67+
if: "matrix.php == 7.3"
68+
run: composer update --no-progress --ansi --prefer-lowest
69+
70+
-
71+
if: "matrix.php == 7.4"
72+
uses: "ramsey/composer-install@v2"
73+
74+
-
75+
if: "matrix.php >= 8"
76+
uses: "ramsey/composer-install@v2"
77+
with:
78+
composer-options: "--ignore-platform-req php"
2479

25-
- name: Run Testsuite
26-
run: vendor/bin/phpunit tests/
80+
-
81+
run: vendor/bin/phpunit

.github/workflows/tests81.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.gitignore

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
.idea
2-
vendor
3-
.env.test
2+
.php_cs
3+
.php_cs.cache
44
.phpunit.result.cache
5-
/phpunit.xml.bak
5+
build
6+
composer.lock
7+
coverage
8+
docs
9+
phpunit.xml
10+
phpstan.neon
11+
testbench.yaml
12+
vendor
13+
node_modules
14+
.php-cs-fixer.cache

.php_cs.dist.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->notName('*.blade.php')
10+
->ignoreDotFiles(true)
11+
->ignoreVCS(true);
12+
13+
return (new PhpCsFixer\Config())
14+
->setRules([
15+
'@PSR12' => true,
16+
'array_syntax' => ['syntax' => 'short'],
17+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
18+
'no_unused_imports' => true,
19+
'not_operator_with_successor_space' => true,
20+
'trailing_comma_in_multiline' => true,
21+
'phpdoc_scalar' => true,
22+
'unary_operator_spaces' => true,
23+
'binary_operator_spaces' => true,
24+
'blank_line_before_statement' => [
25+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
26+
],
27+
'phpdoc_single_line_var_spacing' => true,
28+
'phpdoc_var_without_name' => true,
29+
'class_attributes_separation' => [
30+
'elements' => [
31+
'method' => 'one',
32+
],
33+
],
34+
'method_argument_space' => [
35+
'on_multiline' => 'ensure_fully_multiline',
36+
'keep_multiple_spaces_after_comma' => true,
37+
],
38+
'single_trait_insert_per_statement' => true,
39+
])
40+
->setFinder($finder);

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
[![documentation](https://img.shields.io/github/workflow/status/codedredd/laravel-soap/documentation?label=docs&logo=read-the-docs&style=flat-square)](https://codedredd.github.io/laravel-soap/)
99

1010
## Versions
11-
Laravel SOAP Version | Laravel Support | PHP Version
12-
-------- | ------------------ | -------------
13-
1.x | 5.6, 6.x, 7x | 7.3 - 8.0
14-
2.x | 8.x | 7.3 - 8.0
15-
3.x | 8.x, 9.x | 8.0 - 8.1
11+
| Laravel SOAP Version | Laravel Support | PHP Version |
12+
|----------------------|-----------------|-------------|
13+
| 1.x | 5.6, 6.x, 7.x | 7.3 - 8.0 |
14+
| 2.x | 8.x | 7.3 - 8.0 |
15+
| 3.x | 9.x | 8.0 - 8.1 |
16+
1617
<a name="installation"></a>
1718
## Installation
1819

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.0 || 8.1",
13+
"php": "^8.0 || ^8.1",
1414
"ext-soap": "*",
1515
"ext-bcmath": "*",
1616
"ext-intl": "*",
1717
"ext-json": "*",
1818
"ext-dom": "*",
1919
"ext-simplexml": "*",
20-
"illuminate/support": "^8.0 || ^9.0",
20+
"illuminate/http": "^9.0",
21+
"illuminate/support": "^9.0",
2122
"phpro/soap-client": "^v2.1.0",
2223
"php-http/guzzle7-adapter": "^1.0",
2324
"php-http/discovery": "^1.7",
@@ -26,14 +27,16 @@
2627
"robrichards/wse-php": "^2.0",
2728
"php-soap/psr18-transport": "^1.2",
2829
"php-soap/psr18-wsse-middleware": "^1.1",
29-
"php-http/mock-client": "^1.5"
30+
"veewee/xml": "^1.3"
3031
},
3132
"require-dev": {
32-
"symfony/var-dumper": "^5.0",
3333
"symfony/options-resolver": "^5.4.3",
3434
"phpunit/phpunit": "^9.1",
35-
"orchestra/testbench": "^6.0 || ^7.0",
36-
"laminas/laminas-code": "^4.5.1"
35+
"orchestra/testbench": "^7.0",
36+
"laminas/laminas-code": "^4.5.1",
37+
"nunomaduro/larastan": "^2.0",
38+
"nunomaduro/collision": "^6.1",
39+
"symplify/easy-ci": "^10.0"
3740
},
3841
"autoload": {
3942
"psr-4": {

0 commit comments

Comments
 (0)