StringSupplier::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Graphp\Util;
4
5
/**
6
 * Class StringSupplier
7
 *
8
 * @package Graphp\Util
9
 */
10
class StringSupplier implements SupplierInterface
11
{
12
    /**
13
     * Supplier value
14
     *
15
     * @var int
16
     */
17
    private static $i = 0;
18
19
    /**
20
     * Construct supplier value
21
     *
22
     * @param int $start - starting value
23
     */
24 1
    public function __construct(int $start)
25
    {
26 1
        self::$i = $start;
27 1
    }
28
29
    /**
30
     * Get supplier value
31
     *
32
     * @return int
33
     */
34 1
    public function get(): string
35
    {
36 1
        return (string) self::$i++;
0 ignored issues
show
Bug Best Practice introduced by
The expression return (string)PostIncNode returns the type string which is incompatible with the documented return type integer.
Loading history...
37
    }
38
}
39