Passed
Push — master ( d17173...2c21ba )
by Pieter
05:43
created

NameGenerator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A generate() 0 3 1
A generateWithSuffix() 0 3 1
1
<?php
2
3
namespace Avoran\RapidoAdapter\DoctrineDbalStorage;
4
5
class NameGenerator
6
{
7
    private $prefix;
8
    private $suffix;
9
10
    public function __construct($prefix, $suffix)
11
    {
12
        $this->prefix = $prefix;
13
        $this->suffix = $suffix;
14
    }
15
16
    public function generate($id)
17
    {
18
        return $this->prefix . (string) $id;
19
    }
20
21
    public function generateWithSuffix($id)
22
    {
23
        return $this->generate($id) . $this->suffix;
24
    }
25
}
26