Failed Conditions
Push — develop ( 0c4589...6de45b )
by Reüel
24:44 queued 13:15
created

src/AmountTransformer.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Amount transformer
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Adyen
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Adyen;
12
13
use Pronamic\WordPress\Money\Money;
14
15
/**
16
 * Amount transformer
17
 *
18
 * @author  Reüel van der Steege
19
 * @version 1.0.0
20
 * @since   1.0.0
21
 */
22
class AmountTransformer {
23
	/**
24
	 * Transform Pronamic money to Adyen amount.
25
	 *
26
	 * @param Money $money Pronamic money to convert.
27
	 *
28
	 * @return Amount
29
	 */
30
	public static function transform( Money $money ) {
31
		$amount = new Amount(
32
			strval( $money->get_currency()->get_alphabetic_code() ),
33
			intval( $money->get_minor_units() )
0 ignored issues
show
The method get_minor_units() does not exist on Pronamic\WordPress\Money\Money. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
			intval( $money->/** @scrutinizer ignore-call */ get_minor_units() )

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
		);
35
36
		return $amount;
37
	}
38
}
39