Passed
Pull Request — master (#8)
by Thomas
11:44 queued 13s
created

ServiceFactory::deleteOperation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 3
1
<?php
2
/**
3
 * Copyright © Thomas Klein, All rights reserved.
4
 * See LICENSE bundled with this library for license details.
5
 */
6
declare(strict_types=1);
7
8
namespace Zoho\Desk\Service;
9
10
use Zoho\Desk\Client\RequestBuilder;
11
use Zoho\Desk\Model\DataObjectFactory;
12
13
final class ServiceFactory
14
{
15
    private RequestBuilder $requestBuilder;
16
17
    private DataObjectFactory $dataObjectFactory;
18
19
    public function __construct(RequestBuilder $requestBuilder, DataObjectFactory $dataObjectFactory)
20
    {
21
        $this->requestBuilder = $requestBuilder;
22
        $this->dataObjectFactory = $dataObjectFactory;
23
    }
24
25
    public function createOperation(string $entityType, ?string $path = null, array $arguments = []): CreateOperationInterface
26
    {
27
        return new CreateOperation($this->requestBuilder, $this->dataObjectFactory, $entityType, $path, $arguments);
28
    }
29
30
    public function readOperation(string $entityType, ?string $path = null, array $arguments = []): ReadOperationInterface
31
    {
32
        return new ReadOperation($this->requestBuilder, $this->dataObjectFactory, $entityType, $path, $arguments);
33
    }
34
35
    public function updateOperation(string $entityType, ?string $path = null, array $arguments = []): UpdateOperationInterface
36
    {
37
        return new UpdateOperation($this->requestBuilder, $this->dataObjectFactory, $entityType, $path, $arguments);
38
    }
39
40
    public function deleteOperation(string $entityType, ?string $path = null, array $arguments = []): DeleteOperationInterface
41
    {
42
        return new DeleteOperation($this->requestBuilder, $entityType, $path, $arguments);
43
    }
44
45
    public function listOperation(string $entityType, ?string $path = null, array $arguments = []): ListOperationInterface
46
    {
47
        return new ListOperation($this->requestBuilder, $this->dataObjectFactory, $entityType, $path, $arguments);
48
    }
49
}
50