ConfigurableRoadmapDto   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
c 1
b 0
f 0
dl 0
loc 72
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setStrategy() 0 3 1
A getConfiguration() 0 3 1
A getStrategy() 0 3 1
A setConfiguration() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Veslo project <https://github.com/symfony-doge/veslo>.
5
 *
6
 * (C) 2019 Pavel Petrov <[email protected]>.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://opensource.org/licenses/GPL-3.0 GPL-3.0
12
 */
13
14
declare(strict_types=1);
15
16
namespace Veslo\AnthillBundle\Dto\Vacancy;
17
18
use Veslo\AnthillBundle\Dto\Vacancy\Roadmap\ConfigurationDto;
19
use Veslo\AnthillBundle\Dto\Vacancy\Roadmap\StrategyDto;
20
use Veslo\AnthillBundle\Vacancy\Normalizer\RoadmapDtoDenormalizer;
21
22
/**
23
 * Context of configurable roadmap by which the vacancy was found
24
 *
25
 * @see RoadmapDtoDenormalizer
26
 */
27
// inheritance used only for symfony serializer compatibility and cleaner communication with external services.
28
class ConfigurableRoadmapDto extends RoadmapDto
29
{
30
    /**
31
     * Property with information about roadmap search strategy
32
     *
33
     * @const string
34
     */
35
    public const PROPERTY_STRATEGY = 'strategy';
36
37
    /**
38
     * Property with information about configuration for roadmap search strategy
39
     *
40
     * @const string
41
     */
42
    public const PROPERTY_CONFIGURATION = 'configuration';
43
44
    /**
45
     * Context of search algorithm
46
     *
47
     * @var StrategyDto
48
     */
49
    private $strategy;
50
51
    /**
52
     * Context of configuration for a search algorithm used by roadmap
53
     *
54
     * @var ConfigurationDto
55
     */
56
    private $configuration;
57
58
    /**
59
     * Sets context of search algorithm
60
     *
61
     * @param StrategyDto $strategy
62
     *
63
     * @return void
64
     */
65
    public function setStrategy(StrategyDto $strategy): void
66
    {
67
        $this->strategy = $strategy;
68
    }
69
70
    /**
71
     * Returns context of search algorithm
72
     *
73
     * @return StrategyDto|null
74
     */
75
    public function getStrategy(): ?StrategyDto
76
    {
77
        return $this->strategy;
78
    }
79
80
    /**
81
     * Sets context of configuration for search algorithm
82
     *
83
     * @param ConfigurationDto $configuration
84
     *
85
     * @return void
86
     */
87
    public function setConfiguration(ConfigurationDto $configuration): void
88
    {
89
        $this->configuration = $configuration;
90
    }
91
92
    /**
93
     * Returns context of configuration for search algorithm
94
     *
95
     * @return ConfigurationDto|null
96
     */
97
    public function getConfiguration(): ?ConfigurationDto
98
    {
99
        return $this->configuration;
100
    }
101
}
102