Completed
Branch feature/pre-split (364e4e)
by Anton
03:31
created

BelongsToMorphedSchema   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A declareTables() 0 10 1
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
8
namespace Spiral\ORM\Schemas\Relations;
9
10
use Spiral\ORM\Record;
11
use Spiral\ORM\Schemas\Relations\Traits\TablesTrait;
12
use Spiral\ORM\Schemas\SchemaBuilder;
13
14
/**
15
 * Provides ability to link record to mutable parent using interface definition.
16
 */
17
class BelongsToMorphedSchema extends AbstractSchema
18
{
19
    use TablesTrait;
20
21
    /**
22
     * Relation type.
23
     */
24
    const RELATION_TYPE = Record::BELONGS_TO_MORPHED;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function declareTables(SchemaBuilder $builder): array
30
    {
31
       // $sourceTable = $this->sourceTable($builder);
32
33
        //echo 1;
34
35
        return [];
36
37
        return [$sourceTable];
0 ignored issues
show
Unused Code introduced by
return array($sourceTable); does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
38
    }
39
}