for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace JoisarJignesh\Bigbluebutton\Services;
use BigBlueButton\Parameters\IsMeetingRunningParameters;
trait initExtra
{
/**
* Check if connection to api can be established with the end point url and secret
*
* @return array connection successful
*/
private function initIsConnect()
if (!filter_var(config('bigbluebutton.BBB_SERVER_BASE_URL'), FILTER_VALIDATE_URL)) {
return [
'flag' => false,
'message' => 'invalid url'
];
}
try {
$response = $this->bbb->isMeetingRunning(
bbb
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
new IsMeetingRunningParameters('connection_check')
);
// url and secret working
if ($response->success()) {
return ['flag' => true];
// Checksum error - invalid secret
if ($response->failed() && $response->getMessageKey() == "checksumError") {
'message' => 'invalid secret key'
// HTTP exception or XML parse
} catch (\Exception $e) {
'message' => 'invalid url and secret key'
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: