Skip to content

Commit e3edef6

Browse files
committed
phpdoc fixes
1 parent 7235ef1 commit e3edef6

File tree

5 files changed

+101
-3
lines changed

5 files changed

+101
-3
lines changed

src/Omnipay/Common/AbstractGateway.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,22 @@ public function __construct(ClientInterface $httpClient = null, HttpRequest $htt
7272
$this->initialize();
7373
}
7474

75+
/**
76+
* Get the short name of the Gateway
77+
*
78+
* @return string
79+
*/
7580
public function getShortName()
7681
{
7782
return Helper::getGatewayShortName(get_class($this));
7883
}
7984

85+
/**
86+
* Initialize this gateway with default parameters
87+
*
88+
* @param array $parameters
89+
* @return $this
90+
*/
8091
public function initialize(array $parameters = array())
8192
{
8293
$this->parameters = new ParameterBag;
@@ -95,43 +106,72 @@ public function initialize(array $parameters = array())
95106
return $this;
96107
}
97108

109+
/**
110+
* @return array
111+
*/
98112
public function getDefaultParameters()
99113
{
100114
return array();
101115
}
102116

117+
/**
118+
* @return array
119+
*/
103120
public function getParameters()
104121
{
105122
return $this->parameters->all();
106123
}
107124

125+
/**
126+
* @param string $key
127+
* @return mixed
128+
*/
108129
protected function getParameter($key)
109130
{
110131
return $this->parameters->get($key);
111132
}
112133

134+
/**
135+
* @param string $key
136+
* @param mixed $value
137+
* @return $this
138+
*/
113139
protected function setParameter($key, $value)
114140
{
115141
$this->parameters->set($key, $value);
116142

117143
return $this;
118144
}
119145

146+
/**
147+
* @return boolean
148+
*/
120149
public function getTestMode()
121150
{
122151
return $this->getParameter('testMode');
123152
}
124153

154+
/**
155+
* @param boolean $value
156+
* @return $this
157+
*/
125158
public function setTestMode($value)
126159
{
127160
return $this->setParameter('testMode', $value);
128161
}
129162

163+
/**
164+
* @return string
165+
*/
130166
public function getCurrency()
131167
{
132168
return strtoupper($this->getParameter('currency'));
133169
}
134170

171+
/**
172+
* @param string $value
173+
* @return $this
174+
*/
135175
public function setCurrency($value)
136176
{
137177
return $this->setParameter('currency', $value);

src/Omnipay/Common/Message/AbstractRequest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,13 +656,23 @@ public function setPaymentMethod($value)
656656
return $this->setParameter('paymentMethod', $value);
657657
}
658658

659+
/**
660+
* Send the request
661+
*
662+
* @return ResponseInterface
663+
*/
659664
public function send()
660665
{
661666
$data = $this->getData();
662667

663668
return $this->sendData($data);
664669
}
665670

671+
/**
672+
* Get the associated Response.
673+
*
674+
* @return ResponseInterface
675+
*/
666676
public function getResponse()
667677
{
668678
if (null === $this->response) {

src/Omnipay/Common/Message/AbstractResponse.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,41 @@ public function getRequest()
6767
return $this->request;
6868
}
6969

70+
/**
71+
* Is the response successful?
72+
*
73+
* @return boolean
74+
*/
7075
public function isPending()
7176
{
7277
return false;
7378
}
7479

80+
/**
81+
* Does the response require a redirect?
82+
*
83+
* @return boolean
84+
*/
7585
public function isRedirect()
7686
{
7787
return false;
7888
}
7989

90+
/**
91+
* Is the response a transparent redirect?
92+
*
93+
* @return boolean
94+
*/
8095
public function isTransparentRedirect()
8196
{
8297
return false;
8398
}
8499

100+
/**
101+
* Is the transaction cancelled by the user?
102+
*
103+
* @return boolean
104+
*/
85105
public function isCancelled()
86106
{
87107
return false;
@@ -97,16 +117,31 @@ public function getData()
97117
return $this->data;
98118
}
99119

120+
/**
121+
* Response Message
122+
*
123+
* @return null|string A response message from the payment gateway
124+
*/
100125
public function getMessage()
101126
{
102127
return null;
103128
}
104129

130+
/**
131+
* Response code
132+
*
133+
* @return null|string A response code from the payment gateway
134+
*/
105135
public function getCode()
106136
{
107137
return null;
108138
}
109139

140+
/**
141+
* Gateway Reference
142+
*
143+
* @return null|string A reference provided by the gateway to represent this transaction
144+
*/
110145
public function getTransactionReference()
111146
{
112147
return null;
@@ -119,13 +154,18 @@ public function getTransactionReference()
119154
* redirection page, just call the getRedirectUrl() and getRedirectData() methods directly.
120155
*
121156
* @codeCoverageIgnore
157+
*
158+
* @return void
122159
*/
123160
public function redirect()
124161
{
125162
$this->getRedirectResponse()->send();
126163
exit;
127164
}
128165

166+
/**
167+
* @return HttpRedirectResponse
168+
*/
129169
public function getRedirectResponse()
130170
{
131171
if (!$this instanceof RedirectResponseInterface || !$this->isRedirect()) {

src/Omnipay/Common/Message/RedirectResponseInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,29 @@ interface RedirectResponseInterface extends ResponseInterface
1919
{
2020
/**
2121
* Gets the redirect target url.
22+
*
23+
* @return string
2224
*/
2325
public function getRedirectUrl();
2426

2527
/**
2628
* Get the required redirect method (either GET or POST).
29+
*
30+
* @return string
2731
*/
2832
public function getRedirectMethod();
2933

3034
/**
3135
* Gets the redirect form data array, if the redirect method is POST.
36+
*
37+
* @return array
3238
*/
3339
public function getRedirectData();
3440

3541
/**
3642
* Perform the required redirect.
43+
*
44+
* @return void
3745
*/
3846
public function redirect();
3947
}

src/Omnipay/Common/Message/ResponseInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ public function isCancelled();
4646
/**
4747
* Response Message
4848
*
49-
* @return string A response message from the payment gateway
49+
* @return null|string A response message from the payment gateway
5050
*/
5151
public function getMessage();
5252

5353
/**
5454
* Response code
5555
*
56-
* @return string A response code from the payment gateway
56+
* @return null|string A response code from the payment gateway
5757
*/
5858
public function getCode();
5959

6060
/**
6161
* Gateway Reference
6262
*
63-
* @return string A reference provided by the gateway to represent this transaction
63+
* @return null|string A reference provided by the gateway to represent this transaction
6464
*/
6565
public function getTransactionReference();
6666
}

0 commit comments

Comments
 (0)