php-graphql-oqm icon indicating copy to clipboard operation
php-graphql-oqm copied to clipboard

Duplicate Method Names

Open GenieTim opened this issue 4 years ago • 1 comments

Thank you very much for this awesome tool. I encountered an (admittedly, rather odd) edge-case for which I would open a PR if you consider it worth it (and tell me what your desired resolution is).

The problem is the following:

Duplicate methods are generated for an API with two fields in two different "cases".

Example: an API that has a field timeZone and a field time_zone (of which one might be deprecated) (this applies e.g. to Pipefy: https://api-docs.pipefy.com/reference/objects/User/) will result in two times the function

public function selectTimeZone()

, one time selecting timeZone and one time time_zone.

PHP does not like that of course. I can imagine various resultions: If there are multiple,

  1. just discard the deprecated one,
  2. use the case as used in the API (i.e. resulting in one selectTimeZone() and one selectTime_zone(),
  3. select both at once

Shall I open a PR with which of these possibilities? (Any hints on where to look for the deciding code?)

GenieTim avatar Mar 04 '21 15:03 GenieTim

This particular API also includes fields with the name field (e.g. here: https://api-docs.pipefy.com/reference/objects/CardField/) which leads to SomeChileQueryObject::selectField( overriding AbstractQueryBuilder::selectField(

GenieTim avatar Mar 04 '21 16:03 GenieTim