Completed
Push — develop-3.0 ( 360277...bd5ff0 )
by Mohamed
06:52
created

ProjectAccess   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isPublicProject() 0 6 2
1
<?php
2
3
/*
4
 * This file is part of the Tinyissue package.
5
 *
6
 * (c) Mohamed Alsharaf <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tinyissue\Extensions\Policies;
13
14
use Tinyissue\Model\Project;
15
16
trait ProjectAccess
17
{
18
    /**
19
     * Check if public project enabled and current project is public.
20
     *
21
     * @param Project $project
22
     *
23
     * @return bool
24
     */
25
    protected function isPublicProject(Project $project)
26
    {
27
        $isPublicEnabled = app('tinyissue.settings')->isPublicProjectsEnabled();
28
29
        return $isPublicEnabled && $project->isPublic();
30
    }
31
}
32