Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
14.29% |
1 / 7 |
|
14.29% |
1 / 7 |
CRAP | |
0.00% |
0 / 1 |
| Domain | |
14.29% |
1 / 7 |
|
14.29% |
1 / 7 |
37.86 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| get_domain | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_slug | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_status | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_date_time | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_version | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_environment | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | // "domain": "", |
| 4 | // "slug": "a-plugin", |
| 5 | // "status": "active", |
| 6 | // "date_time": 1716840810, |
| 7 | // "version": null, |
| 8 | // "environment": "staging" |
| 9 | // } |
| 10 | |
| 11 | namespace BrianHenryIE\WP_Plugin_Updater\Integrations\SLSWC\Model; |
| 12 | |
| 13 | class Domain { |
| 14 | |
| 15 | public function __construct( |
| 16 | protected string $domain, |
| 17 | protected string $slug, |
| 18 | protected string $status, |
| 19 | protected int $date_time, |
| 20 | protected ?string $version, |
| 21 | protected string $environment |
| 22 | ) { |
| 23 | } |
| 24 | |
| 25 | public function get_domain(): string { |
| 26 | return $this->domain; |
| 27 | } |
| 28 | |
| 29 | public function get_slug(): string { |
| 30 | return $this->slug; |
| 31 | } |
| 32 | |
| 33 | public function get_status(): string { |
| 34 | return $this->status; |
| 35 | } |
| 36 | |
| 37 | public function get_date_time(): \DateTimeInterface { |
| 38 | return new \DateTimeImmutable( '@' . $this->date_time ); |
| 39 | } |
| 40 | |
| 41 | public function get_version(): ?string { |
| 42 | return $this->version; |
| 43 | } |
| 44 | |
| 45 | public function get_environment(): string { |
| 46 | return $this->environment; |
| 47 | } |
| 48 | } |