SerialGenerator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateSerial() 0 19 4
1
<?php
2
/* 
3
	Author: Irfa Ardiansyah <[email protected]>
4
*/
5
namespace Irfa\AppLicenseServer\Core;
6
7
use Illuminate\Support\Str;
8
9
class SerialGenerator extends SerialType
10
{
11
	protected function generateSerial()
12
    {
13
    	if(config('irfa.app_license_server.char_type') == "alphanumeric") {
14
15
			return $this->alphanumeric();
16
17
    	} elseif(config('irfa.app_license_server.char_type') == "numeric") {
18
19
			return $this->numeric();
20
21
    	} 
22
    	elseif(config('irfa.app_license_server.char_type') == "alphabet") {
23
24
    		return $this->alphabet();
25
26
		} else {
27
			throw new \Exception('\''.config('irfa.app_license_server.char_type').'\' is not supported, supported char type : alphanumeric, numeric, or alphabet');
28
29
			return false;
0 ignored issues
show
Unused Code introduced by
return false is not reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
30
		}
31
      
32
    }
33
34
}