Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 10.1554 |
Changes | 0 |
1 | <?php |
||
45 | 1 | protected function createTable($table) |
|
46 | { |
||
47 | 1 | if (isset(static::$tableCreated[$table]) === true) { |
|
48 | 1 | return $table; |
|
49 | } |
||
50 | |||
51 | $schema = $this->getConnection()->getSchemaBuilder(); |
||
52 | if ($schema->hasTable($table) === false) { |
||
53 | $schema->create($table, function (Blueprint $table) { |
||
54 | $this->createSchema($table); |
||
55 | }); |
||
56 | static::$tableCreated[$table] = true; |
||
57 | if ($this instanceof FileModel === true) { |
||
58 | $this->initializeTable($table); |
||
|
|||
59 | } |
||
60 | } |
||
61 | |||
62 | 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: