Passed
Push — master ( f75c84...6aec09 )
by Anton
02:54
created

Migration::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Laravel Love.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Love\Support\Database;
15
16
use Illuminate\Database\Migrations\Migration as IlluminateMigration;
17
use Illuminate\Support\Facades\Config;
18
use Illuminate\Support\Facades\Schema;
19
20
abstract class Migration extends IlluminateMigration
21
{
22
    /**
23
     * The database schema.
24
     *
25
     * @var \Illuminate\Support\Facades\Schema
26
     */
27
    protected $schema;
28
29
    public function __construct()
30
    {
31
        $this->schema = Schema::connection($this->getConnection());
0 ignored issues
show
Documentation Bug introduced by antonkomarev
It seems like Illuminate\Support\Facad...$this->getConnection()) of type Illuminate\Database\Schema\Builder is incompatible with the declared type Illuminate\Support\Facades\Schema of property $schema.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
32
    }
33
34
    /**
35
     * Get the migration connection name.
36
     *
37
     * @return null|string
38
     */
39
    public function getConnection(): ?string
40
    {
41
        return Config::get('love.storage.database.connection');
42
    }
43
}
44