DiffbotAware::registerDiffbot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Swader\Diffbot\Traits;
4
5
use Swader\Diffbot\Diffbot;
6
7
/**
8
 * Class DiffbotAware
9
 * @property Diffbot diffbot
10
 * @package Swader\Diffbot\Traits
11
 */
12
trait DiffbotAware
13
{
14
    /**
15
     * Sets the Diffbot instance on the child class
16
     * Used to later fetch the token, HTTP client, EntityFactory, etc
17
     * @param Diffbot $d
18
     * @return $this
19
     */
20 123
    public function registerDiffbot(Diffbot $d)
21
    {
22 123
        $this->diffbot = $d;
23
24 123
        return $this;
25
    }
26
}