Completed
Push — master ( 74bae6...8bdcbb )
by Zbigniew
03:01
created

CommentResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 11

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResourceMethodConfiguration() 0 15 1
1
<?php
2
3
/*
4
 * This file is part of the zibios/wrike-php-library package.
5
 *
6
 * (c) Zbigniew Ślązak
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zibios\WrikePhpLibrary\Resource;
13
14
use Zibios\WrikePhpLibrary\Enum\Api\RequestPathFormatEnum;
15
use Zibios\WrikePhpLibrary\Enum\Api\ResourceMethodEnum;
16
use Zibios\WrikePhpLibrary\Resource\Traits\CreateForFolderTrait;
17
use Zibios\WrikePhpLibrary\Resource\Traits\CreateForTaskTrait;
18
use Zibios\WrikePhpLibrary\Resource\Traits\DeleteTrait;
19
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllForAccountTrait;
20
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllForFolderTrait;
21
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllForTaskTrait;
22
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllTrait;
23
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdsTrait;
24
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdTrait;
25
use Zibios\WrikePhpLibrary\Resource\Traits\UpdateTrait;
26
27
/**
28
 * Comment Resource.
29
 */
30
class CommentResource extends AbstractResource
31
{
32
    use GetAllTrait;
33
    use GetAllForAccountTrait;
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 array
45
     */
46 20
    protected function getResourceMethodConfiguration()
47
    {
48
        return [
49 20
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::COMMENTS,
50
            ResourceMethodEnum::GET_ALL_FOR_ACCOUNT => RequestPathFormatEnum::COMMENTS_FOR_ACCOUNT,
51
            ResourceMethodEnum::GET_ALL_FOR_FOLDER => RequestPathFormatEnum::COMMENTS_FOR_FOLDER,
52
            ResourceMethodEnum::GET_ALL_FOR_TASK => RequestPathFormatEnum::COMMENTS_FOR_TASK,
53
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::COMMENTS_BY_ID,
54
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::COMMENTS_BY_IDS,
55
            ResourceMethodEnum::CREATE_FOR_FOLDER => RequestPathFormatEnum::COMMENTS_FOR_FOLDER,
56
            ResourceMethodEnum::CREATE_FOR_TASK => RequestPathFormatEnum::COMMENTS_FOR_TASK,
57
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::COMMENTS_BY_ID,
58
            ResourceMethodEnum::DELETE => RequestPathFormatEnum::COMMENTS_BY_ID,
59
        ];
60
    }
61
}
62