EloquentDriver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 8 2
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 11/21/15
5
 * Time: 4:46 PM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace NilPortugues\Serializer\Drivers\Eloquent;
12
13
/**
14
 * Class EloquentDriver.
15
 */
16
class EloquentDriver
17
{
18
    /**
19
     * @var Driver
20
     */
21
    private static $driver;
22
23
    /**
24
     * @param $value
25
     *
26
     * @return mixed|string
27
     */
28
    public static function serialize($value)
29
    {
30
        if (empty(self::$driver)) {
31
            self::$driver = new Driver();
32
        }
33
34
        return self::$driver->serialize($value);
35
    }
36
}
37