Transform   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 20
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getParams() 0 3 1
A getTransformer() 0 3 1
1
<?php
2
3
/**
4
 * @author     Oleh Boiko <[email protected]>
5
 *
6
 * @site       https://mackrais.com
7
 *
8
 * @copyright  2014-2025 MackRais
9
 *
10
 * @date: 15.03.25
11
 */
12
13
declare(strict_types=1);
14
15
namespace MackRais\PropertyTransform;
16
17
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)]
18
class Transform
19
{
20
    private string|array $transformer;
21
    private array $params;
22
23
    public function __construct(string|array $transformer = '', array ...$params)
24
    {
25
        $this->transformer = $transformer;
26
        $this->params = $params;
27
    }
28
29
    public function getTransformer(): string|array
30
    {
31
        return $this->transformer;
32
    }
33
34
    public function getParams(): array
35
    {
36
        return $this->params;
37
    }
38
}
39