Completed
Push — master ( efafaa...1ce8a3 )
by Avtandil
05:26
created

QueueServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerConnectors() 0 6 2
A registerSqsFifoConnector() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Longman\LaravelLodash\Queue;
6
7
use Illuminate\Queue\QueueManager;
8
use Illuminate\Queue\QueueServiceProvider as BaseQueueServiceProvider;
9
use Longman\LaravelLodash\Queue\SqsFifo\Connectors\SqsFifoConnector;
10
11
class QueueServiceProvider extends BaseQueueServiceProvider
12
{
13
    /**
14
     * Register the connectors on the queue manager.
15
     *
16
     * @param  \Illuminate\Queue\QueueManager $manager
17
     * @return void
18
     */
19 1
    public function registerConnectors($manager)
20
    {
21 1
        foreach (['Null', 'Sync', 'Database', 'Redis', 'Beanstalkd', 'Sqs', 'SqsFifo'] as $connector) {
22 1
            $this->{"register{$connector}Connector"}($manager);
23
        }
24 1
    }
25
26 1
    protected function registerSqsFifoConnector(QueueManager $manager): void
27
    {
28 1
        $manager->addConnector('sqs.fifo', static function (): SqsFifoConnector {
29
            return new SqsFifoConnector();
30 1
        });
31 1
    }
32
}
33