EscolaLMS/Webinar

View on GitHub
src/Http/Resources/TrainerInterestResource.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$request'.
Open

    public function toArray($request)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

class TrainerInterestResource extends JsonResource

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'slug' => $this->resource->slug,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'name_with_breadcrumbs' => $this->resource->name_with_breadcrumbs,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'icon' => $this->resource->icon ? Storage::url($this->resource->icon) : null,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'created_at' => $this->resource->created_at,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'updated_at' => $this->resource->updated_at,

Call to method url from undeclared class \Illuminate\Support\Facades\Storage
Open

            'icon' => $this->resource->icon ? Storage::url($this->resource->icon) : null,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'icon_class' => $this->resource->icon_class,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'parent_id' => $this->resource->parent_id,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'name' => $this->resource->name,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'is_active' => $this->resource->is_active,

Reference to undeclared property \EscolaLms\Webinar\Http\Resources\TrainerInterestResource->resource
Open

            'id' => $this->resource->id,

Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'toArray'.
Open

            'icon' => $this->resource->icon ? Storage::url($this->resource->icon) : null,

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

There are no issues that match your filters.

Category
Status