StringTypeMock::getSample()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 20
rs 9.7666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Created by PhpStorm.
5
 * User: danchukas
6
 * Date: 2017-07-18 08:46
7
 */
8
9
namespace DanchukAS\Mock\Type;
10
11
12
use DanchukAS\Mock\TypeMock;
13
14
/**
15
 * Class StringTypeMock
16
 * @package DanchukAS\Mock\Type
17
 */
18
class StringTypeMock extends TypeMock
19
{
20
    public static $maxSize;
21
22
    /**
23
     * @return \Generator
24
     */
25
    public static function getSample()
26
    {
27
28
        $string_list = [
29
            'empty' => ''
30
            , 'true, cipher' => '1'
31
            , 'false, cipher, empty' => '0'
32
            , 'false, empty' => 'false'
33
            , 'true, 1' => 'true'
34
            , 'single ascii' => 'f'
35
            , 'cyrillic, multiByte(2 byte)' => 'ї'
36
            , 'special' => '0x00'
37
            , 'empty, space, short' => str_repeat(' ', 16)
38
            , 'normal usual' => str_repeat('q', 32)
39
            , 'spec symbols, big' => str_repeat('[]', 64)
40
            , 'spec symbols, huge' => str_repeat("_$~-@\"'\\.!#%^&*()+=/?><,", 10 * 1024)
41
        ];
42
43
        foreach ($string_list as $pattern => $string) {
44
            yield [$pattern => $string];
45
        }
46
47
    }
0 ignored issues
show
Coding Style introduced by
Function closing brace must go on the next line following the body; found 1 blank lines before brace
Loading history...
48
}