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

ProjectAccess::isPublicProject()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
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