SerialNumber   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A generate() 0 4 1
A setConfig() 0 4 1
A __construct() 0 5 2
1
<?php
2
/*
3
    Serial Number Generator
4
    @author: Irfa Ardiansyah <[email protected]>
5
    @version: 1.1
6
*/
7
namespace Irfa\SerialNumber\Func;
8
9
use Irfa\SerialNumber\Core\SN;
10
11
class SerialNumber extends SN
12
{
13
    private array $config=[];
14
    function __construct(array $config=null)
15
    {
16
      if(!empty($config))
17
      {
18
        $this->setConfig($config);
19
      }
20
    }
21
    public function generate($json_return = false)
22
    {
23
        $sn = new SN($this->config);
24
        return $sn->generateSN($json_return);
25
    }
26
27
    public function setConfig(array $config)
28
    {
29
        $this->config = $config;
30
        return $this;
31
    }
32
33
}
34