Skip to content

Commit ca79c92

Browse files
authored
v2.0.1 beta
### 2.0.1 beta #### Critical **Comment DTO** - Replaced $body_without_blockquote variable with $body_filtered - Dropped $body_only_blockquote #### Core - Dropped support for PHP versions below 8.1 - Replaced PHPUnit for PEST - Moved HTTP requests to a dedicated class `RequestClass.php` #### Improvements - Added dynamic retry values for failed HTTP requests that can be set via the configuration file - You can now pass User attributes within the searchOrCreateByEmail method to update or create user attributes within the same request. - Added a dynamic HTML Stripe-Out for Signature and Replied HTML via the configuration file - Define via configuration variable if a 'Unprocessable Entity' response related to an object reference should be ignored. [More information](https://docs.zammad.org/en/latest/api/user.html#update). #### Features - Create & Update Zammad Objects - Update Zammad User
1 parent 425454c commit ca79c92

40 files changed

+1077
-546
lines changed

.gitattributes

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
/.gitattributes export-ignore
77
/.gitignore export-ignore
88
/phpunit.xml.dist export-ignore
9+
/art export-ignore
10+
/docs export-ignore
911
/tests export-ignore
1012
/.editorconfig export-ignore
11-
/.php_cs.dist export-ignore
13+
/.php_cs.dist.php export-ignore
1214
/psalm.xml export-ignore
1315
/psalm.xml.dist export-ignore
1416
/testbench.yaml export-ignore
17+
/UPGRADING.md export-ignore
18+
/phpstan.neon.dist export-ignore
19+
/phpstan-baseline.neon export-ignore

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These are supported funding model platforms
2+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [StanBarrows]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: dependabot-auto-merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/[email protected]
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
20+
- name: Auto-merge Dependabot PRs for semver-minor updates
21+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
22+
run: gh pr merge --auto --merge "$PR_URL"
23+
env:
24+
PR_URL: ${{github.event.pull_request.html_url}}
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
27+
- name: Auto-merge Dependabot PRs for semver-patch updates
28+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
29+
run: gh pr merge --auto --merge "$PR_URL"
30+
env:
31+
PR_URL: ${{github.event.pull_request.html_url}}
32+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
name: Check & fix styling
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- styling
47

58
jobs:
69
php-cs-fixer:
710
runs-on: ubuntu-latest
811

912
steps:
1013
- name: Checkout code
11-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1215
with:
1316
ref: ${{ github.head_ref }}
1417

1518
- name: Run PHP CS Fixer
16-
uses: docker://oskarstark/php-cs-fixer-ga:3.0.0
19+
uses: docker://oskarstark/php-cs-fixer-ga
1720
with:
1821
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
1922

.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.dist'
8+
9+
jobs:
10+
phpstan:
11+
name: phpstan
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
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@v1
24+
25+
- name: Run PHPStan
26+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/psalm.yml

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

.github/workflows/run-tests.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
os: [ ubuntu-latest, windows-latest ]
16-
php: [ 8.0, 8.1 ]
15+
# os: [ ubuntu-latest, windows-latest ]
16+
os: [ ubuntu-latest ]
17+
php: [ 8.1 ]
1718
laravel: [ 9.* ]
18-
stability: [ prefer-lowest, prefer-stable ]
19+
#stability: [ prefer-lowest, prefer-stable ]
20+
stability: [ prefer-stable ]
21+
include:
22+
- laravel: 9.*
23+
testbench: 7.*
1924

2025
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2126

2227
steps:
2328
- name: Checkout code
24-
uses: actions/checkout@v2
29+
uses: actions/checkout@v3
2530

2631
- name: Setup PHP
2732
uses: shivammathur/setup-php@v2
@@ -37,14 +42,15 @@ jobs:
3742
3843
- name: Install dependencies
3944
run: |
40-
composer install -q --no-progress --prefer-dist --no-interaction --no-suggest --optimize-autoloader --no-scripts
41-
45+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
46+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4247
4348
- name: Execute tests
44-
run: vendor/bin/phpunit
49+
run: vendor/bin/pest
4550
env:
4651
ZAMMAD_URL: ${{ secrets.ZAMMAD_URL }}
4752
ZAMMAD_TOKEN: ${{ secrets.ZAMMAD_TOKEN }}
53+
ZAMMAD_OBJECT_REFERENCE_ERROR_IGNORE: true
4854

4955
- name: Store test reports
5056
uses: actions/upload-artifact@v2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ phpunit.xml
1212
psalm.xml
1313
testbench.yaml
1414
vendor
15+
node_modules
16+
phpstan.neon

.php-cs-fixer.dist.php

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,6 @@
11
<?php
22

3-
use PhpCsFixer\Config;
4-
use PhpCsFixer\Finder;
5-
6-
$rules = [
7-
'@PSR2' => true,
8-
'array_indentation' => true,
9-
'array_syntax' => ['syntax' => 'short'],
10-
'binary_operator_spaces' => true,
11-
'blank_line_before_statement' => [
12-
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
13-
],
14-
'cast_spaces' => ['space' => 'single'],
15-
'class_attributes_separation' => [
16-
'elements' => ['method' => 'one'],
17-
],
18-
'concat_space' => ['spacing' => 'one'],
19-
'function_declaration' => false,
20-
'method_argument_space' => [
21-
'on_multiline' => 'ensure_fully_multiline',
22-
'keep_multiple_spaces_after_comma' => true,
23-
],
24-
'method_chaining_indentation' => true,
25-
'no_empty_statement' => true,
26-
'no_unused_imports' => true,
27-
'not_operator_with_successor_space' => false,
28-
'ordered_imports' => ['sort_algorithm' => 'alpha'],
29-
'phpdoc_scalar' => true,
30-
'phpdoc_single_line_var_spacing' => true,
31-
'phpdoc_var_without_name' => true,
32-
'return_type_declaration' => true,
33-
'single_quote' => true,
34-
'single_trait_insert_per_statement' => true,
35-
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters']],
36-
'unary_operator_spaces' => true,
37-
];
38-
39-
$finder = Finder::create()
3+
$finder = Symfony\Component\Finder\Finder::create()
404
->in([
415
__DIR__ . '/src',
426
__DIR__ . '/tests',
@@ -46,6 +10,31 @@
4610
->ignoreDotFiles(true)
4711
->ignoreVCS(true);
4812

49-
return (new Config())
50-
->setRules($rules)
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+
])
5140
->setFinder($finder);

CHANGELOG.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22

33
All notable changes to `laravel-zammad` will be documented in this file.
44

5+
### 2.0.0beta - 2022-07-06
6+
7+
#### Critical
8+
9+
**Comment DTO**
10+
11+
- Replaced $body_without_blockquote variable with $body_filtered
12+
- Dropped $body_only_blockquote
13+
14+
#### Core
15+
16+
- Dropped support for PHP versions below 8.1
17+
- Replaced PHPUnit for PEST
18+
- Moved HTTP requests to a dedicated class `RequestClass.php`
19+
20+
#### Improvements
21+
22+
- Added dynamic retry values for failed HTTP requests that can be set via the configuration file
23+
- You can now pass User attributes within the searchOrCreateByEmail method to update or create user
24+
attributes within the same request.
25+
- Added a dynamic HTML Stripe-Out for Signature and Replied HTML via the configuration file
26+
- Define via configuration variable if a 'Unprocessable Entity' response related to an object reference should be
27+
ignored. [More information](https://docs.zammad.org/en/latest/api/user.html#update).
28+
29+
#### Features
30+
31+
- Create & Update Zammad Objects
32+
- Update Zammad User
33+
534
### 1.0.0 - 2021-07-22
635

736
- Stable release.
@@ -14,7 +43,7 @@ All notable changes to `laravel-zammad` will be documented in this file.
1443
### 0.1.1 - 2021-05-18
1544

1645
- Added `body_without_blockquote` and `body_only_blockquote` attribute to the
17-
comment DTO
46+
comment DTO
1847

1948
### 0.1.0 - 2021-05-18
2049

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) Codebar AG <info@codebar.ch>
3+
Copyright (c) codebar Solutions AG <helpdesk@codebar.ch>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)