Passed
Branch account (733a83)
by vincent
02:35
created

Account::searchItemGenerator()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 9
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
crap 2
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the Tmdb package.
4
 *
5
 * (c) Vincent Faliès <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author Vincent Faliès <[email protected]>
11
 * @copyright Copyright (c) 2017
12
 */
13
14
15
namespace VfacTmdb\Abstracts;
16
17
use VfacTmdb\Interfaces\TmdbInterface;
18
use VfacTmdb\Traits\GeneratorTrait;
19
20
/**
21
 * abstract account class
22
 * @package Tmdb
23
 * @author Vincent Faliès <[email protected]>
24
 * @copyright Copyright (c) 2017
25
 */
26
abstract class Account
27
{
28
    use GeneratorTrait;
29
30
    /**
31
     * Tmdb object
32
     * @var TmdbInterface
33
     */
34
    protected $tmdb = null;
35
    /**
36
     * Logger
37
     * @var \Psr\Log\LoggerInterface
38
     */
39
    protected $logger = null;
40
    /**
41
     * Session_id string
42
     * @var string
43
     */
44
    protected $auth = null;
45
    /**
46
     * Account id
47
     * @var int
48
     */
49
    protected $account_id;
50
    /**
51
     * Configuration array
52
     * @var \stdClass
53
     */
54
    protected $conf = null;
55
    /**
56
     * Options
57
     * @var array
58
     */
59
    protected $options = [];
60
    /**
61
     * Constructor
62
     * @param TmdbInterface $tmdb
63
     * @param string $session_id
64
     * @param int $account_id
65
     * @param array $options
66
     */
67 28
    public function __construct(TmdbInterface $tmdb, string $session_id, int $account_id, array $options = array())
68
    {
69 28
        $this->tmdb            = $tmdb;
70 28
        $options['session_id'] = $session_id;
71 28
        $this->logger          = $tmdb->getLogger();
72 28
        $this->options         = $this->tmdb->checkOptions($options);
73 28
        $this->account_id      = $account_id;
74
        // Configuration
75 28
        $this->conf            = $tmdb->getConfiguration();
76 28
    }
77
}
78