Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| GmpFaker | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| supports | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| fakeFor | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Faker\Fakers; |
| 3 | |
| 4 | use Apie\Faker\Interfaces\ApieClassFaker; |
| 5 | use Faker\Generator; |
| 6 | use GMP; |
| 7 | use ReflectionClass; |
| 8 | |
| 9 | /** @implements ApieClassFaker<GMP> */ |
| 10 | class GmpFaker implements ApieClassFaker |
| 11 | { |
| 12 | public function supports(ReflectionClass $class): bool |
| 13 | { |
| 14 | return $class->name === GMP::class; |
| 15 | } |
| 16 | |
| 17 | public function fakeFor(Generator $generator, ReflectionClass $class): GMP |
| 18 | { |
| 19 | $value = (string) $generator->randomNumber(5, true); |
| 20 | |
| 21 | return new GMP($value, 10); |
| 22 | } |
| 23 | } |