PHP

PHP

By DeepSource

Class method doesn't comply with PSR standardsPHP-C1001

Style

As per PSR-1, class methods must be declared in the camelCase.

It is recommended that you follow PSR standards while developing PHP applications so the code is consistent and can be easily maintained.

Example

Bad practice

class User
{
    // invalid: class methods can't be defined in PascalCase
    public function GetUser(): array
    {
        // method implementation here
    }
}

Recommended

class User
{
    public function getUser(): array
    {
        // method implementation here
    }
}