for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
Author: Irfa Ardiansyah <[email protected]>
*/
namespace Irfa\AppLicenseServer\Core;
use Illuminate\Support\Str;
class SerialGenerator extends SerialType
{
protected function generateSerial()
if(config('irfa.app_license_server.char_type') == "alphanumeric") {
return $this->alphanumeric();
} elseif(config('irfa.app_license_server.char_type') == "numeric") {
return $this->numeric();
}
elseif(config('irfa.app_license_server.char_type') == "alphabet") {
return $this->alphabet();
} else {
throw new \Exception('\''.config('irfa.app_license_server.char_type').'\' is not supported, supported char type : alphanumeric, numeric, or alphabet');
return false;
return false
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.
return
die
exit
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.
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
orexit
statements that have been added for debug purposes.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.