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

Mutex::__destruct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2.1481

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 4
ccs 2
cts 3
cp 0.6667
crap 2.1481
rs 10
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