UserAdapter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
c 2
b 1
f 0
lcom 0
cbo 2
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromEloquent() 0 8 1
1
<?php
2
3
namespace NilPortugues\Example\Service;
4
5
use DateTimeImmutable;
6
use NilPortugues\Example\Domain\User;
7
use NilPortugues\Example\Domain\UserId;
8
9
class UserAdapter
10
{
11
    /**
12
     * @param \stdClass $model
13
     * @return User
14
     */
15
    public function fromEloquent(\stdClass $model)
16
    {
17
        return new User(
18
            new UserId($model->id),
19
            $model->name,
20
            new DateTimeImmutable($model->created_at)
21
        );
22
    }
23
}
24