Completed
Pull Request — master (#20)
by Anatoliy
18:45 queued 08:46
created

StringTypeMock   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSample() 0 20 2
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
}