Completed
Push — master ( 52fe1b...6cfefd )
by Maciej
12:25
created

Transaction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 1
cbo 0
dl 0
loc 33
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addPromise() 0 4 1
A unwrap() 0 4 1
1
<?php
2
/**
3
 * Created by Maciej Paprocki for Bureau-VA.
4
 * Date: 17/02/2016
5
 * Project Name: MaciekPaprocki\WordpressGuzzle
6
 * Time: 12:14
7
 */
8
9
namespace BureauVa\WordpressGuzzle\Transaction;
10
11
12
/**
13
 * Class Transaction
14
 * @package MaciekPaprocki\WordpressGuzzle
15
 */
16
17
class Transaction
18
{
19
20
    public $promises;
21
    public $client = null;
22
    /**
23
     * Transaction constructor. You can pass clien
24
     * @param null $client
25
     */
26
    public function __construct($client = null)
27
    {
28
        $this->client = $client;
29
    }
30
31
    /**
32
     * @param $promise
33
     * @return $this
34
     */
35
    public function addPromise($name,$promise){
36
        $this->promises[$name] = $promise;
37
        return $this;
38
    }
39
40
    /**
41
     * Awaits all the promises and returns data
42
     *
43
     * @return array;
0 ignored issues
show
Documentation introduced by
The doc-type array; could not be parsed: Expected "|" or "end of type", but got ";" at position 5. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
44
     */
45
    public function unwrap(){
46
        //TODO: implement function that unwraps all the requests
47
        return null;
48
    }
49
}