Avoid using static access to class '\Illuminate\Support\Facades\Validator' in method 'add_custom_validators'. Open
Validator::extend('base64image', 'Seat\Api\Http\Validation\Image@validate');
- 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
The method add_middleware is not named in camelCase. Open
public function add_middleware($router)
{
// Authenticate checks that the token is valid
// from an allowed IP address
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method add_views is not named in camelCase. Open
public function add_views()
{
$this->loadViewsFrom(__DIR__ . '/resources/views', 'api');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method add_translations is not named in camelCase. Open
public function add_translations()
{
$this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'api');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method add_migrations is not named in camelCase. Open
private function add_migrations()
{
$this->loadMigrationsFrom(__DIR__ . '/database/migrations/');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method add_custom_validators is not named in camelCase. Open
public function add_custom_validators()
{
Validator::extend('base64image', 'Seat\Api\Http\Validation\Image@validate');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method add_routes is not named in camelCase. Open
public function add_routes()
{
$this->loadRoutesFrom(__DIR__ . '/Http/routes.php');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method apply_custom_configuration is not named in camelCase. Open
public function apply_custom_configuration()
{
// Tell L5-swagger where to find annotations. These form
// part of the controllers themselves.
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}