Completed
Push — master ( f8b6bf...bec27e )
by Mahmoud
03:02
created

PortButler::getClassNameFromFile()   B

Complexity

Conditions 5
Paths 3

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 20
rs 8.8571
c 1
b 0
f 0
cc 5
eloc 12
nc 3
nop 1
1
<?php
2
3
namespace App\Port\Foundation\Portals;
4
5
use App\Port\Foundation\Exceptions\WrongConfigurationsException;
6
use Illuminate\Support\Facades\Config;
7
8
/**
9
 * Class PortButler.
10
 *
11
 * NOTE: You can access this Class functions with the facade [ModuleConfig].
12
 *
13
 * @author Mahmoud Zalt <[email protected]>
14
 */
15
class PortButler
16
{
17
18
    /**
19
     * @return  mixed
20
     */
21
    public function getLoginWebPageName()
22
    {
23
        $loginPage = Config::get('hello.containers.login-page-name');
24
25
        if (is_null($loginPage)) {
26
            throw new WrongConfigurationsException();
27
        }
28
29
        return $loginPage;
30
    }
31
32
    /**
33
     * check if a word starts with another word
34
     *
35
     * @param $word
36
     * @param $startsWith
37
     *
38
     * @return  bool
39
     */
40
    public function stringStartsWith($word, $startsWith)
41
    {
42
        return (substr($word, 0, strlen($startsWith)) === $startsWith);
43
    }
44
45
}
46