AppId   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A passes() 0 6 2
A message() 0 4 1
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Statistics\Rules;
4
5
use BeyondCode\LaravelWebSockets\Apps\AppProvider;
6
use Illuminate\Contracts\Validation\Rule;
7
8
class AppId implements Rule
9
{
10
    public function passes($attribute, $value)
11
    {
12
        $appProvider = app(AppProvider::class);
13
14
        return $appProvider->findById($value) ? true : false;
15
    }
16
17
    public function message()
18
    {
19
        return 'There is no app registered with the given id. Make sure the websockets config file contains an app for this id or that your custom AppProvider returns an app for this id.';
20
    }
21
}
22