Failed Conditions
Push — feature/post-pay ( 92fd8e...3640bb )
by Remco
04:42
created
src/Util.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 * $            Dollar
62 62
 	 */
63 63
 	public static function get_pattern() {
64
-		if ( null === self::$pattern ) {
64
+		if (null === self::$pattern) {
65 65
 			$characters = array(
66 66
 				'A-Z',
67 67
 				'a-z',
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			 * We use a # as a regex delimiter instead of a / so we don't have to escape the slash.
91 91
 			 * @see http://stackoverflow.com/q/12239424
92 92
 			 */
93
-			self::$pattern = '#[^' . implode( $characters ) . ']#';
93
+			self::$pattern = '#[^' . implode($characters) . ']#';
94 94
 		}
95 95
 
96 96
 		return self::$pattern;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @param string $string String to filter.
103 103
 	 * @return mixed
104 104
 	 */
105
-	public static function filter( $string ) {
106
-		return preg_replace( self::get_pattern(), '', $string );
105
+	public static function filter($string) {
106
+		return preg_replace(self::get_pattern(), '', $string);
107 107
 	}
108 108
 }
Please login to merge, or discard this patch.
src/Error.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	 * @param string $code    Code.
42 42
 	 * @param string $message Message.
43 43
 	 */
44
-	public function __construct( $code, $message ) {
44
+	public function __construct($code, $message) {
45 45
 		$this->code    = $code;
46 46
 		$this->message = $message;
47 47
 	}
Please login to merge, or discard this patch.
src/Methods.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -192,13 +192,13 @@
 block discarded – undo
192 192
 	 * @param string|null $default        Value to return if method could not be transformed.
193 193
 	 * @return string|null
194 194
 	 */
195
-	public static function transform( $payment_method, $default = null ) {
196
-		if ( ! is_scalar( $payment_method ) ) {
195
+	public static function transform($payment_method, $default = null) {
196
+		if ( ! is_scalar($payment_method)) {
197 197
 			return null;
198 198
 		}
199 199
 
200
-		if ( isset( self::$map[ $payment_method ] ) ) {
201
-			return self::$map[ $payment_method ];
200
+		if (isset(self::$map[$payment_method])) {
201
+			return self::$map[$payment_method];
202 202
 		}
203 203
 
204 204
 		return $default;
Please login to merge, or discard this patch.
src/XML/Parser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
 	 *
29 29
 	 * @param SimpleXMLElement $xml XML element to parse.
30 30
 	 */
31
-	public static function parse( SimpleXMLElement $xml );
31
+	public static function parse(SimpleXMLElement $xml);
32 32
 }
Please login to merge, or discard this patch.
src/XML/TransactionParser.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -33,57 +33,57 @@
 block discarded – undo
33 33
 	 * @param SimpleXMLElement $xml XML element to parse.
34 34
 	 * @return Transaction
35 35
 	 */
36
-	public static function parse( SimpleXMLElement $xml ) {
36
+	public static function parse(SimpleXMLElement $xml) {
37 37
 		$transaction = new Transaction();
38 38
 
39 39
 		// Transaction request.
40
-		if ( isset( $xml->trxid ) ) {
41
-			$transaction->id = Security::filter( $xml->trxid );
40
+		if (isset($xml->trxid)) {
41
+			$transaction->id = Security::filter($xml->trxid);
42 42
 		}
43 43
 
44
-		if ( isset( $xml->issuerurl ) ) {
45
-			$transaction->issuer_url = urldecode( Security::filter( $xml->issuerurl ) );
44
+		if (isset($xml->issuerurl)) {
45
+			$transaction->issuer_url = urldecode(Security::filter($xml->issuerurl));
46 46
 		}
47 47
 
48 48
 		// Status response.
49
-		if ( isset( $xml->status ) ) {
50
-			$transaction->status = Security::filter( $xml->status );
49
+		if (isset($xml->status)) {
50
+			$transaction->status = Security::filter($xml->status);
51 51
 		}
52 52
 
53
-		if ( isset( $xml->amount ) ) {
54
-			$transaction->amount = Pay_Util::cents_to_amount( Security::filter( $xml->amount ) );
53
+		if (isset($xml->amount)) {
54
+			$transaction->amount = Pay_Util::cents_to_amount(Security::filter($xml->amount));
55 55
 		}
56 56
 
57
-		if ( isset( $xml->purchaseid ) ) {
58
-			$transaction->purchase_id = Security::filter( $xml->purchaseid );
57
+		if (isset($xml->purchaseid)) {
58
+			$transaction->purchase_id = Security::filter($xml->purchaseid);
59 59
 		}
60 60
 
61
-		if ( isset( $xml->description ) ) {
62
-			$transaction->description = Security::filter( $xml->description );
61
+		if (isset($xml->description)) {
62
+			$transaction->description = Security::filter($xml->description);
63 63
 		}
64 64
 
65
-		if ( isset( $xml->entrancecode ) ) {
66
-			$transaction->entrance_code = Security::filter( $xml->entrancecode );
65
+		if (isset($xml->entrancecode)) {
66
+			$transaction->entrance_code = Security::filter($xml->entrancecode);
67 67
 		}
68 68
 
69
-		if ( isset( $xml->issuerid ) ) {
70
-			$transaction->issuer_id = Security::filter( $xml->issuerid );
69
+		if (isset($xml->issuerid)) {
70
+			$transaction->issuer_id = Security::filter($xml->issuerid);
71 71
 		}
72 72
 
73
-		if ( isset( $xml->timestamp ) ) {
74
-			$transaction->timestamp = new DateTime( Security::filter( $xml->timestamp ) );
73
+		if (isset($xml->timestamp)) {
74
+			$transaction->timestamp = new DateTime(Security::filter($xml->timestamp));
75 75
 		}
76 76
 
77
-		if ( isset( $xml->consumername ) ) {
78
-			$transaction->consumer_name = Security::filter( $xml->consumername );
77
+		if (isset($xml->consumername)) {
78
+			$transaction->consumer_name = Security::filter($xml->consumername);
79 79
 		}
80 80
 
81
-		if ( isset( $xml->consumeraccount ) ) {
82
-			$transaction->consumer_account = Security::filter( $xml->consumeraccount );
81
+		if (isset($xml->consumeraccount)) {
82
+			$transaction->consumer_account = Security::filter($xml->consumeraccount);
83 83
 		}
84 84
 
85
-		if ( isset( $xml->consumercity ) ) {
86
-			$transaction->consumer_city = Security::filter( $xml->consumercity );
85
+		if (isset($xml->consumercity)) {
86
+			$transaction->consumer_city = Security::filter($xml->consumercity);
87 87
 		}
88 88
 
89 89
 		return $transaction;
Please login to merge, or discard this patch.
src/XML/ErrorParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 	 *
31 31
 	 * @param SimpleXMLElement $xml XML element to parse.
32 32
 	 */
33
-	public static function parse( SimpleXMLElement $xml ) {
33
+	public static function parse(SimpleXMLElement $xml) {
34 34
 		$error = new Sisow_Error(
35
-			Security::filter( $xml->errorcode ),
36
-			Security::filter( $xml->errormessage )
35
+			Security::filter($xml->errorcode),
36
+			Security::filter($xml->errormessage)
37 37
 		);
38 38
 
39 39
 		return $error;
Please login to merge, or discard this patch.
src/Settings.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	 * Construct settings.
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_filter( 'pronamic_pay_gateway_sections', array( $this, 'sections' ) );
31
-		add_filter( 'pronamic_pay_gateway_fields', array( $this, 'fields' ) );
30
+		add_filter('pronamic_pay_gateway_sections', array($this, 'sections'));
31
+		add_filter('pronamic_pay_gateway_fields', array($this, 'fields'));
32 32
 	}
33 33
 
34 34
 	/**
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 	 * @param array $sections Sections.
38 38
 	 * @return array
39 39
 	 */
40
-	public function sections( array $sections ) {
40
+	public function sections(array $sections) {
41 41
 		// Sisow.
42 42
 		$sections['sisow'] = array(
43
-			'title'       => __( 'Sisow', 'pronamic_ideal' ),
44
-			'methods'     => array( 'sisow' ),
43
+			'title'       => __('Sisow', 'pronamic_ideal'),
44
+			'methods'     => array('sisow'),
45 45
 			'description' => sprintf(
46 46
 				/* translators: %s: Sisow */
47
-				__( 'Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal' ),
48
-				__( 'Sisow', 'pronamic_ideal' )
47
+				__('Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal'),
48
+				__('Sisow', 'pronamic_ideal')
49 49
 			),
50 50
 		);
51 51
 
@@ -58,55 +58,55 @@  discard block
 block discarded – undo
58 58
 	 * @param array $fields Fields.
59 59
 	 * @return array
60 60
 	 */
61
-	public function fields( array $fields ) {
61
+	public function fields(array $fields) {
62 62
 		// Merchant ID.
63 63
 		$fields[] = array(
64 64
 			'filter'   => FILTER_SANITIZE_STRING,
65 65
 			'section'  => 'sisow',
66
-			'methods'  => array( 'sisow' ),
66
+			'methods'  => array('sisow'),
67 67
 			'meta_key' => '_pronamic_gateway_sisow_merchant_id',
68
-			'title'    => _x( 'Merchant ID', 'sisow', 'pronamic_ideal' ),
68
+			'title'    => _x('Merchant ID', 'sisow', 'pronamic_ideal'),
69 69
 			'type'     => 'text',
70
-			'classes'  => array( 'code' ),
71
-			'tooltip'  => __( 'Merchant ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
70
+			'classes'  => array('code'),
71
+			'tooltip'  => __('Merchant ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
72 72
 		);
73 73
 
74 74
 		// Merchant Key.
75 75
 		$fields[] = array(
76 76
 			'filter'   => FILTER_SANITIZE_STRING,
77 77
 			'section'  => 'sisow',
78
-			'methods'  => array( 'sisow' ),
78
+			'methods'  => array('sisow'),
79 79
 			'meta_key' => '_pronamic_gateway_sisow_merchant_key',
80
-			'title'    => _x( 'Merchant Key', 'sisow', 'pronamic_ideal' ),
80
+			'title'    => _x('Merchant Key', 'sisow', 'pronamic_ideal'),
81 81
 			'type'     => 'text',
82
-			'classes'  => array( 'regular-text', 'code' ),
83
-			'tooltip'  => __( 'Merchant Key as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
82
+			'classes'  => array('regular-text', 'code'),
83
+			'tooltip'  => __('Merchant Key as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
84 84
 		);
85 85
 
86 86
 		// Shop ID.
87 87
 		$fields[] = array(
88 88
 			'filter'      => FILTER_SANITIZE_STRING,
89 89
 			'section'     => 'sisow',
90
-			'methods'     => array( 'sisow' ),
90
+			'methods'     => array('sisow'),
91 91
 			'meta_key'    => '_pronamic_gateway_sisow_shop_id',
92
-			'title'       => _x( 'Shop ID', 'sisow', 'pronamic_ideal' ),
92
+			'title'       => _x('Shop ID', 'sisow', 'pronamic_ideal'),
93 93
 			'type'        => 'text',
94
-			'classes'     => array( 'regular-text', 'code' ),
95
-			'tooltip'     => __( 'Shop ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
94
+			'classes'     => array('regular-text', 'code'),
95
+			'tooltip'     => __('Shop ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
96 96
 			/* translators: %s: 0 */
97
-			'description' => sprintf( __( 'Default: <code>%s</code>', 'pronamic_ideal' ), 0 ),
97
+			'description' => sprintf(__('Default: <code>%s</code>', 'pronamic_ideal'), 0),
98 98
 			'default'     => 0,
99 99
 		);
100 100
 
101 101
 		// Transaction feedback.
102 102
 		$fields[] = array(
103 103
 			'section' => 'sisow',
104
-			'methods' => array( 'sisow' ),
105
-			'title'   => __( 'Transaction feedback', 'pronamic_ideal' ),
104
+			'methods' => array('sisow'),
105
+			'title'   => __('Transaction feedback', 'pronamic_ideal'),
106 106
 			'type'    => 'description',
107 107
 			'html'    => sprintf(
108 108
 				'<span class="dashicons dashicons-yes"></span> %s',
109
-				__( 'Payment status updates will be processed without any additional configuration.', 'pronamic_ideal' )
109
+				__('Payment status updates will be processed without any additional configuration.', 'pronamic_ideal')
110 110
 			),
111 111
 		);
112 112
 
Please login to merge, or discard this patch.
src/ConfigFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@
 block discarded – undo
29 29
 	 * @param int $post_id Post ID.
30 30
 	 * @return Config
31 31
 	 */
32
-	public function get_config( $post_id ) {
32
+	public function get_config($post_id) {
33 33
 		$config = new Config();
34 34
 
35
-		$config->merchant_id  = $this->get_meta( $post_id, 'sisow_merchant_id' );
36
-		$config->merchant_key = $this->get_meta( $post_id, 'sisow_merchant_key' );
37
-		$config->shop_id      = $this->get_meta( $post_id, 'sisow_shop_id' );
38
-		$config->mode         = $this->get_meta( $post_id, 'mode' );
35
+		$config->merchant_id  = $this->get_meta($post_id, 'sisow_merchant_id');
36
+		$config->merchant_key = $this->get_meta($post_id, 'sisow_merchant_key');
37
+		$config->shop_id      = $this->get_meta($post_id, 'sisow_shop_id');
38
+		$config->mode         = $this->get_meta($post_id, 'mode');
39 39
 
40 40
 		return $config;
41 41
 	}
Please login to merge, or discard this patch.
src/TransactionRequest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,24 +31,24 @@
 block discarded – undo
31 31
 	 */
32 32
 	public function get_signature_data() {
33 33
 		return array(
34
-			$this->get_parameter( 'purchaseid' ),
34
+			$this->get_parameter('purchaseid'),
35 35
 
36 36
 			/*
37 37
 			 * Wordt er geen gebruik gemaakt van de entrancecode dan dient er twee keer de purchaseid te worden opgenomen, u krijgt dan onderstaande volgorde.
38 38
 			 * purchaseid/purchaseid/amount/shopid/merchantid/merchantkey
39 39
 			 */
40
-			null !== $this->get_parameter( 'entrancecode' ) ? $this->get_parameter( 'entrancecode' ) : $this->get_parameter( 'purchaseid' ),
40
+			null !== $this->get_parameter('entrancecode') ? $this->get_parameter('entrancecode') : $this->get_parameter('purchaseid'),
41 41
 
42
-			$this->get_parameter( 'amount' ),
42
+			$this->get_parameter('amount'),
43 43
 
44 44
 			/*
45 45
 			 * Indien er geen gebruik wordt gemaakt van de shopid dan kunt u deze weglaten uit de berekening.
46 46
 			 */
47
-			$this->get_parameter( 'shopid' ),
47
+			$this->get_parameter('shopid'),
48 48
 
49
-			$this->get_parameter( 'merchantid' ),
49
+			$this->get_parameter('merchantid'),
50 50
 
51
-			$this->get_parameter( 'merchantkey' ),
51
+			$this->get_parameter('merchantkey'),
52 52
 		);
53 53
 	}
54 54
 }
Please login to merge, or discard this patch.