Completed
Push — master ( e28c79...14b414 )
by Avtandil
02:36
created

QueueServiceProvider::registerSqsFifoConnector()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 6
cp 0
crap 2
rs 9.4285
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 Longman\LaravelLodash\Queue\SqsFifo\Connectors\SqsFifoConnector;
15
use Illuminate\Queue\QueueManager;
16
use Illuminate\Queue\QueueServiceProvider as BaseQueueServiceProvider;
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
    public function registerConnectors($manager)
27
    {
28
        foreach (['Null', 'Sync', 'Database', 'Redis', 'Beanstalkd', 'Sqs', 'SqsFifo'] as $connector) {
29
            $this->{"register{$connector}Connector"}($manager);
30
        }
31
    }
32
33
    protected function registerSqsFifoConnector(QueueManager $manager): void
34
    {
35
        $manager->addConnector('sqs.fifo', function (): SqsFifoConnector {
36
            return new SqsFifoConnector;
37
        });
38
    }
39
}
40