Subscription
1 year ago
PaymentGatewayInterface.php
2 years ago
PaymentGatewaysIterator.php
3 years ago
SubscriptionModuleInterface.php
1 year ago
PaymentGatewaysIterator.php
59 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 | #[\ReturnTypeWillChange] |
| 16 | public function current() |
| 17 | { |
| 18 | return current($this->gateways); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @since 2.18.0 |
| 23 | */ |
| 24 | #[\ReturnTypeWillChange] |
| 25 | public function next() |
| 26 | { |
| 27 | next($this->gateways); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * @since 2.18.0 |
| 32 | * @return string |
| 33 | */ |
| 34 | #[\ReturnTypeWillChange] |
| 35 | public function key() |
| 36 | { |
| 37 | return key($this->gateways); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * @since 2.18.0 |
| 42 | * @return bool |
| 43 | */ |
| 44 | #[\ReturnTypeWillChange] |
| 45 | public function valid() |
| 46 | { |
| 47 | return key($this->gateways) !== null; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @since 2.18.0 |
| 52 | */ |
| 53 | #[\ReturnTypeWillChange] |
| 54 | public function rewind() |
| 55 | { |
| 56 | reset($this->gateways); |
| 57 | } |
| 58 | } |
| 59 |