Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| StringableFaker | |
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\Core\ValueObjects\BinaryStream; |
| 5 | use Apie\Faker\Interfaces\ApieClassFaker; |
| 6 | use Faker\Generator; |
| 7 | use ReflectionClass; |
| 8 | use Stringable; |
| 9 | |
| 10 | /** @implements ApieClassFaker<Stringable> */ |
| 11 | class StringableFaker implements ApieClassFaker |
| 12 | { |
| 13 | public function supports(ReflectionClass $class): bool |
| 14 | { |
| 15 | return $class->name === Stringable::class; |
| 16 | } |
| 17 | |
| 18 | public function fakeFor(Generator $generator, ReflectionClass $class): object |
| 19 | { |
| 20 | return new BinaryStream($generator->text()); |
| 21 | } |
| 22 | } |