Code Duplication    Length = 12-12 lines in 2 locations

src/Generator/Binary/RandomBinaryGenerator.php 1 location

@@ 26-37 (lines=12) @@
23
    /**
24
     * @param int $uid_bitmap_length
25
     */
26
    public function __construct($uid_bitmap_length)
27
    {
28
        if (!is_int($uid_bitmap_length)) {
29
            throw new ArgumentTypeException(sprintf('Length of bitmap for UID should be integer, got "%s" instead.', gettype($uid_bitmap_length)));
30
        }
31
32
        if ($uid_bitmap_length <= 0) {
33
            throw new ZeroArgumentException(sprintf('Length of bitmap for UID should be grate then "0", got "%d" instead.', $uid_bitmap_length));
34
        }
35
36
        $this->uid_bitmap_length = $uid_bitmap_length;
37
    }
38
39
    /**
40
     * @return int

src/Generator/RandomBytesGenerator.php 1 location

@@ 26-37 (lines=12) @@
23
    /**
24
     * @param int $bytes_length
25
     */
26
    public function __construct($bytes_length = 8)
27
    {
28
        if (!is_int($bytes_length)) {
29
            throw new ArgumentTypeException(sprintf('Length of bytes should be integer, got "%s" instead.', gettype($bytes_length)));
30
        }
31
32
        if ($bytes_length <= 0) {
33
            throw new ZeroArgumentException(sprintf('Length of bytes should be grate then "0", got "%d" instead.', $bytes_length));
34
        }
35
36
        $this->bytes_length = $bytes_length;
37
    }
38
39
    /**
40
     * @return string