Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
NonEmptyString
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 getRegularExpression
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 convert
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 createRandom
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Core\ValueObjects;
3
4use Apie\Core\Attributes\FakeMethod;
5use Apie\Core\Attributes\ProvideIndex;
6use Apie\Core\ValueObjects\Concerns\IndexesWords;
7use Apie\Core\ValueObjects\Interfaces\HasRegexValueObjectInterface;
8use Faker\Generator;
9
10#[FakeMethod('createRandom')]
11#[ProvideIndex('getIndexes')]
12class NonEmptyString implements HasRegexValueObjectInterface
13{
14    use IndexesWords;
15    use IsStringWithRegexValueObject;
16
17    public static function getRegularExpression(): string
18    {
19        return '/^.+$/s';
20    }
21
22    protected function convert(string $input): string
23    {
24        return trim($input);
25    }
26
27    public static function createRandom(Generator $generator): self
28    {
29        return static::fromNative($generator->realText(1024));
30    }
31}