Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
45 | 31 | protected function createTable($table) |
|
46 | { |
||
47 | 31 | if (isset(static::$tableCreated[$table]) === true) { |
|
48 | 31 | return $table; |
|
49 | } |
||
50 | |||
51 | 2 | $schema = $this->getConnection()->getSchemaBuilder(); |
|
52 | 2 | if ($schema->hasTable($table) === false) { |
|
53 | 2 | $schema->create($table, function (Blueprint $table) { |
|
54 | 2 | $this->createSchema($table); |
|
55 | 2 | }); |
|
56 | 2 | static::$tableCreated[$table] = true; |
|
57 | 2 | if ($this instanceof FileModel === true) { |
|
58 | 1 | $this->initializeTable($table); |
|
|
|||
59 | } |
||
60 | } |
||
61 | |||
62 | 2 | return $table; |
|
63 | } |
||
64 | |||
73 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: