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

PublicDirectory::getPublicDir()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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