Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
3 / 3 |
| AbstractProvider | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
3 / 3 |
| __construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| fake | n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||||
| call | n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||||
| retrieve | |
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
|||
| 1 | <?php |
| 2 | namespace Qmp\Laravel\SiteGeneratorOffers\Retriever; |
| 3 | |
| 4 | |
| 5 | use Illuminate\Support\Collection; |
| 6 | |
| 7 | abstract class AbstractProvider implements InterfaceProvider |
| 8 | { |
| 9 | protected $env; |
| 10 | |
| 11 | public function __construct($env) |
| 12 | { |
| 13 | $this->env = $env; |
| 14 | } |
| 15 | |
| 16 | abstract protected function fake(): Collection; |
| 17 | |
| 18 | abstract protected function call(): Collection; |
| 19 | |
| 20 | public function retrieve(): Collection |
| 21 | { |
| 22 | return $this->env === 'production' ? $this->call() : $this->fake(); |
| 23 | } |
| 24 | |
| 25 | } |