Code Duplication    Length = 12-12 lines in 20 locations

src/Model/Account/AccountCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class AccountCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Account::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Balance/BalanceTransactionCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class BalanceTransactionCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = BalanceTransaction::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/BankAccount/BankAccountCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class BankAccountCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = BankAccount::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Card/CardCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class CardCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Card::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Charge/ChargeCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class ChargeCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Charge::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Coupon/CouponCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class CouponCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Coupon::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Customer/CustomerCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class CustomerCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Customer::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Invoice/InvoiceCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class InvoiceCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Invoice::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Invoice/LineItemCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class LineItemCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = LineItem::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/PaymentIntent/PaymentIntentCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class PaymentIntentCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = PaymentIntent::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Plan/PlanCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class PlanCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Plan::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Product/ProductCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class ProductCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Product::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Refund/RefundCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class RefundCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Refund::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/SetupIntent/SetupIntentCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class SetupIntentCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = SetupIntent::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Source/SourceCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class SourceCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Source::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Subscription/ItemCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class ItemCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Item::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Subscription/SubscriptionCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class SubscriptionCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Subscription::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/TaxRate/TaxRateCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class TaxRateCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = TaxRate::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Transfer/TransferCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class TransferCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = Transfer::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26

src/Model/Transfer/TransferReversalCollection.php 1 location

@@ 14-25 (lines=12) @@
11
12
use Shapin\Stripe\Model\Collection;
13
14
final class TransferReversalCollection extends Collection
15
{
16
    public static function createFromArray(array $data): self
17
    {
18
        $elements = [];
19
        foreach ($data['data'] as $element) {
20
            $elements[] = TransferReversal::createFromArray($element);
21
        }
22
23
        return new self($elements, $data['has_more']);
24
    }
25
}
26