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

Transaction::addPromise()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 2
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
}