Completed
Pull Request — master (#362)
by Julien
09:38
created

IdeographicEngine   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A slugify() 0 5 1
1
<?php namespace Cviebrock\EloquentSluggable\Engines;
2
3
use Cocur\Slugify\SlugifyInterface;
4
5
/**
6
 * Class IdeographicEngine
7
 *
8
 * @package Cviebrock\EloquentSluggable\Engines
9
 */
10
class IdeographicEngine implements SlugifyInterface
11
{
12
13
14
    /**
15
     * For ideographic Engine, Return a unique Random string instead of Slug
16
     *
17
     * @param string $string
18
     * @param string|array|null $options
19
     *
20
     * @return string
21
     *
22
     * @api
23
     */
24
    public function slugify($string, $options = null)
25
    {
26
        $fullString = md5(uniqid(rand(), true));
27
        return substr($fullString, 0, 12);
28
    }
29
}
30