Completed
Push — master ( ad6397...d7b0a5 )
by DAOUDI
02:54 queued 22s
created

PublicDirectory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPublicDir() 0 14 3
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: sdaoudi
5
 * Date: 25/03/18
6
 * Time: 01:50
7
 */
8
9
namespace SfForward\Util;
10
11
12
class PublicDirectory
13
{
14
	/**
15
	 * @param $projectDir
16
	 *
17
	 * @return bool|string
18
	 */
19
	public static function getPublicDir($projectDir)
20
	{
21
		$webDir    = "$projectDir/web/";
22
		$publicDir = "$projectDir/public/";
23
24
		if (file_exists($webDir)) {
25
			return $webDir;
26
		}
27
28
		if (file_exists($publicDir)) {
29
			return $publicDir;
30
		}
31
32
		return false;
33
	}
34
}