Skip to content

Commit 6c1c3c1

Browse files
authored
Feature l11 (#39)
1 parent 3406872 commit 6c1c3c1

39 files changed

+116
-147
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: 'Checkout Repository'
1818
uses: actions/checkout@v3
1919
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@v3
20+
uses: actions/dependency-review-action@v4

.github/workflows/run-tests.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ jobs:
1515
matrix:
1616
os: [ ubuntu-latest, windows-latest ]
1717
php: [ 8.2, 8.3 ]
18-
laravel: [ 10.* ]
18+
laravel: [ 11.* ]
1919
stability: [ prefer-lowest, prefer-stable ]
20-
include:
21-
- laravel: 10.*
22-
testbench: 8.*
2320

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

@@ -41,7 +38,7 @@ jobs:
4138
4239
- name: Install dependencies
4340
run: |
44-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
41+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
4542
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4643
4744
- name: Set phpunit.xml
@@ -55,7 +52,7 @@ jobs:
5552
ZAMMAD_OBJECT_REFERENCE_ERROR_IGNORE: true
5653

5754
- name: Store test reports
58-
uses: actions/upload-artifact@v2
55+
uses: actions/upload-artifact@v4
5956
with:
6057
name: Store report
6158
retention-days: 1

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^8.2",
26-
"guzzlehttp/guzzle": "^7.8.1",
27-
"illuminate/contracts": "^10.0",
25+
"php": ">=8.2",
26+
"guzzlehttp/guzzle": "^7.8",
27+
"illuminate/contracts": "^11.0",
2828
"spatie/laravel-package-tools": "^1.16",
29-
"saloonphp/laravel-plugin": "^3.3",
30-
"saloonphp/saloon": "^3.6"
29+
"saloonphp/laravel-plugin": "^3.5",
30+
"saloonphp/saloon": "^3.7"
3131
},
3232
"require-dev": {
3333
"laravel/pint": "^1.13",
34-
"nunomaduro/collision": "^7.10",
35-
"nunomaduro/larastan": "^2.8",
34+
"nunomaduro/collision": "^8.1",
35+
"larastan/larastan": "^2.9",
3636
"pestphp/pest": "^2.3",
37-
"orchestra/testbench": "^8.20",
37+
"orchestra/testbench": "^9.0",
3838
"pestphp/pest-plugin-laravel": "^2.2",
39-
"pestphp/pest-plugin-arch": "^2.6",
39+
"pestphp/pest-plugin-arch": "^2.7",
4040
"phpstan/extension-installer": "^1.3",
4141
"phpstan/phpstan-deprecation-rules": "^1.1",
4242
"phpstan/phpstan-phpunit": "^1.3",

src/Classes/RequestClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct()
3030
$this->ignoreReferenceErrorIngore = config('zammad.object_reference_error_ignore');
3131
$this->objectHasReferenceError = config('zammad.objet_reference_error');
3232

33-
$this->connector = new ZammadConnector();
33+
$this->connector = new ZammadConnector;
3434
}
3535

3636
private function performRequest(Request $request): Response

src/DTO/Attachment.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ public function __construct(
2828
public int $size,
2929
public string $name,
3030
public string $type,
31-
) {
32-
}
31+
) {}
3332

3433
public function url(): string
3534
{

src/DTO/Comment.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ public function __construct(
8989
public Collection $attachments,
9090
public Carbon $updated_at,
9191
public Carbon $created_at,
92-
) {
93-
}
92+
) {}
9493

9594
public static function fake(
9695
?int $id = null,

src/DTO/ObjectAttribute.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ public function __construct(
3131
public int $position,
3232
public array $data_option,
3333
public ?array $data_option_new,
34-
) {
35-
}
34+
) {}
3635

3736
public static function fake(
3837
?int $id = null,

src/DTO/User.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ public function __construct(
3131
public Carbon $updated_at,
3232
public Carbon $created_at,
3333
public ?array $expanded = null,
34-
) {
35-
}
34+
) {}
3635

3736
public static function fake(
3837
?int $id = null,

src/Events/ZammadResponseLog.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ class ZammadResponseLog
1313
use InteractsWithSockets;
1414
use SerializesModels;
1515

16-
public function __construct(public Response $response)
17-
{
18-
}
16+
public function __construct(public Response $response) {}
1917
}

src/Requests/AccessTokens/CreateAccessTokenRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ class CreateAccessTokenRequest extends Request implements HasBody
1515

1616
public function __construct(
1717
protected array $payload
18-
) {
19-
}
18+
) {}
2019

2120
public function resolveEndpoint(): string
2221
{

src/Requests/AccessTokens/DestroyAccessTokenRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class DestroyAccessTokenRequest extends Request
1212
public function __construct(
1313
public int $id,
1414
public bool $expand = false
15-
) {
16-
}
15+
) {}
1716

1817
public function resolveEndpoint(): string
1918
{

src/Requests/Attachment/GetAttachmentRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ public function __construct(
1313
public int $ticketId,
1414
public int $commentId,
1515
public int $attachmentId,
16-
) {
17-
}
16+
) {}
1817

1918
public function resolveEndpoint(): string
2019
{

src/Requests/Comments/CreateCommentRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class CreateCommentRequest extends Request implements HasBody
1717

1818
public function __construct(
1919
protected array $payload
20-
) {
21-
}
20+
) {}
2221

2322
public function resolveEndpoint(): string
2423
{

src/Requests/Comments/DestroyCommentRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class DestroyCommentRequest extends Request
1111

1212
public function __construct(
1313
public int $id
14-
) {
15-
}
14+
) {}
1615

1716
public function resolveEndpoint(): string
1817
{

src/Requests/Comments/GetCommentByTicketRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class GetCommentByTicketRequest extends Request
1111

1212
public function __construct(
1313
public int $id
14-
) {
15-
}
14+
) {}
1615

1716
public function resolveEndpoint(): string
1817
{

src/Requests/Comments/GetCommentRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class GetCommentRequest extends Request
1313

1414
public function __construct(
1515
public int $id
16-
) {
17-
}
16+
) {}
1817

1918
public function resolveEndpoint(): string
2019
{

src/Requests/ObjectAttribute/CreateObjectAttributeRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class CreateObjectAttributeRequest extends Request implements HasBody
1717

1818
public function __construct(
1919
protected array $payload
20-
) {
21-
}
20+
) {}
2221

2322
public function resolveEndpoint(): string
2423
{

src/Requests/ObjectAttribute/DestroyObjectAttributeRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class DestroyObjectAttributeRequest extends Request
1111

1212
public function __construct(
1313
public int $id
14-
) {
15-
}
14+
) {}
1615

1716
public function resolveEndpoint(): string
1817
{

src/Requests/ObjectAttribute/GetObjectAttributeRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class GetObjectAttributeRequest extends Request
1313

1414
public function __construct(
1515
public int $id
16-
) {
17-
}
16+
) {}
1817

1918
public function resolveEndpoint(): string
2019
{

src/Requests/ObjectAttribute/UpdateObjectAttributeRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class UpdateObjectAttributeRequest extends Request implements HasBody
1818
public function __construct(
1919
public int $id,
2020
public array $payload
21-
) {
22-
}
21+
) {}
2322

2423
public function resolveEndpoint(): string
2524
{

src/Requests/Tickets/AllTicketsRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class AllTicketsRequest extends Request
1212
public function __construct(
1313
public ?int $perPage = null,
1414
public ?int $page = null,
15-
) {
16-
}
15+
) {}
1716

1817
public function resolveEndpoint(): string
1918
{

src/Requests/Tickets/CreateTicketRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class CreateTicketRequest extends Request implements HasBody
1818
public function __construct(
1919
protected array $payload,
2020
public bool $expand = false
21-
) {
22-
}
21+
) {}
2322

2423
public function resolveEndpoint(): string
2524
{

src/Requests/Tickets/DestroyTicketRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class DestroyTicketRequest extends Request
1111

1212
public function __construct(
1313
public int $id
14-
) {
15-
}
14+
) {}
1615

1716
public function resolveEndpoint(): string
1817
{

src/Requests/Tickets/GetTicketRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class GetTicketRequest extends Request
1414
public function __construct(
1515
public int $id,
1616
public bool $expand = false
17-
) {
18-
}
17+
) {}
1918

2019
public function resolveEndpoint(): string
2120
{

src/Requests/Tickets/SearchTicketRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public function __construct(
1414
public ?int $limit = null,
1515
public ?int $perPage = null,
1616
public ?int $page = null,
17-
) {
18-
}
17+
) {}
1918

2019
public function resolveEndpoint(): string
2120
{

src/Requests/Users/AllUsersRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class AllUsersRequest extends Request
1212
public function __construct(
1313
public ?int $perPage = null,
1414
public ?int $page = null,
15-
) {
16-
}
15+
) {}
1716

1817
public function resolveEndpoint(): string
1918
{

src/Requests/Users/CreateUserRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class CreateUserRequest extends Request implements HasBody
1818
public function __construct(
1919
protected array $payload,
2020
public bool $expand = false
21-
) {
22-
}
21+
) {}
2322

2423
public function resolveEndpoint(): string
2524
{

src/Requests/Users/DestroyUserRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class DestroyUserRequest extends Request
1111

1212
public function __construct(
1313
public int $id
14-
) {
15-
}
14+
) {}
1615

1716
public function resolveEndpoint(): string
1817
{

src/Requests/Users/GetUserRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class GetUserRequest extends Request
1414
public function __construct(
1515
public ?int $id = null,
1616
public bool $expand = false
17-
) {
18-
}
17+
) {}
1918

2019
public function resolveEndpoint(): string
2120
{

src/Requests/Users/SearchUserRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class SearchUserRequest extends Request
1212
public function __construct(
1313
public string $term,
1414
public ?int $limit = null,
15-
) {
16-
}
15+
) {}
1716

1817
public function resolveEndpoint(): string
1918
{

src/Requests/Users/UpdateUserRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public function __construct(
1919
public int $id,
2020
public array $payload,
2121
public bool $expand = false
22-
) {
23-
}
22+
) {}
2423

2524
public function resolveEndpoint(): string
2625
{

src/Zammad.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ class Zammad
1313
{
1414
public function user(): UserResource
1515
{
16-
return new UserResource();
16+
return new UserResource;
1717
}
1818

1919
public function userAccessToken(): UserAccessToken
2020
{
21-
return new UserAccessToken();
21+
return new UserAccessToken;
2222
}
2323

2424
public function ticket(): TicketResource
2525
{
26-
return new TicketResource();
26+
return new TicketResource;
2727
}
2828

2929
public function comment(): CommentResource
3030
{
31-
return new CommentResource();
31+
return new CommentResource;
3232
}
3333

3434
public function attachment(): AttachmentResource
3535
{
36-
return new AttachmentResource();
36+
return new AttachmentResource;
3737
}
3838

3939
public function object(): ObjectAttributeResource
4040
{
41-
return new ObjectAttributeResource();
41+
return new ObjectAttributeResource;
4242
}
4343
}

tests/Feature/AttachmentResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Support\Facades\Event;
66

77
it('can download an attachment', function () {
8-
$content = (new Zammad())->attachment()->download(
8+
$content = (new Zammad)->attachment()->download(
99
ticketId: 32,
1010
commentId: 111,
1111
attachmentId: 42,

0 commit comments

Comments
 (0)