Failed Conditions
Push — develop ( 0669ed...0eccc5 )
by Reüel
05:00
created

src/XML/IDealIssuersResponseMessage.php (1 issue)

1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\MultiSafepay\XML;
4
5
use Pronamic\WordPress\Pay\Core\XML\Security;
6
use SimpleXMLElement;
7
8
/**
9
 * Title: MultiSafepay Connect XML iDEAL issuers response message
10
 * Description:
11
 * Copyright: 2005-2021 Pronamic
12
 * Company: Pronamic
13
 *
14
 * @author  Remco Tolsma
15
 * @version 2.0.2
16
 * @since   1.2.0
17
 */
18
class IDealIssuersResponseMessage {
19
	/**
20
	 * Parse the specified XML element into an iDEAL transaction object
21
	 *
22
	 * @param SimpleXMLElement $xml
23
	 *
24
	 * @return IDealIssuersResponseMessage
25
	 */
26 2
	public static function parse( SimpleXMLElement $xml ) {
27 2
		$message = new IDealIssuersResponseMessage();
28
29 2
		$message->issuers = array();
0 ignored issues
show
Bug Best Practice introduced by Remco Tolsma
The property issuers does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
30
31 2
		foreach ( $xml->issuers->issuer as $issuer ) {
32 2
			$code        = Security::filter( $issuer->code );
33 2
			$description = Security::filter( $issuer->description );
34
35 2
			$message->issuers[ $code ] = $description;
36
		}
37
38 2
		return $message;
39
	}
40
}
41