ContentfulPublishEntryJob   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 5 1
1
<?php
2
3
namespace Digia\Lumen\ContentfulSync\Jobs;
4
5
/**
6
 * Class ContentfulPublishEntryJob
7
 * @package Digia\Lumen\ContentfulSync\Jobs
8
 */
9
final class ContentfulPublishEntryJob extends ContentfulSyncJob
10
{
11
12
    /**
13
     * @var string
14
     */
15
    private $contentType;
16
17
    /**
18
     * @var string
19
     */
20
    private $entryJson;
21
22
    /**
23
     * @var bool
24
     */
25
    private $ignoreExisting;
26
27
    /**
28
     * ContentfulPublishEntryJob constructor.
29
     *
30
     * @param string $contentType
31
     * @param string $entryJson
32
     * @param bool   $ignoreExisting
33
     */
34
    public function __construct(string $contentType, string $entryJson, bool $ignoreExisting)
35
    {
36
        $this->contentType    = $contentType;
37
        $this->entryJson      = $entryJson;
38
        $this->ignoreExisting = $ignoreExisting;
39
    }
40
41
    /**
42
     * @inheritdoc
43
     */
44
    public function handle(): void
45
    {
46
        $this->getContentfulSyncService()
47
             ->handleEntryPublished($this->contentType, $this->entryJson, $this->ignoreExisting);
48
    }
49
}
50