Skip to content

Method capitalization incorrect between code, readme and stubs #2660

Open

Description

@kkmuffme

https://github.com/phpredis/phpredis#hmset

https://github.com/phpredis/phpredis/blob/develop/redis.stub.php#L1827C17-L1827C31
$redis->hmset(

https://github.com/phpredis/phpredis/blob/develop/redis.stub.php#L1829
hMset

https://github.com/phpredis/phpredis?tab=readme-ov-file#hmset
hMSet

There are 3 differently capitalized versions of this command (and various others). While this isn't an issue with PHP, it results in various code style tools and IDEs to report errors for capitalization.

Activity

  1. michael-grunder commented on May 19, 2025

    @michael-grunder
    Member

    While this isn't an issue with PHP, it results in various code style tools and IDEs to report errors for capitalization.

    I've run into this too e.g. with intelephense/phpstan in vim complaining that hmset isn't a method but hMSet is. Honestly I kind of feel like that's a bug in the linter since PHP method names are not case sensitive.

    I'm fine with moving toward normalization but the problem is how should they be normalized. All lowercase is harder to read but there are so many server commands with various naming strategies that we probably can't get to completely consistent camel casing for every one of them.

    I guess the upside if we change them is that it could be done with a program.

  2. kkmuffme commented on May 20, 2025

    @kkmuffme
    Author

    like that's a bug in the linter since PHP method names are not case sensitive.

    It definitely is, however it's unfortunately something that was/is present in some circumstances in psalm, phpstan and phpstorm in static analysis, but as well as for purely code style reporting

    can't get to completely consistent camel casing for every one of them.

    Which ones specifically?

    I think how it's done in the headlines of readme makes most sense, since that is what people generally check first and also seems to be consistent/make sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions