File   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFullPath() 0 3 1
A isFile() 0 3 1
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