MessagePolicy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 4 1
A receive() 0 4 1
1
<?php
2
3
namespace ReliQArts\Mardin\Policies;
4
5
use ReliQArts\Mardin\Contracts\User;
6
use Illuminate\Auth\Access\HandlesAuthorization;
7
8
class MessagePolicy
9
{
10
    use HandlesAuthorization;
11
12
    /**
13
     * Create a new policy instance.
14
     *
15
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
16
     */
17
    public function __construct()
18
    {
19
        //
20
    }
21
22
    /**
23
     * Determine if a User can send a message.
24
     *
25
     * @param  User $user
26
     * @return bool
27
     */
28
    public function send(User $user)
29
    {
30
        return $user->canSendMardinMessage();
31
    }
32
33
    /**
34
     * Determine if a User can receive a message.
35
     *
36
     * @param  User  $user
37
     * @return bool
38
     */
39
    public function receive(User $user)
40
    {
41
        return $user->canReceiveMardinMessage();
42
    }
43
}
44