AttachmentResource   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 13

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResourceMethodConfiguration() 0 17 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the zibios/wrike-php-library package.
7
 *
8
 * (c) Zbigniew Ślązak
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zibios\WrikePhpLibrary\Resource;
15
16
use Zibios\WrikePhpLibrary\Enum\Api\RequestPathFormatEnum;
17
use Zibios\WrikePhpLibrary\Enum\Api\ResourceMethodEnum;
18
use Zibios\WrikePhpLibrary\Resource\Traits\DeleteTrait;
19
use Zibios\WrikePhpLibrary\Resource\Traits\DownloadPreviewTrait;
20
use Zibios\WrikePhpLibrary\Resource\Traits\DownloadTrait;
21
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllForFolderTrait;
22
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllForTaskTrait;
23
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllTrait;
24
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdsTrait;
25
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdTrait;
26
use Zibios\WrikePhpLibrary\Resource\Traits\GetPublicUrlTrait;
27
use Zibios\WrikePhpLibrary\Resource\Traits\UpdateTrait;
28
use Zibios\WrikePhpLibrary\Resource\Traits\UploadForFolderTrait;
29
use Zibios\WrikePhpLibrary\Resource\Traits\UploadForTaskTrait;
30
31
/**
32
 * Attachment Resource.
33
 */
34
class AttachmentResource extends AbstractResource
35
{
36
    use GetAllTrait;
37
    use GetAllForFolderTrait;
38
    use GetAllForTaskTrait;
39
    use GetByIdTrait;
40
    use GetByIdsTrait;
41
    use DownloadTrait;
42
    use DownloadPreviewTrait;
43
    use GetPublicUrlTrait;
44
    use UploadForFolderTrait;
45
    use UploadForTaskTrait;
46
    use UpdateTrait;
47
    use DeleteTrait;
48
49
    /**
50
     * Return connection array ResourceMethod => RequestPathFormat.
51
     *
52
     * @see \Zibios\WrikePhpLibrary\Enum\Api\ResourceMethodEnum
53
     * @see \Zibios\WrikePhpLibrary\Enum\Api\RequestPathFormatEnum
54
     *
55
     * @return array
56
     */
57 12
    protected function getResourceMethodConfiguration(): array
58
    {
59
        return [
60 12
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::ATTACHMENTS,
61
            ResourceMethodEnum::GET_ALL_FOR_FOLDER => RequestPathFormatEnum::ATTACHMENTS_FOR_FOLDER,
62
            ResourceMethodEnum::GET_ALL_FOR_TASK => RequestPathFormatEnum::ATTACHMENTS_FOR_TASK,
63
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::ATTACHMENTS_BY_ID,
64
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::ATTACHMENTS_BY_IDS,
65
            ResourceMethodEnum::DOWNLOAD => RequestPathFormatEnum::ATTACHMENTS_DOWNLOAD,
66
            ResourceMethodEnum::DOWNLOAD_PREVIEW => RequestPathFormatEnum::ATTACHMENTS_DOWNLOAD_PREVIEW,
67
            ResourceMethodEnum::GET_PUBLIC_URL => RequestPathFormatEnum::ATTACHMENTS_URL,
68
            ResourceMethodEnum::UPLOAD_FOR_FOLDER => RequestPathFormatEnum::ATTACHMENTS_FOR_FOLDER,
69
            ResourceMethodEnum::UPLOAD_FOR_TASK => RequestPathFormatEnum::ATTACHMENTS_FOR_TASK,
70
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::ATTACHMENTS_BY_ID,
71
            ResourceMethodEnum::DELETE => RequestPathFormatEnum::ATTACHMENTS_BY_ID,
72
        ];
73
    }
74
}
75