From 51936a8c7b3548b8bff636fad00ad644b24cb2f8 Mon Sep 17 00:00:00 2001 From: ousid Date: Sun, 19 Feb 2023 14:21:29 +0100 Subject: [PATCH 1/7] add Laravel V10 support --- .github/workflows/phpstan.yml | 3 +++ .github/workflows/run-tests.yml | 7 +++++-- composer.json | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 9d41c0c..ef19f38 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -18,6 +18,9 @@ jobs: with: php-version: '8.1' coverage: none + with: + php-version: '8.2' + coverage: none - name: Install composer dependencies uses: ramsey/composer-install@v2 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 39ff7ee..222a5a5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,12 +13,15 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.1] - laravel: [9.*] + php: [8.1, 8.2] + laravel: [9.*, 10.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 9.* testbench: 7.* + include: + - laravel: 10.* + testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index f360d19..4b3dd6b 100644 --- a/composer.json +++ b/composer.json @@ -16,21 +16,21 @@ } ], "require": { - "php": "^8.1", + "php": "^8.1|^8.2", "spatie/laravel-package-tools": "^1.13.0", - "illuminate/contracts": "^9.0" + "illuminate/contracts": "^9.0|^10.0" }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^6.0", + "nunomaduro/collision": "^6.0|^7.0", "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^7.0", + "orchestra/testbench": "^7.0|^8.0", "pestphp/pest": "^1.21", "pestphp/pest-plugin-laravel": "^1.1", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5|^10.0" }, "autoload": { "psr-4": { From 43c50b386d88754d6f76c98eaeaf0707ae8494d1 Mon Sep 17 00:00:00 2001 From: ousid Date: Sun, 19 Feb 2023 13:22:07 +0000 Subject: [PATCH 2/7] Fix styling --- src/Concerns/HasTickets.php | 4 -- src/Concerns/InteractsWithTicketRelations.php | 9 ----- src/Concerns/InteractsWithTickets.php | 37 ------------------- src/Models/Category.php | 2 - src/Models/Label.php | 2 - src/Models/Message.php | 4 -- src/Models/Ticket.php | 10 ----- src/Scopes/TicketScope.php | 20 ---------- 8 files changed, 88 deletions(-) diff --git a/src/Concerns/HasTickets.php b/src/Concerns/HasTickets.php index 1edf7fb..6d097b6 100644 --- a/src/Concerns/HasTickets.php +++ b/src/Concerns/HasTickets.php @@ -10,8 +10,6 @@ trait HasTickets { /** * Get User tickets relationship - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function tickets(): HasMany { @@ -20,8 +18,6 @@ public function tickets(): HasMany /** * Get User tickets relationship - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function messages(): HasMany { diff --git a/src/Concerns/InteractsWithTicketRelations.php b/src/Concerns/InteractsWithTicketRelations.php index 5af2fbb..be27289 100644 --- a/src/Concerns/InteractsWithTicketRelations.php +++ b/src/Concerns/InteractsWithTicketRelations.php @@ -10,7 +10,6 @@ trait InteractsWithTicketRelations * Associate Labels into an existing ticket * * @param mixed $id - * @param array $attributes * @param bool $touch * @return void */ @@ -35,7 +34,6 @@ public function syncLabels($ids, $detaching = true) * Associate Categories into an existing ticket * * @param mixed $id - * @param array $attributes * @param bool $touch * @return void */ @@ -58,9 +56,6 @@ public function syncCategories($ids, $detaching = true) /** * Add new message on an existing ticket - * - * @param string $message - * @return \Illuminate\Database\Eloquent\Model */ public function message(string $message): Model { @@ -69,10 +64,6 @@ public function message(string $message): Model /** * Add new message on an existing ticket as a custom user - * - * @param \Illuminate\Database\Eloquent\Model|null $user - * @param string $message - * @return \Illuminate\Database\Eloquent\Model */ public function messageAsUser(?Model $user, string $message): Model { diff --git a/src/Concerns/InteractsWithTickets.php b/src/Concerns/InteractsWithTickets.php index 039a98f..b4bc6c8 100644 --- a/src/Concerns/InteractsWithTickets.php +++ b/src/Concerns/InteractsWithTickets.php @@ -9,8 +9,6 @@ trait InteractsWithTickets { /** * Archive the ticket - * - * @return self */ public function archive(): self { @@ -23,8 +21,6 @@ public function archive(): self /** * Close the ticket - * - * @return self */ public function close(): self { @@ -37,8 +33,6 @@ public function close(): self /** * Reopen the ticket - * - * @return self */ public function reopen(): self { @@ -51,8 +45,6 @@ public function reopen(): self /** * Determine if the ticket is archived - * - * @return bool */ public function isArchived(): bool { @@ -61,8 +53,6 @@ public function isArchived(): bool /** * Determine if the ticket is open - * - * @return bool */ public function isOpen(): bool { @@ -71,8 +61,6 @@ public function isOpen(): bool /** * Determine if the ticket is closed - * - * @return bool */ public function isClosed(): bool { @@ -81,8 +69,6 @@ public function isClosed(): bool /** * Determine if the ticket is resolved - * - * @return bool */ public function isResolved(): bool { @@ -91,8 +77,6 @@ public function isResolved(): bool /** * Determine if the ticket is unresolved - * - * @return bool */ public function isUnresolved(): bool { @@ -101,8 +85,6 @@ public function isUnresolved(): bool /** * Determine if the ticket is locked - * - * @return bool */ public function isLocked(): bool { @@ -111,8 +93,6 @@ public function isLocked(): bool /** * Determine if the ticket is unresolved - * - * @return bool */ public function isUnlocked(): bool { @@ -121,8 +101,6 @@ public function isUnlocked(): bool /** * Mark the ticket as resolved - * - * @return self */ public function markAsResolved(): self { @@ -135,8 +113,6 @@ public function markAsResolved(): self /** * Mark the ticket as locked - * - * @return self */ public function markAsLocked(): self { @@ -149,8 +125,6 @@ public function markAsLocked(): self /** * Mark the ticket as locked - * - * @return self */ public function markAsUnlocked(): self { @@ -163,8 +137,6 @@ public function markAsUnlocked(): self /** * Mark the ticket as archived - * - * @return self */ public function markAsArchived(): self { @@ -175,8 +147,6 @@ public function markAsArchived(): self /** * Close the ticket and mark it as resolved - * - * @return self */ public function closeAsResolved(): self { @@ -190,8 +160,6 @@ public function closeAsResolved(): self /** * Close the ticket and mark it as unresolved - * - * @return self */ public function closeAsUnresolved(): self { @@ -205,8 +173,6 @@ public function closeAsUnresolved(): self /** * Reopen the ticket and mark it as resolved - * - * @return self */ public function reopenAsUnresolved(): self { @@ -220,9 +186,6 @@ public function reopenAsUnresolved(): self /** * Add new message on an existing ticket as a custom user - * - * @param \Illuminate\Database\Eloquent\Model|int $user - * @return self */ public function assignTo(Model|int $user): self { diff --git a/src/Models/Category.php b/src/Models/Category.php index eae3b52..908f072 100644 --- a/src/Models/Category.php +++ b/src/Models/Category.php @@ -21,8 +21,6 @@ class Category extends Model /** * Get Tickets RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function tickets(): BelongsToMany { diff --git a/src/Models/Label.php b/src/Models/Label.php index 591a31c..c8357c5 100644 --- a/src/Models/Label.php +++ b/src/Models/Label.php @@ -21,8 +21,6 @@ class Label extends Model /** * Get Tickets RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function tickets(): BelongsToMany { diff --git a/src/Models/Message.php b/src/Models/Message.php index fc78b62..6ed9a4a 100644 --- a/src/Models/Message.php +++ b/src/Models/Message.php @@ -25,8 +25,6 @@ class Message extends Model /** * Get Ticket RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function ticket(): BelongsTo { @@ -40,8 +38,6 @@ public function ticket(): BelongsTo /** * Get Message Relationship - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user(): BelongsTo { diff --git a/src/Models/Ticket.php b/src/Models/Ticket.php index a1908d7..b7fd562 100644 --- a/src/Models/Ticket.php +++ b/src/Models/Ticket.php @@ -39,8 +39,6 @@ class Ticket extends Model /** * Get User RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user(): BelongsTo { @@ -49,8 +47,6 @@ public function user(): BelongsTo /** * Get Assigned To User RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function assignedToUser(): BelongsTo { @@ -59,8 +55,6 @@ public function assignedToUser(): BelongsTo /** * Get Messages RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function messages(): HasMany { @@ -74,8 +68,6 @@ public function messages(): HasMany /** * Get Categories RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function categories(): BelongsToMany { @@ -91,8 +83,6 @@ public function categories(): BelongsToMany /** * Get Labels RelationShip - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function labels(): BelongsToMany { diff --git a/src/Scopes/TicketScope.php b/src/Scopes/TicketScope.php index 56054f4..ce61a36 100644 --- a/src/Scopes/TicketScope.php +++ b/src/Scopes/TicketScope.php @@ -10,8 +10,6 @@ trait TicketScope { /** * Get closed tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeClosed(Builder $builder): Builder { @@ -20,8 +18,6 @@ public function scopeClosed(Builder $builder): Builder /** * Get opened tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeOpened(Builder $builder): Builder { @@ -30,8 +26,6 @@ public function scopeOpened(Builder $builder): Builder /** * Get resolved tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeResolved(Builder $builder): Builder { @@ -40,8 +34,6 @@ public function scopeResolved(Builder $builder): Builder /** * Get unresolved tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeUnresolved(Builder $builder): Builder { @@ -50,8 +42,6 @@ public function scopeUnresolved(Builder $builder): Builder /** * Get locked tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeLocked(Builder $builder): Builder { @@ -60,8 +50,6 @@ public function scopeLocked(Builder $builder): Builder /** * Get unlocked tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeUnlocked(Builder $builder): Builder { @@ -70,8 +58,6 @@ public function scopeUnlocked(Builder $builder): Builder /** * Get custom priority tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeWithPriority(Builder $builder, string $priority): Builder { @@ -80,8 +66,6 @@ public function scopeWithPriority(Builder $builder, string $priority): Builder /** * Get low priority tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeWithLowPriority(Builder $builder): Builder { @@ -90,8 +74,6 @@ public function scopeWithLowPriority(Builder $builder): Builder /** * Get normal priority tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeWithNormalPriority(Builder $builder): Builder { @@ -100,8 +82,6 @@ public function scopeWithNormalPriority(Builder $builder): Builder /** * Get high priority tickets - * - * @return \Illuminate\Database\Eloquent\Builder */ public function scopeWithHighPriority(Builder $builder): Builder { From e6f36d8953570888d048267dbe200573255b9e40 Mon Sep 17 00:00:00 2001 From: ousid Date: Sun, 19 Feb 2023 14:25:56 +0100 Subject: [PATCH 3/7] fix key error --- .github/workflows/run-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 222a5a5..e062c30 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,7 +19,6 @@ jobs: include: - laravel: 9.* testbench: 7.* - include: - laravel: 10.* testbench: 8.* From 1892900db4139ab503d34b4abe0f00963fb76d99 Mon Sep 17 00:00:00 2001 From: ousid Date: Sun, 19 Feb 2023 15:08:10 +0100 Subject: [PATCH 4/7] update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4b3dd6b..59e3099 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^8.1|^8.2", + "php": "^8.1", "spatie/laravel-package-tools": "^1.13.0", "illuminate/contracts": "^9.0|^10.0" }, From b731eccacd01e6a6d3e068b90e1a79dc1c1d729b Mon Sep 17 00:00:00 2001 From: ousid Date: Thu, 23 Feb 2023 18:10:18 +0100 Subject: [PATCH 5/7] wip --- .github/workflows/run-tests.yml | 4 +--- composer.json | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e062c30..0bfa207 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,13 +14,11 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.1, 8.2] - laravel: [9.*, 10.*] + laravel: [9.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 9.* testbench: 7.* - - laravel: 10.* - testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index 59e3099..b43738b 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5|^10.0" + "phpunit/phpunit": "^9.5" }, "autoload": { "psr-4": { From 66b99c7cc0665613a0127df335cf709b13bfba9d Mon Sep 17 00:00:00 2001 From: ousid Date: Thu, 23 Feb 2023 18:19:08 +0100 Subject: [PATCH 6/7] wip --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b43738b..59e3099 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5|^10.0" }, "autoload": { "psr-4": { From 547d160486a4d8c01b9876401fb71f29e1c26d11 Mon Sep 17 00:00:00 2001 From: ousid Date: Thu, 23 Feb 2023 18:20:10 +0100 Subject: [PATCH 7/7] wip --- .github/workflows/run-tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 0bfa207..b662705 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,11 +14,16 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.1, 8.2] - laravel: [9.*] + laravel: [9.*, 10.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 9.* testbench: 7.* + - laravel: 10.* + testbench: 8.* + exclude: + - laravel: 9.* + php: 8.2 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}