4
Size: a a a
4
Gt
257 =>
array (size=8)
'number' => string '1.3' (length=3)
'text' => string 'The provision, specification and arrangements of the fire fighters' outfits including its self-contained compressed air breathing apparatus, emergency escape breathing devices (EEBDs), on board means of recharging breathing apparatus cylinders used during drills or a suitable number of spare cylinders to replace those used, and provision of two- way portable radiotelephone apparatus of an explosion-proof type or intrinsically safe, have been checked.' (length=455)
'reference' => string 'SOLAS 74/00/12regs.II-2/10.10, 13.3.4; 13.4.3 and15.2.2; FSSC ch.3) SOLAS 74/88 reg.II-2/17; BCH Code ch.III Part E' (length=115)
'remarkable' => string '1' (length=1)
'criteria' => string '{"vessel_type_id":null,"keel_laid_constraint":null,"keel_laid":null,"gross_tonnage_constraint":null,"gross_tonnage":["",""],"dwt_constraint":null,"dwt":["",""],"freeboard_length_constraint":null,"freeboard_length":["",""],"length_overall_constraint":null,"length_overall":["",""],"flag":null}' (length=292)
'scopes' => string '[]' (length=2)
'answers' => string '[]' (length=2)
'type' => string 'App\Models\SurveyQuestion' (length=25)
KN
4
А
Gt
А
4
4
OΜ
/**#php #codereview #performance
* @param $class
* @param mixed ...$args
* @return mixed
* @throws \ReflectionException
*/
public static function call($class, ...$args)
{
$method = $args[0]['method'] ?? null;
$params = $args[0]['params'] ?? null;
if(class_exists($class)) {
$object = new $class;
if(!$method) {
return new $class($params);
} else if(method_exists($object, $method)) {
$reflectionMethod = new \ReflectionMethod($object, $method);
if($reflectionMethod->isStatic()) {
return call_user_func([$object, $method, $params]);
} else {
return $object->{$method}($params);
}
}
throw new \Exception("Method '$method' doesn't exists in ".get_class($object)." class");
} else if(!class_exists($class)) {
throw new \Exception("Class '$class' doesn't exists");
} else {
throw new \Exception("Oops... Something went wrong!");
}
}
4
S
D
D
S
D
D
S
R#
S