Completed
Push — develop-3.0 ( 4fe777...24fc5d )
by Mohamed
09:15
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
use Tinyissue\Model\User;
16
17
trait ProjectAccess
18
{
19
    /**
20
     * Check if public project enabled and current project is public.
21
     *
22
     * @param Project $project
23
     *
24
     * @return bool
25
     */
26
    protected function isPublicProject(Project $project)
27
    {
28
        $isPublicEnabled = app('tinyissue.settings')->isPublicProjectsEnabled();
29
30
        return $isPublicEnabled && $project->isPublic();
31
    }
32
}
33