Passed
Push — master ( bf075b...6deca2 )
by Petr
07:21
created

Translations   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 49
ccs 4
cts 12
cp 0.3333
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A iklCannotUseFile() 0 3 1
A iklCannotOpenFile() 0 3 1
A iklCannotUsePath() 0 3 1
A iklProblemWithStorage() 0 3 1
A iklLockedByOther() 0 3 1
A iklCannotUseOS() 0 3 1
1
<?php
2
3
namespace kalanis\kw_locks;
4
5
6
use kalanis\kw_locks\Interfaces\IKLTranslations;
7
8
9
/**
10
 * Class Translations
11
 * @package kalanis\kw_locks
12
 */
13
class Translations implements IKLTranslations
14
{
15 2
    public function iklLockedByOther(): string
16
    {
17 2
        return 'Locked by another!';
18
    }
19
20 9
    public function iklProblemWithStorage(): string
21
    {
22 9
        return 'Problem with storage';
23
    }
24
25
    /**
26
     * @param string $lockFilename
27
     * @return string
28
     * @codeCoverageIgnore
29
     */
30
    public function iklCannotUseFile(string $lockFilename): string
31
    {
32
        return 'Cannot use: ' . $lockFilename . ' as lock file. Path is not writable.';
33
    }
34
35
    /**
36
     * @param string $path
37
     * @return string
38
     * @codeCoverageIgnore
39
     */
40
    public function iklCannotUsePath(string $path): string
41
    {
42
        return 'Cannot use: ' . $path . ' to lock. Path not found and cannot be created.';
43
    }
44
45
    /**
46
     * @param string $lockFilename
47
     * @return string
48
     * @codeCoverageIgnore
49
     */
50
    public function iklCannotOpenFile(string $lockFilename): string
51
    {
52
        return 'Could not open lock file: '. $lockFilename;
53
    }
54
55
    /**
56
     * @return string
57
     * @codeCoverageIgnore
58
     */
59
    public function iklCannotUseOS(): string
60
    {
61
        return 'Unusable OS. Cannot use external programs to determine process ID.';
62
    }
63
}
64