1 | <?php |
||
17 | class Transifex |
||
18 | { |
||
19 | /** |
||
20 | * Options for the Transifex object. |
||
21 | * |
||
22 | * @var array|\ArrayAccess |
||
23 | */ |
||
24 | protected $options; |
||
25 | |||
26 | /** |
||
27 | * The HTTP client object to use in sending HTTP requests. |
||
28 | * |
||
29 | * @var Http |
||
30 | */ |
||
31 | protected $client; |
||
32 | |||
33 | /** |
||
34 | * @param array|\ArrayAccess $options Transifex options array. |
||
35 | * @param Http $client The HTTP client object. |
||
36 | * |
||
37 | * @throws \InvalidArgumentException |
||
38 | */ |
||
39 | 1 | public function __construct($options = [], Http $client = null) |
|
66 | |||
67 | /** |
||
68 | * Factory method to fetch API objects. |
||
69 | * |
||
70 | * @param string $name Name of the API object to retrieve. |
||
71 | * |
||
72 | * @return TransifexObject |
||
73 | * |
||
74 | * @throws \InvalidArgumentException |
||
75 | */ |
||
76 | 5 | public function get($name) |
|
97 | |||
98 | /** |
||
99 | * Get an option from the Transifex instance. |
||
100 | * |
||
101 | * @param string $key The name of the option to get. |
||
102 | * @param mixed $default The default value if the option is not set. |
||
103 | * |
||
104 | * @return mixed The option value. |
||
105 | */ |
||
106 | 1 | public function getOption($key, $default = null) |
|
110 | |||
111 | /** |
||
112 | * Set an option for the Transifex instance. |
||
113 | * |
||
114 | * @param string $key The name of the option to set. |
||
115 | * @param mixed $value The option value to set. |
||
116 | * |
||
117 | * @return $this |
||
118 | */ |
||
119 | 1 | public function setOption($key, $value) |
|
125 | } |
||
126 |