Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
75.00% |
3 / 4 |
| Factory | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
3.14 | |
75.00% |
3 / 4 |
| handle | |
0.00% |
0 / 1 |
3.14 | |
75.00% |
3 / 4 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Qmp\Laravel\Tracker\Services\DeployData; |
| 4 | |
| 5 | use Illuminate\Database\Eloquent\Collection; |
| 6 | use Qmp\Laravel\Tracker\Services\DeployData\Senders\FakerSender; |
| 7 | use Qmp\Laravel\Tracker\Services\DeployData\Senders\SenderInterface; |
| 8 | use Qmp\Laravel\Tracker\Services\DeployData\Senders\TagConfigSender; |
| 9 | |
| 10 | class Factory |
| 11 | { |
| 12 | /** |
| 13 | * @param $type |
| 14 | * @param Collection $config |
| 15 | * @return SenderInterface |
| 16 | */ |
| 17 | static public function handle($type, Collection $config): SenderInterface |
| 18 | { |
| 19 | switch($type) { |
| 20 | case 'tag-config': |
| 21 | return new TagConfigSender($config); |
| 22 | default: |
| 23 | return new FakerSender($config); |
| 24 | } |
| 25 | } |
| 26 | } |