Skip to content

Commit

Permalink
v2.0.1 beta
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
StanBarrows authored Jul 7, 2022
1 parent 425454c commit ca79c92
Show file tree
Hide file tree
Showing 40 changed files with 1,077 additions and 546 deletions.
7 changes: 6 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/art export-ignore
/docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist export-ignore
/.php_cs.dist.php export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/UPGRADING.md export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [StanBarrows]
32 changes: 32 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: dependabot-auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
9 changes: 6 additions & 3 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: Check & fix styling

on: [push]
on:
push:
branches:
- styling

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga:3.0.0
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes

Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v1

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
33 changes: 0 additions & 33 deletions .github/workflows/psalm.yml

This file was deleted.

20 changes: 13 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, windows-latest ]
php: [ 8.0, 8.1 ]
# os: [ ubuntu-latest, windows-latest ]
os: [ ubuntu-latest ]
php: [ 8.1 ]
laravel: [ 9.* ]
stability: [ prefer-lowest, prefer-stable ]
#stability: [ prefer-lowest, prefer-stable ]
stability: [ prefer-stable ]
include:
- laravel: 9.*
testbench: 7.*

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

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -37,14 +42,15 @@ jobs:
- name: Install dependencies
run: |
composer install -q --no-progress --prefer-dist --no-interaction --no-suggest --optimize-autoloader --no-scripts
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
run: vendor/bin/pest
env:
ZAMMAD_URL: ${{ secrets.ZAMMAD_URL }}
ZAMMAD_TOKEN: ${{ secrets.ZAMMAD_TOKEN }}
ZAMMAD_OBJECT_REFERENCE_ERROR_IGNORE: true

- name: Store test reports
uses: actions/upload-artifact@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ phpunit.xml
psalm.xml
testbench.yaml
vendor
node_modules
phpstan.neon
67 changes: 28 additions & 39 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,6 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$rules = [
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'cast_spaces' => ['space' => 'single'],
'class_attributes_separation' => [
'elements' => ['method' => 'one'],
],
'concat_space' => ['spacing' => 'one'],
'function_declaration' => false,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'method_chaining_indentation' => true,
'no_empty_statement' => true,
'no_unused_imports' => true,
'not_operator_with_successor_space' => false,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'return_type_declaration' => true,
'single_quote' => true,
'single_trait_insert_per_statement' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters']],
'unary_operator_spaces' => true,
];

$finder = Finder::create()
$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -46,6 +10,31 @@
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new Config())
->setRules($rules)
return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

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

### 2.0.0beta - 2022-07-06

#### 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.0.0 - 2021-07-22

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

- Added `body_without_blockquote` and `body_only_blockquote` attribute to the
comment DTO
comment DTO

### 0.1.0 - 2021-05-18

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) Codebar AG <info@codebar.ch>
Copyright (c) codebar Solutions AG <helpdesk@codebar.ch>

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

0 comments on commit ca79c92

Please sign in to comment.