Issues (16)

app/Models/Traits/EloquentGetTableName.php (1 issue)

Labels
Severity
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
The method getTable() does not exist on App\Models\Traits\EloquentGetTableName. Did you maybe mean getTableName()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
        return $modelInstance->/** @scrutinizer ignore-call */ getTable();

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.

Loading history...
29
    }
30
31
}
32