AgencyHydrator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromStdClass() 0 10 1
1
<?php declare(strict_types=1);
2
3
namespace Audiens\AdForm\Entity;
4
5
use stdClass;
6
7
class AgencyHydrator extends Agency
8
{
9
    /**
10
     * Hydrate an agency from a stdClass, intended to be used for
11
     * instancing a category from \json_decode()
12
     *
13
     * @param stdClass $stdClass
14
     *
15
     * @return Agency
16
     */
17
    public static function fromStdClass(stdClass $stdClass): Agency
18
    {
19
        $agency = new Agency();
20
21
        $agency->id = $stdClass->id;
22
        $agency->name = $stdClass->name;
23
        $agency->countryId = $stdClass->countryId;
24
        $agency->active = $stdClass->active;
25
26
        return $agency;
27
    }
28
}
29