Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
StringableFaker
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 supports
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 fakeFor
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Faker\Fakers;
3
4use Apie\Core\ValueObjects\BinaryStream;
5use Apie\Faker\Interfaces\ApieClassFaker;
6use Faker\Generator;
7use ReflectionClass;
8use Stringable;
9
10/** @implements ApieClassFaker<Stringable> */
11class 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}