CommentResource::getResourceMethodConfiguration()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 14
loc 14
ccs 2
cts 2
cp 1
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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\CreateForFolderTrait;
19
use Zibios\WrikePhpLibrary\Resource\Traits\CreateForTaskTrait;
20
use Zibios\WrikePhpLibrary\Resource\Traits\DeleteTrait;
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\UpdateTrait;
27
28
/**
29
 * Comment Resource.
30
 */
31 View Code Duplication
class CommentResource extends AbstractResource
32
{
33
    use GetAllTrait;
34
    use GetAllForFolderTrait;
35
    use GetAllForTaskTrait;
36
    use GetByIdTrait;
37
    use GetByIdsTrait;
38
    use CreateForFolderTrait;
39
    use CreateForTaskTrait;
40
    use UpdateTrait;
41
    use DeleteTrait;
42
43
    /**
44
     * Return connection array ResourceMethod => RequestPathFormat.
45
     *
46
     * @see \Zibios\WrikePhpLibrary\Enum\Api\ResourceMethodEnum
47
     * @see \Zibios\WrikePhpLibrary\Enum\Api\RequestPathFormatEnum
48
     *
49
     * @return array
50
     */
51 9
    protected function getResourceMethodConfiguration(): array
52
    {
53
        return [
54 9
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::COMMENTS,
55
            ResourceMethodEnum::GET_ALL_FOR_FOLDER => RequestPathFormatEnum::COMMENTS_FOR_FOLDER,
56
            ResourceMethodEnum::GET_ALL_FOR_TASK => RequestPathFormatEnum::COMMENTS_FOR_TASK,
57
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::COMMENTS_BY_ID,
58
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::COMMENTS_BY_IDS,
59
            ResourceMethodEnum::CREATE_FOR_FOLDER => RequestPathFormatEnum::COMMENTS_FOR_FOLDER,
60
            ResourceMethodEnum::CREATE_FOR_TASK => RequestPathFormatEnum::COMMENTS_FOR_TASK,
61
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::COMMENTS_BY_ID,
62
            ResourceMethodEnum::DELETE => RequestPathFormatEnum::COMMENTS_BY_ID,
63
        ];
64
    }
65
}
66