Passed
Pull Request — master (#182)
by Alex
07:12
created

LaravelBaseQuery::getAuth()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: alex
5
 * Date: 29/09/19
6
 * Time: 4:55 PM
7
 */
8
9
namespace AlgoWeb\PODataLaravel\Query;
10
11
use AlgoWeb\PODataLaravel\Auth\NullAuthProvider;
12
use AlgoWeb\PODataLaravel\Interfaces\AuthInterface;
13
use AlgoWeb\PODataLaravel\Providers\MetadataProvider;
14
use Illuminate\Support\Facades\App;
15
16
abstract class LaravelBaseQuery
17
{
18
    /** @var AuthInterface */
19
    protected $auth;
20
    protected $metadataProvider;
21
22
    public function __construct(AuthInterface $auth = null)
23
    {
24
        $this->auth = isset($auth) ? $auth : new NullAuthProvider();
25
        $this->metadataProvider = new MetadataProvider(App::make('app'));
26
    }
27
28
    /**
29
     * Dig out local copy of POData-Laravel metadata provider.
30
     *
31
     * @return MetadataProvider
32
     */
33
    public function getMetadataProvider()
34
    {
35
        return $this->metadataProvider;
36
    }
37
38
    protected function getAuth()
39
    {
40
        return $this->auth;
41
    }
42
}
43