Skip to content

Commit

Permalink
Merge pull request #14 from stefanzweifel/feat/laravel-11
Browse files Browse the repository at this point in the history
Add Support for Laravel 11 and drop Support for Laravel 8, 9, 10
  • Loading branch information
freekmurze authored Feb 5, 2024
2 parents 8af80f2 + 207f943 commit aa6d8dc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1, 8.0]
laravel: [10.*, 9.*, 8.*]
php: [8.3, 8.2]
laravel: [11.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
exclude:
- laravel: 10.*
php: 8.0
- laravel: 11.*
testbench: 9.*

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

Expand Down
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.2",
"spatie/laravel-package-tools": "^1.4.3",
"illuminate/contracts": "^8.35|^9.0|^10.0"
"illuminate/contracts": "^11.0",
"symfony/console": "^7.0"
},
"require-dev": {
"ext-pcntl": "*",
"brianium/paratest": "^6.2",
"nunomaduro/collision": "^5.3|^6.0",
"orchestra/testbench": "^6.16|^7.0|^8.0",
"pestphp/pest-plugin-laravel": "^1.3",
"phpunit/phpunit": "^9.5",
"brianium/paratest": "^6.2|^7.0",
"nunomaduro/collision": "^5.3|^6.0|^7.0|^8.0",
"orchestra/testbench": "^9.0",
"pestphp/pest-plugin-laravel": "^1.3|^2.0",
"phpunit/phpunit": "^9.5|^10|^11",
"spatie/laravel-ray": "^1.17"
},
"autoload": {
Expand Down
4 changes: 3 additions & 1 deletion src/SignalAwareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ public function getSubscribedSignals(): array
return array_merge($this->autoDiscoverSignals(), $this->handlesSignals ?? []);
}

public function handleSignal(int $signal): void
public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
{
event(new SignalReceived($signal, $this));

$this
->executeRegisteredSignalHandlers($signal)
->handleSignalMethodOnCommandClass($signal);

return $signal;
}

protected function executeRegisteredSignalHandlers(int $signal): self
Expand Down
4 changes: 3 additions & 1 deletion tests/SignalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
/** @var \Spatie\SignalAwareCommand\SignalAwareCommand $command */
$command = app()->make(TestCommand::class);

$command->handleSignal(SIGINT);
$result = $command->handleSignal(SIGINT);

Event::assertDispatched(SignalReceived::class);

expect($result)->toEqual(SIGINT);
});

it('can clear registered handlers', function () {
Expand Down

0 comments on commit aa6d8dc

Please sign in to comment.