Completed
Push — master ( 2384d0...cdc37f )
by Avtandil
03:50
created

QueueServiceProvider::registerConnectors()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Laravel Lodash package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
declare(strict_types=1);
11
12
namespace Longman\LaravelLodash\Queue;
13
14
use Illuminate\Queue\QueueManager;
15
use Illuminate\Queue\QueueServiceProvider as BaseQueueServiceProvider;
16
use Longman\LaravelLodash\Queue\SqsFifo\Connectors\SqsFifoConnector;
17
18
class QueueServiceProvider extends BaseQueueServiceProvider
19
{
20
    /**
21
     * Register the connectors on the queue manager.
22
     *
23
     * @param  \Illuminate\Queue\QueueManager $manager
24
     * @return void
25
     */
26 1
    public function registerConnectors($manager)
27
    {
28 1
        foreach (['Null', 'Sync', 'Database', 'Redis', 'Beanstalkd', 'Sqs', 'SqsFifo'] as $connector) {
29 1
            $this->{"register{$connector}Connector"}($manager);
30
        }
31 1
    }
32
33 1
    protected function registerSqsFifoConnector(QueueManager $manager): void
34
    {
35
        $manager->addConnector('sqs.fifo', function (): SqsFifoConnector {
36
            return new SqsFifoConnector();
37 1
        });
38 1
    }
39
}
40