Completed
Push — master ( a0021a...b62e87 )
by claudio
14:16 queued 08:46
created

MeetingTimeslotPolicy   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 73.32%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 72
ccs 11
cts 15
cp 0.7332
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A userCheck() 0 4 1
A update() 0 4 1
A destroy() 0 4 1
A show() 0 5 1
A __construct() 0 4 1
A index() 0 4 1
A store() 0 4 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 15
    public function __construct()
22
    {
23
        //
24 15
    }
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 15
    private function userCheck(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
42
    {
43 15
        return $policyCheckable->verifyMeetingTimeslot($MeetingTimeslot);
44
    }
45
46
    /**
47
     * @param PolicyCheckable $policyCheckable
48
     * @param MeetingTimeslot $MeetingTimeslot
49
     * @return bool
50
     */
51
    public function store(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
52
    {
53
        return $this->userCheck($policyCheckable, $MeetingTimeslot);
54
    }
55
56
    /**
57
     * @param PolicyCheckable $policyCheckable
58
     * @param MeetingTimeslot $MeetingTimeslot
59
     * @return bool
60
     */
61 6
    public function update(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
62
    {
63 6
        return $this->userCheck($policyCheckable, $MeetingTimeslot);
64
    }
65
66
    /**
67
     * @param PolicyCheckable $policyCheckable
68
     * @param MeetingTimeslot $MeetingTimeslot
69
     * @return bool
70
     */
71 9
    public function show(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
72
    {
73 9
        $ret = $this->userCheck($policyCheckable, $MeetingTimeslot);
74 9
        return $ret;
75
    }
76
77
    /**
78
     * @param PolicyCheckable $policyCheckable
79
     * @param MeetingTimeslot $MeetingTimeslot
80
     * @return bool
81
     */
82 6
    public function destroy(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot)
83
    {
84 6
        return $this->userCheck($policyCheckable, $MeetingTimeslot);
85
    }
86
}
87