Conditions | 4 |
Paths | 4 |
Total Lines | 35 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
88 | public function order_direct( array $data = array() ) { |
||
89 | $order_response = false; |
||
90 | |||
91 | $result = Util::remote_get_body( |
||
92 | $this->api_url, |
||
93 | 200, |
||
94 | array( |
||
95 | 'method' => 'POST', |
||
96 | 'sslverify' => false, |
||
97 | 'body' => $data, |
||
98 | ) |
||
99 | ); |
||
100 | |||
101 | if ( is_wp_error( $result ) ) { |
||
102 | $this->error = $result; |
||
103 | } else { |
||
104 | $xml = Util::simplexml_load_string( $result ); |
||
105 | |||
106 | if ( is_wp_error( $xml ) ) { |
||
107 | $this->error = $xml; |
||
|
|||
108 | } else { |
||
109 | $order_response = OrderResponseParser::parse( $xml ); |
||
110 | |||
111 | if ( ! empty( $order_response->nc_error ) ) { |
||
112 | $ogone_error = new Error( |
||
113 | Security::filter( $order_response->nc_error ), |
||
114 | Security::filter( $order_response->nc_error_plus ) |
||
115 | ); |
||
116 | |||
117 | $this->error = new WP_Error( 'ogone_error', (string) $ogone_error, $ogone_error ); |
||
118 | } |
||
119 | } |
||
120 | } |
||
121 | |||
122 | return $order_response; |
||
123 | } |
||
125 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..