EscolaLMS/model-fields

View on GitHub

Showing 192 of 192 total issues

The variable $class_type is not named in camelCase.
Open

    public function getFieldsMetadata(string $class_type): Collection
    {
        // add result of hasTable to the cache to limit database queries
        $tableExist = Cache::rememberForever('model_fields_metadata_table_exists', function () {
            return Schema::hasTable('model_fields_metadata');
Severity: Minor
Found in src/Services/ModelFieldsService.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $class_type is not named in camelCase.
Open

    public function getFieldsMetadata(string $class_type): Collection
    {
        // add result of hasTable to the cache to limit database queries
        $tableExist = Cache::rememberForever('model_fields_metadata_table_exists', function () {
            return Schema::hasTable('model_fields_metadata');
Severity: Minor
Found in src/Services/ModelFieldsService.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $class_type is not named in camelCase.
Open

    public function getFieldsMetadataListPaginated(string $class_type, ?int $perPage = 15, ?OrderDto $orderDto = null): Collection|LengthAwarePaginator
    {
        if (!config('model-fields.enabled')) {
            return collect([]);
        }
Severity: Minor
Found in src/Services/ModelFieldsService.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $class_type is not named in camelCase.
Open

    public function getFieldsMetadataListPaginated(string $class_type, ?int $perPage = 15, ?OrderDto $orderDto = null): Collection|LengthAwarePaginator
    {
        if (!config('model-fields.enabled')) {
            return collect([]);
        }
Severity: Minor
Found in src/Services/ModelFieldsService.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $class_type is not named in camelCase.
Open

    public function getFieldsMetadata(string $class_type): Collection
    {
        // add result of hasTable to the cache to limit database queries
        $tableExist = Cache::rememberForever('model_fields_metadata_table_exists', function () {
            return Schema::hasTable('model_fields_metadata');
Severity: Minor
Found in src/Services/ModelFieldsService.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

Parameter $table has undeclared type \Illuminate\Database\Schema\Blueprint
Open

        Schema::create('model_fields_metadata', function (Blueprint $table) {

Call to method create from undeclared class \Illuminate\Support\Facades\Schema
Open

        Schema::create('model_fields_values', function (Blueprint $table) {

Class extends undeclared class \EscolaLms\Core\Enums\BasicEnum
Open

class MetaFieldTypeEnum extends BasicEnum
Severity: Critical
Found in src/Enum/MetaFieldTypeEnum.php by phan

Call to method __construct from undeclared class \BenSampo\Enum\Rules\EnumValue
Open

            'type' => ['required', new EnumValue(MetaFieldTypeEnum::class)],

Class extends undeclared class \Illuminate\Database\Eloquent\Model
Open

class Field extends Model
Severity: Critical
Found in src/Models/Field.php by phan

Property \EscolaLms\ModelFields\Models\Metadata->created_at has undeclared type \Illuminate\Support\Carbon
Open

 * @property Carbon $created_at
Severity: Minor
Found in src/Models/Metadata.php by phan

Call to method drop from undeclared class \Illuminate\Support\Facades\Schema
Open

        Schema::drop('model_fields_metadata');

Call to method text from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->text('value');

Call to method morphs from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->morphs('class');

Call to undeclared function \app()
Open

        app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions();
Severity: Critical
Found in database/seeders/PermissionTableSeeder.php by phan

Class extends undeclared class \Illuminate\Http\Resources\Json\JsonResource
Open

class MetadataResource extends JsonResource
Severity: Critical
Found in src/Http/Resources/MetadataResource.php by phan

syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open

    public array $singletons = [
Severity: Critical
Found in src/ModelFieldsServiceProvider.php by phan

Parameter $user has undeclared type ?\EscolaLms\Core\Models\User
Open

    public function createOrUpdate(?User $user): bool
Severity: Minor
Found in src/Policies/MetadataPolicy.php by phan

Call to method integer from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->integer('visibility')->default(1 << 0);

Call to undeclared method \EscolaLms\ModelFields\AuthServiceProvider::registerPolicies
Open

        $this->registerPolicies();
Severity: Critical
Found in src/AuthServiceProvider.php by phan
Severity
Category
Status
Source
Language