for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace JoisarJignesh\Bigbluebutton\Services;
use BigBlueButton\Parameters\HooksCreateParameters;
use BigBlueButton\Parameters\HooksDestroyParameters;
trait initHooks
{
/**
* @param array $parameters
*
* require fields
* callbackURL
* optional fields
* meetingID
* getRaw
* @return HooksCreateParameters
*/
public function initHooksCreate(array $parameters)
$parameters = Fluent($parameters);
$hooksCreate = new HooksCreateParameters($parameters->get('callbackURL'));
if ($parameters->meetingID) {
$hooksCreate->setMeetingId($parameters->meetingID);
}
$hooksCreate->setGetRaw($parameters->get('getRaw', false));
return $hooksCreate;
* @param mixed $parameters
* @return HooksDestroyParameters
public function initHooksDestroy($parameters)
$hooksID = "";
$hooksID
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
$myVar = 'Value'; $higher = false; if (rand(1, 6) > 3) { $higher = true; } else { $higher = false; }
Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.
$myVar
$higher
if (is_array($parameters)) {
$hooksID = Fluent($parameters)->get('hooksID');
} else {
$hooksID = $parameters;
return new HooksDestroyParameters($hooksID);
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.