francescozanoni /
clqei
| 1 | <?php |
||
| 2 | declare(strict_types = 1); |
||
| 3 | |||
| 4 | namespace App\Models\Traits; |
||
| 5 | |||
| 6 | use Illuminate\Database\Eloquent\Model; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Trait EloquentGetTableName |
||
| 10 | * |
||
| 11 | * Inspired by https://github.com/laravel/framework/issues/1436 |
||
| 12 | * |
||
| 13 | * @package App\Models\Traits |
||
| 14 | */ |
||
| 15 | trait EloquentGetTableName |
||
| 16 | { |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | public static function getTableName() : string |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var Model |
||
| 25 | */ |
||
| 26 | $modelInstance = (new self); |
||
| 27 | |||
| 28 | return $modelInstance->getTable(); |
||
|
0 ignored issues
–
show
|
|||
| 29 | } |
||
| 30 | |||
| 31 | } |
||
| 32 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.