MessagePolicy::receive()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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