SlugService   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 2
b 0
f 0
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSlugModel() 0 6 1
1
<?php
2
3
namespace CSlant\Blog\Api\Services;
4
5
use CSlant\Blog\Core\Facades\Base\SlugHelper;
6
use CSlant\Blog\Core\Http\Responses\Base\BaseHttpResponse;
7
use CSlant\Blog\Core\Models\Slug;
8
9
/**
10
 * Class SlugService
11
 *
12
 * @package CSlant\Blog\Api\Services
13
 *
14
 * @method BaseHttpResponse httpResponse()
15
 */
16
class SlugService
17
{
18
    public function getSlugModel(string $slug, string $model)
19
    {
20
        /** @var Slug $slug */
21
        $slug = SlugHelper::getSlug($slug, SlugHelper::getPrefix(get_class_name_by_slug($model)));
22
23
        return $slug ?? null;
24
    }
25
}
26