StripeCustomersStore   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 3 1
A setData() 0 5 1
A make() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Digikraaft\StripeCustomersTile;
4
5
use Spatie\Dashboard\Models\Tile;
6
7
class StripeCustomersStore
8
{
9
    private Tile $tile;
10
11
    public static function make()
12
    {
13
        return new static();
14
    }
15
16
    public function __construct()
17
    {
18
        $this->tile = Tile::firstOrCreateForName("stripeCustomers");
19
    }
20
21
    public function setData(array $data): self
22
    {
23
        $this->tile->putData('stripe.customers', $data);
24
25
        return $this;
26
    }
27
28
    public function getData(): array
29
    {
30
        return $this->tile->getData('stripe.customers') ?? [];
31
    }
32
}
33