EloquentDriver::serialize()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
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