MultiCurlManager   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __get() 0 5 2
A __isset() 0 5 1
1
<?php namespace JMathai\PhpMultiCurl;
2
/**
3
 * MultiCurlManager manages multicurl handles
4
 *
5
 * @author Jaisen Mathai <[email protected]>
6
 */
7
class MultiCurlManager
8
{
9
  private $key;
10
  private $epiCurl;
11
12
  public function __construct($key)
13
  {
14
    $this->key = $key;
15
    $this->epiCurl = MultiCurl::getInstance();
16
  }
17
18
  public function __get($name)
19
  {
20
    $responses = $this->epiCurl->getResult($this->key);
21
    return isset($responses[$name]) ? $responses[$name] : null;
22
  }
23
24
  public function __isset($name)
25
  {
26
    $val = self::__get($name);
27
    return empty($val);
28
  }
29
}
30