File::getFullPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tleckie\Translate\Resolver;
6
7
use function is_file;
8
use function sprintf;
9
10
/**
11
 * Class File
12
 *
13
 * @package  Tleckie\Translate\Resolver
14
 * @category File
15
 * @author   Teodoro Leckie Westberg <[email protected]>
16
 */
17
class File
18
{
19
    /**
20
     * @param  string $path
21
     * @param  string $locale
22
     * @param  string $extension
23
     * @return bool
24
     */
25
    public function isFile(string $path, string $locale, string $extension): bool
26
    {
27
        return is_file($this->getFullPath($path, $locale, $extension));
28
    }
29
30
    /**
31
     * @param  string $path
32
     * @param  string $locale
33
     * @param  string $extension
34
     * @return string
35
     */
36
    public function getFullPath(string $path, string $locale, string $extension): string
37
    {
38
        return sprintf("%s%s.%s", $path, $locale, $extension);
39
    }
40
}
41