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

FolderResource::getResourceMethodConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

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.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
crap 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\CopyTrait;
17
use Zibios\WrikePhpLibrary\Resource\Traits\CreateForFolderTrait;
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\GetAllTrait;
22
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdsTrait;
23
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdTrait;
24
use Zibios\WrikePhpLibrary\Resource\Traits\UpdateTrait;
25
26
/**
27
 * Folder Resource.
28
 */
29 View Code Duplication
class FolderResource extends AbstractResource
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
{
31
    use GetAllTrait;
32
    use GetAllForAccountTrait;
33
    use GetAllForFolderTrait;
34
    use GetByIdTrait;
35
    use GetByIdsTrait;
36
    use CreateForFolderTrait;
37
    use CopyTrait;
38
    use UpdateTrait;
39
    use DeleteTrait;
40
41
    /**
42
     * @return array
43
     */
44 18
    protected function getResourceMethodConfiguration()
45
    {
46
        return [
47 18
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::FOLDERS,
48
            ResourceMethodEnum::GET_ALL_FOR_ACCOUNT => RequestPathFormatEnum::FOLDERS_FOR_ACCOUNT,
49
            ResourceMethodEnum::GET_ALL_FOR_FOLDER => RequestPathFormatEnum::FOLDERS_FOR_FOLDER,
50
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::FOLDERS_BY_ID,
51
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::FOLDERS_BY_IDS,
52
            ResourceMethodEnum::CREATE_FOR_FOLDER => RequestPathFormatEnum::FOLDERS_FOR_FOLDER,
53
            ResourceMethodEnum::COPY => RequestPathFormatEnum::FOLDERS_COPY,
54
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::FOLDERS_BY_ID,
55
            ResourceMethodEnum::DELETE => RequestPathFormatEnum::FOLDERS_BY_ID,
56
        ];
57
    }
58
}
59