Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Laravel 10 #525

Merged
merged 11 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.0', '8.1']
stability: [prefer-lowest, prefer-stable]
php: ['8.0', '8.1', '8.2']
stability: ['prefer-lowest', prefer-stable]
laravel: ['^9.0', '^10.0']
exclude:
- php: '8.0'
laravel: '^10.0'

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
name: 'PHP ${{ matrix.php }} - Laravel: ${{matrix.laravel}} - ${{ matrix.stability }}'

steps:
- name: Checkout code
Expand All @@ -40,7 +44,7 @@ jobs:
run: docker-compose up -d rabbitmq

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
run: composer update --with='laravel/framework:${{matrix.laravel}}' --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress

- name: Run Laravel Pint
run: ./vendor/bin/pint --test
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
"require": {
"php": "^8.0",
"ext-json": "*",
"illuminate/queue": "^9.0",
"illuminate/queue": "^9.0|^10.0",
"php-amqplib/php-amqplib": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"mockery/mockery": "^1.0",
"laravel/horizon": "^5.0",
"orchestra/testbench": "^7.0",
"laravel/pint": "^1.2"
"orchestra/testbench": "^7.0|^8.0",
"laravel/pint": "^1.2",
"laravel/framework": "^9.0|^10.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 0 additions & 2 deletions src/Console/ExchangeDeclareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class ExchangeDeclareCommand extends Command
protected $description = 'Declare exchange';

/**
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
2 changes: 0 additions & 2 deletions src/Console/ExchangeDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class ExchangeDeleteCommand extends Command
protected $description = 'Delete exchange';

/**
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
2 changes: 0 additions & 2 deletions src/Console/QueueBindCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class QueueBindCommand extends Command
protected $description = 'Bind queue to exchange';

/**
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
2 changes: 0 additions & 2 deletions src/Console/QueueDeclareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class QueueDeclareCommand extends Command
protected $description = 'Declare queue';

/**
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
2 changes: 0 additions & 2 deletions src/Console/QueueDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class QueueDeleteCommand extends Command
protected $description = 'Delete queue';

/**
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
2 changes: 0 additions & 2 deletions src/Console/QueuePurgeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class QueuePurgeCommand extends Command
protected $description = 'Purge all messages in queue';

/**
* @param RabbitMQConnector $connector
*
* @throws Exception
*/
public function handle(RabbitMQConnector $connector): void
Expand Down
3 changes: 0 additions & 3 deletions src/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function setPrefetchCount(int $value): void
*
* @param string $connectionName
* @param string $queue
* @param WorkerOptions $options
* @return int
*
* @throws Throwable
Expand Down Expand Up @@ -181,10 +180,8 @@ function (AMQPMessage $message) use ($connection, $options, $connectionName, $qu
/**
* Determine if the daemon should process on this iteration.
*
* @param WorkerOptions $options
* @param string $connectionName
* @param string $queue
* @return bool
*/
protected function daemonShouldRun(WorkerOptions $options, $connectionName, $queue): bool
{
Expand Down
4 changes: 0 additions & 4 deletions src/Horizon/Listeners/RabbitMQFailedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class RabbitMQFailedEvent
/**
* Create a new listener instance.
*
* @param Dispatcher $events
* @return void
*/
public function __construct(Dispatcher $events)
Expand All @@ -29,9 +28,6 @@ public function __construct(Dispatcher $events)

/**
* Handle the event.
*
* @param LaravelJobFailed $event
* @return void
*/
public function handle(LaravelJobFailed $event): void
{
Expand Down
3 changes: 0 additions & 3 deletions src/Horizon/RabbitMQQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class RabbitMQQueue extends BaseRabbitMQQueue
* Get the number of queue jobs that are ready to process.
*
* @param string|null $queue
* @return int
*
* @throws AMQPProtocolChannelException
*/
Expand Down Expand Up @@ -96,7 +95,6 @@ public function release($delay, $job, $data, $queue, $attempts = 0)
*
* @param string $queue
* @param RabbitMQJob $job
* @return void
*
* @throws BindingResolutionException
*/
Expand All @@ -110,7 +108,6 @@ public function deleteReserved($queue, $job): void
*
* @param string $queue
* @param mixed $event
* @return void
*
* @throws BindingResolutionException
*/
Expand Down
4 changes: 0 additions & 4 deletions src/LaravelQueueRabbitMQServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class LaravelQueueRabbitMQServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register(): void
{
Expand Down Expand Up @@ -60,8 +58,6 @@ public function register(): void

/**
* Register the application's event listeners.
*
* @return void
*/
public function boot(): void
{
Expand Down
12 changes: 0 additions & 12 deletions src/Queue/Connectors/RabbitMQConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public function __construct(Dispatcher $dispatcher)
/**
* Establish a queue connection.
*
* @param array $config
* @return RabbitMQQueue
*
* @throws Exception
Expand Down Expand Up @@ -64,9 +63,6 @@ public function connect(array $config): Queue
}

/**
* @param array $config
* @return AbstractConnection
*
* @throws Exception
*/
protected function createConnection(array $config): AbstractConnection
Expand All @@ -86,11 +82,6 @@ protected function createConnection(array $config): AbstractConnection
/**
* Create a queue for the worker.
*
* @param string $worker
* @param AbstractConnection $connection
* @param string $queue
* @param bool $dispatchAfterCommit
* @param array $options
* @return HorizonRabbitMQQueue|RabbitMQQueue|Queue
*/
protected function createQueue(
Expand All @@ -112,9 +103,6 @@ protected function createQueue(

/**
* Recursively filter only null values.
*
* @param array $array
* @return array
*/
private function filter(array $array): array
{
Expand Down
6 changes: 0 additions & 6 deletions src/Queue/Jobs/RabbitMQJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ public function release($delay = 0): void

/**
* Get the underlying RabbitMQ connection.
*
* @return RabbitMQQueue
*/
public function getRabbitMQ(): RabbitMQQueue
{
Expand All @@ -147,8 +145,6 @@ public function getRabbitMQ(): RabbitMQQueue

/**
* Get the underlying RabbitMQ message.
*
* @return AMQPMessage
*/
public function getRabbitMQMessage(): AMQPMessage
{
Expand All @@ -157,8 +153,6 @@ public function getRabbitMQMessage(): AMQPMessage

/**
* Get the headers from the rabbitMQ message.
*
* @return array|null
*/
protected function getRabbitMQMessageHeaders(): ?array
{
Expand Down
Loading