Completed
Push — master ( 06b292...adafac )
by Nicolai
02:22
created

ExpressionLanguageServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace SmartWeb\ModuleTesting\Providers;
5
6
use Illuminate\Support\ServiceProvider;
7
use SmartWeb\ModuleTesting\ExpressionLanguage\Functions\Call;
8
use SmartWeb\ModuleTesting\ExpressionLanguage\Functions\String\Lowercase;
9
use SmartWeb\ModuleTesting\ExpressionLanguage\Providers\PhpExpressionLanguageProvider;
10
use SmartWeb\ModuleTesting\ExpressionLanguage\Providers\StringExpressionLanguageProvider;
11
12
13
/**
14
 * Provides ExpressionLanguages and ExpressionFunctions
15
 *
16
 * @package SmartWeb\Testing\Providers
17
 */
18
class ExpressionLanguageServiceProvider extends ServiceProvider
19
{
20
    
21
    /**
22
     * Indicates if loading of the provider is deferred.
23
     *
24
     * @var bool
25
     */
26
    protected $defer = true;
27
    
28
    /**
29
     * @var string[]
30
     */
31
    private $provides = [
32
        StringExpressionLanguageProvider::class,
33
        PhpExpressionLanguageProvider::class,
34
        Lowercase::class,
35
        Call::class,
36
    ];
37
    
38
    /**
39
     * Register the service provider.
40
     *
41
     * @return void
42
     */
43
    public function register()
44
    {
45
        $this->registerAbstracts();
46
    }
47
    
48
    private function registerAbstracts()
49
    {
50
        foreach ($this->provides as $abstract) {
51
            $this->app->singleton($abstract);
52
        }
53
    }
54
    
55
    /**
56
     * Get the services provided by the provider.
57
     *
58
     * @return array
59
     */
60
    public function provides()
61
    {
62
        return $this->provides;
63
    }
64
}
65