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

TaskResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 9

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResourceMethodConfiguration() 0 13 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\DeleteTrait;
18
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllForAccountTrait;
19
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllForFolderTrait;
20
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllTrait;
21
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdsTrait;
22
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdTrait;
23
use Zibios\WrikePhpLibrary\Resource\Traits\UpdateTrait;
24
25
/**
26
 * Task Resource.
27
 */
28
class TaskResource extends AbstractResource
29
{
30
    use GetAllTrait;
31
    use GetAllForAccountTrait;
32
    use GetAllForFolderTrait;
33
    use GetByIdTrait;
34
    use GetByIdsTrait;
35
    use CreateForFolderTrait;
36
    use UpdateTrait;
37
    use DeleteTrait;
38
39
    /**
40
     * @return array
41
     */
42 16
    protected function getResourceMethodConfiguration()
43
    {
44
        return [
45 16
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::TASKS,
46
            ResourceMethodEnum::GET_ALL_FOR_ACCOUNT => RequestPathFormatEnum::TASKS_FOR_ACCOUNT,
47
            ResourceMethodEnum::GET_ALL_FOR_FOLDER => RequestPathFormatEnum::TASKS_FOR_FOLDER,
48
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::TASKS_BY_ID,
49
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::TASKS_BY_IDS,
50
            ResourceMethodEnum::CREATE_FOR_FOLDER => RequestPathFormatEnum::TASKS_FOR_FOLDER,
51
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::TASKS_BY_ID,
52
            ResourceMethodEnum::DELETE => RequestPathFormatEnum::TASKS_BY_ID,
53
        ];
54
    }
55
}
56