RouteHelper   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 33
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRoutePrefix() 0 4 1
A getMessagesController() 0 4 1
A getRouteGroupBindings() 0 7 2
1
<?php
2
3
namespace ReliQArts\Mardin\Helpers;
4
5
use Config;
6
7
class RouteHelper
8
{
9
    /**
10
     * Get route prefix for mardin routes.
11
     *
12
     * @return string Prefix.
13
     */
14
    public static function getRoutePrefix()
15
    {
16
        return Config::get('mardin.routes.prefix', 'messages');
17
    }
18
19
    /**
20
     * Get controller for mardin routes.
21
     *
22
     * @return string Controller.
23
     */
24
    public static function getMessagesController()
25
    {
26
        return Config::get('mardin.routes.controller', 'ReliQArts\\Mardin\\Http\\Controllers\\MessagesController');
27
    }
28
29
    /**
30
     * Get bindings for public routes.
31
     */
32
    public static function getRouteGroupBindings($bindings = [], $groupKey = 'public')
33
    {
34
        $defaults = ($groupKey == 'public') ? ['prefix' => self::getRoutePrefix()] : [];
35
        $bindings = array_merge(Config::get("mardin.routes.bindings.{$groupKey}", []), $bindings);
36
37
        return array_merge($defaults, $bindings);
38
    }
39
}
40