Passed
Push — master ( 6f214c...ffcc9b )
by WEBEWEB
13:06
created

CompatibilityServiceTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setCompatibilityService() 0 3 1
A getCompatibilityService() 0 2 1
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2023 WEBEWEB
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 WBW\Bundle\CoreBundle\Service;
13
14
/**
15
 * Compatibility service trait.
16
 *
17
 * @author webeweb <https://github.com/webeweb>
18
 * @package WBW\Bundle\CoreBundle\Service
19
 */
20
trait CompatibilityServiceTrait {
21
22
    /**
23
     * Compatibility service.
24
     *
25
     * @var CompatibilityServiceInterface|null
26
     */
27
    protected $compatibilityService;
28
29
    /**
30
     * Get the compatibility service.
31
     *
32
     * @return CompatibilityServiceInterface|null Returns the compatibility service.
33
     */
34
    public function getCompatibilityService(): ?CompatibilityServiceInterface {
35
        return $this->compatibilityService;
36
    }
37
38
    /**
39
     * Set the compatibility service.
40
     *
41
     * @param CompatibilityServiceInterface|null $compatibilityService The compatibility service.
42
     * @return self Returns this instance.
43
     */
44
    protected function setCompatibilityService(?CompatibilityServiceInterface $compatibilityService): self {
45
        $this->compatibilityService = $compatibilityService;
46
        return $this;
47
    }
48
}
49