TransformsAccounts::fromDoneDoneAccount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
ccs 6
cts 6
cp 1
crap 1
rs 10
1
<?php
2
3
namespace TestMonitor\DoneDone\Transforms;
4
5
use TestMonitor\DoneDone\Validator;
6
use TestMonitor\DoneDone\Resources\Account;
7
8
trait TransformsAccounts
9
{
10
    /**
11
     * @param array $account
12
     * @return \TestMonitor\DoneDone\Resources\Account
13
     */
14 1
    protected function fromDoneDoneAccount($account): Account
15
    {
16 1
        Validator::isArray($account);
17 1
        Validator::keysExists($account, ['id', 'name']);
18
19 1
        return new Account([
20 1
            'id' => $account['id'],
21 1
            'name' => $account['name'],
22 1
        ]);
23
    }
24
}
25