persistCredentials()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
nc 1
nop 2
dl 0
loc 21
rs 9.9
c 1
b 0
f 0
1
<?php
2
3
function write($message)
4
{
5
    echo PHP_EOL;
6
    echo $message;
7
    echo PHP_EOL;
8
9
    sleep(3);
10
}
11
12
function persistCredentials($email, $result)
13
{
14
    $filename = __DIR__.'/api_key_'.$email;
15
16
    $body = <<<EOF
17
Your API key information is persisted here:
18
19
username: {$email}
20
password: {$result->password}
21
dashbord: {$result->dashboard_url}
22
api key: {$result->api_key}
23
24
Looking forward to work with you.
25
26
// TenderSEO
27
28
EOF;
29
30
    file_put_contents($filename, $body);
31
32
    return $filename;
33
}
34