alientronics/fleetany-api

View on GitHub
app/Http/Controllers/CompanyController.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\App\Company' in method 'createCompany'.
Open

        $Company = Company::create($request->all());

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 '\App\Company' in method 'updateCompany'.
Open

        $Company  = Company::find($idCompany);

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 '\App\Company' in method 'getCompany'.
Open

        $Company  = Company::find($idCompany);

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 '\App\Company' in method 'index'.
Open

        $Companies = Company::all();

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 variable $Company is not named in camelCase.
Open

    public function createCompany(Request $request)
    {
  
        $Company = Company::create($request->all());
  

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Company is not named in camelCase.
Open

    public function updateCompany(Request $request, $idCompany)
    {
        $Company  = Company::find($idCompany);
        $Company->name = $request->input('name');
        $Company->save();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Company is not named in camelCase.
Open

    public function getCompany($idCompany)
    {
  
        $Company  = Company::find($idCompany);
  

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Company is not named in camelCase.
Open

    public function getCompany($idCompany)
    {
  
        $Company  = Company::find($idCompany);
  

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Companies is not named in camelCase.
Open

    public function index()
    {
  
        $Companies = Company::all();
  

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Company is not named in camelCase.
Open

    public function createCompany(Request $request)
    {
  
        $Company = Company::create($request->all());
  

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Companies is not named in camelCase.
Open

    public function index()
    {
  
        $Companies = Company::all();
  

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Company is not named in camelCase.
Open

    public function updateCompany(Request $request, $idCompany)
    {
        $Company  = Company::find($idCompany);
        $Company->name = $request->input('name');
        $Company->save();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Company is not named in camelCase.
Open

    public function updateCompany(Request $request, $idCompany)
    {
        $Company  = Company::find($idCompany);
        $Company->name = $request->input('name');
        $Company->save();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $Company is not named in camelCase.
Open

    public function updateCompany(Request $request, $idCompany)
    {
        $Company  = Company::find($idCompany);
        $Company->name = $request->input('name');
        $Company->save();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status