EscolaLMS/Webinar

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

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\Carbon\Carbon' in method 'toArray'.
Open

            'active_from' => Carbon::make($this->resource->active_from),

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

Avoid using static access to class 'EscolaLms\Webinar\Http\Resources\TrainerResource' in method 'toArray'.
Open

            'trainers' => TrainerResource::collection($this->resource->trainers),

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

Avoid using static access to class '\Carbon\Carbon' in method 'toArray'.
Open

            'active_to' => Carbon::make($this->resource->active_to),

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

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

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

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

Static call to undeclared method \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource::apply
Open

        return self::apply($fields, $this);

Call to method make from undeclared class \Carbon\Carbon
Open

            'active_from' => Carbon::make($this->resource->active_from),

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

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

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

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

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

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

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

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

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

            'duration' => $this->resource->getDuration(),

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

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

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

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

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

            'trainers' => TrainerResource::collection($this->resource->trainers),

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

            'active_from' => Carbon::make($this->resource->active_from),

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

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

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

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

Static call to undeclared method \EscolaLms\Webinar\Http\Resources\TrainerResource::collection
Open

            'trainers' => TrainerResource::collection($this->resource->trainers),

Class uses undeclared trait \EscolaLms\Auth\Traits\ResourceExtandable
Open

class WebinarSimpleResource extends JsonResource

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

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

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

class WebinarSimpleResource extends JsonResource

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

            'active_to' => Carbon::make($this->resource->active_to),

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

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

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

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

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

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

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

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

Call to method make from undeclared class \Carbon\Carbon
Open

            'active_to' => Carbon::make($this->resource->active_to),

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

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

There are no issues that match your filters.

Category
Status