Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| UriFaker | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| supports | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| fakeFor | |
100.00% |
1 / 1 |
|
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 ReflectionClass; |
| 7 | use Uri\Rfc3986\Uri; |
| 8 | |
| 9 | /** @implements ApieClassFaker<Uri> */ |
| 10 | class UriFaker implements ApieClassFaker |
| 11 | { |
| 12 | public function supports(ReflectionClass $class): bool |
| 13 | { |
| 14 | return $class->name === Uri::class; |
| 15 | } |
| 16 | |
| 17 | public function fakeFor(Generator $generator, ReflectionClass $class): Uri |
| 18 | { |
| 19 | return new Uri($generator->url()); |
| 20 | } |
| 21 | } |