Subscription
3 years ago
PaymentGatewayInterface.php
3 years ago
PaymentGatewaysIterator.php
4 years ago
SubscriptionModuleInterface.php
3 years ago
PaymentGatewaysIterator.php
54 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Framework\PaymentGateways\Contracts; |
| 4 | |
| 5 | /** |
| 6 | * @since 2.18.0 |
| 7 | * @property-read array $gateways |
| 8 | */ |
| 9 | class PaymentGatewaysIterator implements \Iterator |
| 10 | { |
| 11 | /** |
| 12 | * @since 2.18.0 |
| 13 | * @return string |
| 14 | */ |
| 15 | public function current() |
| 16 | { |
| 17 | return current($this->gateways); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * @since 2.18.0 |
| 22 | */ |
| 23 | public function next() |
| 24 | { |
| 25 | next($this->gateways); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * @since 2.18.0 |
| 30 | * @return string |
| 31 | */ |
| 32 | public function key() |
| 33 | { |
| 34 | return key($this->gateways); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * @since 2.18.0 |
| 39 | * @return bool |
| 40 | */ |
| 41 | public function valid() |
| 42 | { |
| 43 | return key($this->gateways) !== null; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * @since 2.18.0 |
| 48 | */ |
| 49 | public function rewind() |
| 50 | { |
| 51 | reset($this->gateways); |
| 52 | } |
| 53 | } |
| 54 |