Completed
Pull Request — master (#51)
by claudio
05:36 queued 01:00
created

MeetingTimeslotPolicy::show()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace plunner\Policies;
4
5
use plunner\MeetingTimeslot;
6
use plunner\PolicyCheckable;
7
8
/**
9
 * Class MeetingTimeslotPolicy
10
 * @package plunner\Policies
11
 * @author Claudio Cardinale <[email protected]>
12
 * @copyright 2015 Claudio Cardinale
13
 * @version 1.0.0
14
 */
15
class MeetingTimeslotPolicy
16
{
17
    /**
18
     * Create a new policy instance.
19
     *
20
     */
21 8
    public function __construct()
22
    {
23
        //
24 8
    }
25
26
    /**
27
     * @param PolicyCheckable $policyCheckable
28
     * @param MeetingTimeslot $MeetingTimeslot
29
     * @return bool
30
     */
31
    public function index(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
32
    {
33
        return $this->userCheck($policyCheckable, $MeetingTimeslot);
34
    }
35
36
    /**
37
     * @param PolicyCheckable $policyCheckable
38
     * @param MeetingTimeslot $MeetingTimeslot
39
     * @return bool
40
     */
41
    public function store(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
42
    {
43
        return $this->userCheck($policyCheckable, $MeetingTimeslot);
44
    }
45
46
    /**
47
     * @param PolicyCheckable $policyCheckable
48
     * @param MeetingTimeslot $MeetingTimeslot
49
     * @return bool
50
     */
51 4
    public function update(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
52
    {
53 4
        return $this->userCheck($policyCheckable, $MeetingTimeslot);
54
    }
55
56
    /**
57
     * @param PolicyCheckable $policyCheckable
58
     * @param MeetingTimeslot $MeetingTimeslot
59
     * @return bool
60
     */
61 4
    public function show(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
62
    {
63 4
        $ret = $this->userCheck($policyCheckable, $MeetingTimeslot);
64 4
        return $ret;
65
    }
66
67
    /**
68
     * @param PolicyCheckable $policyCheckable
69
     * @param MeetingTimeslot $MeetingTimeslot
70
     * @return bool
71
     */
72 4
    public function destroy(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
73
    {
74 4
        return $this->userCheck($policyCheckable, $MeetingTimeslot);
75
    }
76
77
    /**
78
     * @param PolicyCheckable $policyCheckable
79
     * @param MeetingTimeslot $MeetingTimeslot
80
     * @return bool
81
     */
82 8
    private function userCheck(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
83
    {
84 8
        return $policyCheckable->verifyMeetingTimeslot($MeetingTimeslot);
85
    }
86
}
87