1 | <?php |
||
18 | class WC_Shipping_Rate { |
||
19 | |||
20 | /** @var string Rate ID. */ |
||
21 | public $id = ''; |
||
22 | |||
23 | /** @var string Label for the rate. */ |
||
24 | public $label = ''; |
||
25 | |||
26 | /** @var float Cost for the rate. */ |
||
27 | public $cost = 0; |
||
28 | |||
29 | /** @var array Array of taxes for the rate. */ |
||
30 | public $taxes = array(); |
||
31 | |||
32 | /** @var string Label for the rate. */ |
||
33 | public $method_id = ''; |
||
34 | |||
35 | /** |
||
36 | * Stores meta data for this rate |
||
37 | * @since 2.6.0 |
||
38 | * @var array |
||
39 | */ |
||
40 | private $meta_data = array(); |
||
41 | |||
42 | /** |
||
43 | * Constructor. |
||
44 | * |
||
45 | * @param string $id |
||
46 | * @param string $label |
||
47 | * @param integer $cost |
||
48 | * @param array $taxes |
||
49 | * @param string $method_id |
||
50 | */ |
||
51 | public function __construct( $id = '', $label = '', $cost = 0, $taxes = array(), $method_id = '' ) { |
||
58 | |||
59 | /** |
||
60 | * Get shipping tax. |
||
61 | * |
||
62 | * @return array |
||
63 | */ |
||
64 | public function get_shipping_tax() { |
||
67 | |||
68 | /** |
||
69 | * Get label. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function get_label() { |
||
76 | |||
77 | /** |
||
78 | * Add some meta data for this rate. |
||
79 | * @since 2.6.0 |
||
80 | * @param string $key |
||
81 | * @param string $value |
||
82 | */ |
||
83 | public function add_meta_data( $key, $value ) { |
||
86 | |||
87 | /** |
||
88 | * Get all meta data for this rate. |
||
89 | * @since 2.6.0 |
||
90 | */ |
||
91 | public function get_meta_data() { |
||
94 | } |
||
95 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.