YetiForceCompany/YetiForceCRM

View on GitHub
app/MeetingService.php

Summary

Maintainability
A
0 mins
Test Coverage
F
25%

Missing class import via use statement (line '176', column '16').
Open

                $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Minor
Found in app/MeetingService.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method getUrl has a boolean flag argument $moderator, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getUrl(array $data, ?int $userId = null, ?bool $moderator = false): string
Severity: Minor
Found in app/MeetingService.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '197', column '14').
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Minor
Found in app/MeetingService.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '68', column '19').
Open

            $result = (new \App\Db\Query())->from(self::TABLE_NAME)->orderBy(['status' => SORT_DESC])->indexBy('id')->all();
Severity: Minor
Found in app/MeetingService.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '214', column '14').
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Minor
Found in app/MeetingService.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class 'App\Cache' in method 'getServices'.
Open

            Cache::save($cacheName, '', $result, Cache::LONG);
Severity: Minor
Found in app/MeetingService.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\App\User' in method 'getUrl'.
Open

            $userModel = \App\User::getUserModel($userId);
Severity: Minor
Found in app/MeetingService.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'App\Cache' in method 'getServices'.
Open

        return Cache::get($cacheName, '');
Severity: Minor
Found in app/MeetingService.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'App\Cache' in method 'getServices'.
Open

        if (!Cache::has($cacheName, '')) {
Severity: Minor
Found in app/MeetingService.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\App\Utils' in method 'generateRoomName'.
Open

        ], strtolower(\App\Utils::sanitizeSpecialChars($prefix, ' ')));
Severity: Minor
Found in app/MeetingService.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Define a constant instead of duplicating this literal "secret" 3 times.
Open

                $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Critical
Found in app/MeetingService.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Critical
Found in app/MeetingService.php by phan

Call to method __construct from undeclared class \Ahc\Jwt\JWT
Open

                $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Critical
Found in app/MeetingService.php by phan

Call to method decode from undeclared class \Ahc\Jwt\JWT
Open

        return $jwt->decode($output['jwt']);
Severity: Critical
Found in app/MeetingService.php by phan

Call to method __construct from undeclared class \Ahc\Jwt\JWT
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Critical
Found in app/MeetingService.php by phan

Call to undeclared method \App\Db\Query::from
Open

            $result = (new \App\Db\Query())->from(self::TABLE_NAME)->orderBy(['status' => SORT_DESC])->indexBy('id')->all();
Severity: Critical
Found in app/MeetingService.php by phan

Call to method __construct from undeclared class \Ahc\Jwt\JWT
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Critical
Found in app/MeetingService.php by phan

Catching undeclared class \Ahc\Jwt\JWTException
Open

            } catch (\Ahc\Jwt\JWTException $e) {
Severity: Critical
Found in app/MeetingService.php by phan

Doc-block of getToken contains declared return type void which is incompatible with the return type string declared in the signature
Open

     * @return void
Severity: Minor
Found in app/MeetingService.php by phan

Call to method decode from undeclared class \Ahc\Jwt\JWT
Open

                $jwt->decode($output['jwt']);
Severity: Critical
Found in app/MeetingService.php by phan

Call to method encode from undeclared class \Ahc\Jwt\JWT
Open

        return $jwt->encode($data);
Severity: Critical
Found in app/MeetingService.php by phan

Call to method getUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

            $userModel = \App\User::getUserModel($userId);
Severity: Critical
Found in app/MeetingService.php by phan

Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
Open

                $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Critical
Found in app/MeetingService.php by phan

Argument 1 (pattern) is array{/[^a-z0-9 ]/:Closure():'',/\b[a-z]/:Closure(mixed):(false|string),/[\s]/:Closure():''} but \preg_replace_callback_array() takes array<string></string>
Open

            '/[^a-z0-9 ]/' => function () {
Severity: Minor
Found in app/MeetingService.php by phan

Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Critical
Found in app/MeetingService.php by phan

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                'email' => $userModel->getDetail('email1'),
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance->setData(self::getService($serviceId));
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets URL address.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array     $data
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance = new self();
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($userId) {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Generate room name.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    private const STATUS_ACTIVE = 1;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return Cache::get($cacheName, '');
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (self::DEFAULT_SERVICE === $serviceId) {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                'avatar' => '',
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function generateRoomName(string $prefix = ''): string
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets services data.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets service data.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $prefix
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            Cache::save($cacheName, '', $result, Cache::LONG);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public const TABLE_NAME = 's_#__meeting_services';
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var int Default service ID
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getInstance(int $serviceId = self::DEFAULT_SERVICE): self
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int|null  $userId
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $data['moderator'] = $moderator;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $path = parse_url($url, PHP_URL_PATH);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Check URL.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Table name.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public const DEFAULT_SERVICE = 0;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $result = (new \App\Db\Query())->from(self::TABLE_NAME)->orderBy(['status' => SORT_DESC])->indexBy('id')->all();
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            '/[\s]/' => function () {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $url
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets data from URL.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $cacheName = 'MeetingService::getServices';
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getDefaultService(): array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return current(self::getServices()) ?: [];
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $prefix = preg_replace_callback_array([
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            '/\b[a-z]/' => function ($matches) {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets room name from URL.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    private function getToken(array $data): string
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!Cache::has($cacheName, '')) {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return self::getServices()[$serviceId] ?? [];
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            ];
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                return '';
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $url
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getService(int $serviceId): array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets default service data.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getUrl(array $data, ?int $userId = null, ?bool $moderator = false): string
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $data['context']['user'] = [
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            '/[^a-z0-9 ]/' => function () {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $query = parse_url($url, PHP_URL_QUERY);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array $data
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $jwt->encode($data);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function isActive(): bool
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return self::STATUS_ACTIVE === $this->get('status');
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getServices(): array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            return self::getDefaultService();
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool|null $moderator
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                return mb_strtoupper($matches[0]);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $result = false;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $jwt->decode($output['jwt']);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var int Status active
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                'name' => $userModel->getName(),
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                'id' => $userId,
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->get('url') . $data['room'] . '?jwt=' . $this->getToken($data);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            },
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function validateUrl(string $url): bool
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Return object instance.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int $serviceId
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $instance;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Checks if service is active.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $userModel = \App\User::getUserModel($userId);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        parse_str($query, $output);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        ], strtolower(\App\Utils::sanitizeSpecialChars($prefix, ' ')));
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        parse_str($query, $output);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $data['exp'] = $data['exp'] ?? strtotime("+{$this->get('duration')} minutes");
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            },
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            } catch (\Ahc\Jwt\JWTException $e) {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return self
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Line exceeds 120 characters; contains 124 characters
Open

            $result = (new \App\Db\Query())->from(self::TABLE_NAME)->orderBy(['status' => SORT_DESC])->indexBy('id')->all();
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int $serviceId
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $data['room'] = $data['room'] ?? $this->generateRoomName();
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                return '';
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        [$msec, $sec] = explode(' ', microtime());
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $result = true;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets token.
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            },
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $prefix . 'ID' . str_replace('.', '', $sec . $msec) . random_int(0, 1000);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $result = false;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getRoomFromUrl(string $url): string
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!empty($output['jwt']) && 0 === strpos($url, $this->get('url'))) {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            try {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getDataFromUrl(string $url): array
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $data['aud'] = $this->get('key');
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $data['iss'] = $this->get('key');
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $jwt = new \Ahc\Jwt\JWT(\App\Encryption::getInstance()->decrypt($this->get('secret')));
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return \substr($path, 1);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $jwt->decode($output['jwt']);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $result;
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $query = parse_url($url, PHP_URL_QUERY);
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $data['sub'] = parse_url($this->get('url'))['host'] ?? '';
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $url
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/MeetingService.php by phpcodesniffer

There are no issues that match your filters.

Category
Status