Passed
Pull Request — master (#36)
by Evgeniy
02:21
created

Mutex   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 2
cts 3
cp 0.6667
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __destruct() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Mutex;
6
7
/**
8
 * The Mutex allows mutual execution of concurrent processes in order to prevent "race conditions".
9
 *
10
 * @see MutexInterface
11
 */
12
abstract class Mutex implements MutexInterface
13
{
14 5
    final public function __destruct()
15
    {
16 5
        if (!$this->isReleased()) {
17
            $this->release();
18
        }
19 5
    }
20
}
21