src/Http/Resources/ConsultationProposedTermResource.php
Avoid unused parameters such as '$request'. Open
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
Class extends undeclared class \Illuminate\Http\Resources\Json\JsonResource
Open
Open
class ConsultationProposedTermResource extends JsonResource
- Exclude checks
Class uses undeclared trait \EscolaLms\Auth\Traits\ResourceExtandable
Open
Open
class ConsultationProposedTermResource extends JsonResource
- Exclude checks
Reference to undeclared property \EscolaLms\Consultations\Http\Resources\ConsultationProposedTermResource->resource
Open
Open
return is_string($this->resource) ? Carbon::make($this->resource) : $this->resource;
- Exclude checks
Call to method make
from undeclared class \Illuminate\Support\Carbon
Open
Open
return is_string($this->resource) ? Carbon::make($this->resource) : $this->resource;
- Exclude checks
Avoid using static access to class '\Illuminate\Support\Carbon' in method 'toArray'. Open
Open
return is_string($this->resource) ? Carbon::make($this->resource) : $this->resource;
- 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();
}
}