MongoStringId   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A read() 0 4 1
A write() 0 4 1
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL or Commercial license.
5
 *
6
 * @package maslosoft/mangan
7
 * @licence AGPL or Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]>
9
 * @copyright Copyright (c) Maslosoft
10
 * @copyright Copyright (c) Others as mentioned in code
11
 * @link https://maslosoft.com/mangan/
12
 */
13
14
namespace Maslosoft\Mangan\Sanitizers;
15
16
/**
17
 * MongoStringId
18
 * This sanitizer provide mongo id as string
19
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
20
 */
21
class MongoStringId extends MongoObjectId
22
{
23
24 6
	public function read($model, $dbValue)
25
	{
26 6
		return $this->_cast($dbValue, true);
27
	}
28
29 6
	public function write($model, $dbValue)
30
	{
31 6
		return $this->_cast($dbValue, true);
32
	}
33
34
}
35