getResourceMethodConfiguration()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 2
cts 2
cp 1
rs 9.9332
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\CreateTrait;
19
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllTrait;
20
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdsTrait;
21
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdTrait;
22
use Zibios\WrikePhpLibrary\Resource\Traits\UpdateTrait;
23
24
/**
25
 * Custom Field Resource.
26
 */
27 View Code Duplication
class CustomFieldResource 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...
28
{
29
    use GetAllTrait;
30
    use GetByIdTrait;
31
    use GetByIdsTrait;
32
    use CreateTrait;
33
    use UpdateTrait;
34
35
    /**
36
     * Return connection array ResourceMethod => RequestPathFormat.
37
     *
38
     * @see \Zibios\WrikePhpLibrary\Enum\Api\ResourceMethodEnum
39
     * @see \Zibios\WrikePhpLibrary\Enum\Api\RequestPathFormatEnum
40
     *
41
     * @return array
42
     */
43 5
    protected function getResourceMethodConfiguration(): array
44
    {
45
        return [
46 5
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::CUSTOM_FIELDS,
47
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::CUSTOM_FIELDS_BY_ID,
48
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::CUSTOM_FIELDS_BY_IDS,
49
            ResourceMethodEnum::CREATE => RequestPathFormatEnum::CUSTOM_FIELDS,
50
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::CUSTOM_FIELDS_BY_ID,
51
        ];
52
    }
53
}
54