Avoid using static access to class '\Carbon\Carbon' in method 'toArray'. Open
'active_from' => Carbon::make($this->resource->active_from),
- Read upRead up
- Exclude checks
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),
- Read upRead up
- Exclude checks
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),
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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,
- Exclude checks
Static call to undeclared method \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource::apply
Open
return self::apply($fields, $this);
- Exclude checks
Call to method make
from undeclared class \Carbon\Carbon
Open
'active_from' => Carbon::make($this->resource->active_from),
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'description' => $this->resource->description,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'short_desc' => $this->resource->short_desc,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'yt_url' => $this->resource->yt_url,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'updated_at' => $this->resource->updated_at,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'duration' => $this->resource->getDuration(),
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'logotype_url' => $this->resource->logotype_url,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'deadline' => $this->resource->deadline,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'trainers' => TrainerResource::collection($this->resource->trainers),
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'active_from' => Carbon::make($this->resource->active_from),
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'name' => $this->resource->name,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'status' => $this->resource->status,
- Exclude checks
Static call to undeclared method \EscolaLms\Webinar\Http\Resources\TrainerResource::collection
Open
'trainers' => TrainerResource::collection($this->resource->trainers),
- Exclude checks
Class uses undeclared trait \EscolaLms\Auth\Traits\ResourceExtandable
Open
class WebinarSimpleResource extends JsonResource
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'image_path' => $this->resource->image_path,
- Exclude checks
Class extends undeclared class \Illuminate\Http\Resources\Json\JsonResource
Open
class WebinarSimpleResource extends JsonResource
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'active_to' => Carbon::make($this->resource->active_to),
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'image_url' => $this->resource->image_url,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'logotype_path' => $this->resource->logotype_path,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'id' => $this->resource->id,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'created_at' => $this->resource->created_at,
- Exclude checks
Call to method make
from undeclared class \Carbon\Carbon
Open
'active_to' => Carbon::make($this->resource->active_to),
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Http\Resources\WebinarSimpleResource->resource
Open
'tags' => $this->resource->tags,
- Exclude checks