File tree Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ protected static function convertToLowercase($str)
43
43
{
44
44
$ explodedStr = explode ('_ ' , $ str );
45
45
$ lowercasedStr = [];
46
-
46
+
47
47
if (count ($ explodedStr ) > 1 ) {
48
48
foreach ($ explodedStr as $ value ) {
49
49
$ lowercasedStr [] = strtolower ($ value );
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ private static function toString($response)
32
32
*/
33
33
public static function json ($ response )
34
34
{
35
- $ body = static ::toString ($ response );
35
+ $ body = self ::toString ($ response );
36
36
37
37
$ data = json_decode ($ body , true );
38
38
if (JSON_ERROR_NONE !== json_last_error ()) {
@@ -60,7 +60,7 @@ public static function json($response)
60
60
*/
61
61
public static function xml ($ response )
62
62
{
63
- $ body = static ::toString ($ response );
63
+ $ body = self ::toString ($ response );
64
64
65
65
$ errorMessage = null ;
66
66
$ internalErrors = libxml_use_internal_errors (true );
@@ -77,9 +77,10 @@ public static function xml($response)
77
77
libxml_use_internal_errors ($ internalErrors );
78
78
libxml_disable_entity_loader ($ disableEntities );
79
79
80
- if ($ errorMessage ) {
80
+ if ($ errorMessage !== null ) {
81
81
throw new RuntimeException ('Unable to parse response body into XML: ' . $ errorMessage );
82
82
}
83
+
83
84
return $ xml ;
84
85
}
85
86
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class Item implements ItemInterface
26
26
*
27
27
* @param array|null $parameters An array of parameters to set on the new object
28
28
*/
29
- public function __construct ($ parameters = null )
29
+ public function __construct (array $ parameters = null )
30
30
{
31
31
$ this ->initialize ($ parameters );
32
32
}
@@ -37,7 +37,7 @@ public function __construct($parameters = null)
37
37
* @param array|null $parameters An array of parameters to set on this object
38
38
* @return $this Item
39
39
*/
40
- public function initialize ($ parameters = null )
40
+ public function initialize (array $ parameters = null )
41
41
{
42
42
$ this ->parameters = new ParameterBag ;
43
43
@@ -46,6 +46,9 @@ public function initialize($parameters = null)
46
46
return $ this ;
47
47
}
48
48
49
+ /**
50
+ * @return array
51
+ */
49
52
public function getParameters ()
50
53
{
51
54
return $ this ->parameters ->all ();
Original file line number Diff line number Diff line change 8
8
use Omnipay \Common \Exception \RuntimeException ;
9
9
use Symfony \Component \HttpFoundation \RedirectResponse as HttpRedirectResponse ;
10
10
use Symfony \Component \HttpFoundation \Response as HttpResponse ;
11
+ use Symfony \Component \HttpFoundation \Response ;
11
12
12
13
/**
13
14
* Abstract Response
@@ -174,14 +175,15 @@ public function redirect()
174
175
}
175
176
176
177
/**
177
- * @return HttpRedirectResponse
178
+ * @return HttpRedirectResponse|HttpResponse
178
179
*/
179
180
public function getRedirectResponse ()
180
181
{
181
182
if (!$ this instanceof RedirectResponseInterface || !$ this ->isRedirect ()) {
182
183
throw new RuntimeException ('This response does not support redirection. ' );
183
184
}
184
185
186
+ /** @var $this RedirectResponseInterface */
185
187
if ('GET ' === $ this ->getRedirectMethod ()) {
186
188
return HttpRedirectResponse::create ($ this ->getRedirectUrl ());
187
189
} elseif ('POST ' === $ this ->getRedirectMethod ()) {
Original file line number Diff line number Diff line change @@ -72,10 +72,10 @@ class Omnipay
72
72
public static function getFactory ()
73
73
{
74
74
if (is_null (static ::$ factory )) {
75
- static ::$ factory = new GatewayFactory ;
75
+ self ::$ factory = new GatewayFactory ;
76
76
}
77
77
78
- return static ::$ factory ;
78
+ return self ::$ factory ;
79
79
}
80
80
81
81
/**
@@ -85,7 +85,7 @@ public static function getFactory()
85
85
*/
86
86
public static function setFactory (GatewayFactory $ factory = null )
87
87
{
88
- static ::$ factory = $ factory ;
88
+ self ::$ factory = $ factory ;
89
89
}
90
90
91
91
/**
@@ -111,7 +111,7 @@ public static function setFactory(GatewayFactory $factory = null)
111
111
*/
112
112
public static function __callStatic ($ method , $ parameters )
113
113
{
114
- $ factory = static ::getFactory ();
114
+ $ factory = self ::getFactory ();
115
115
116
116
return call_user_func_array (array ($ factory , $ method ), $ parameters );
117
117
}
You can’t perform that action at this time.
0 commit comments