fern-api / fern

Input OpenAPI. Output SDKs and Docs.
https://buildwithfern.com
Apache License 2.0
2.68k stars 152 forks source link

feat(php): Setup root client generation #4641

Closed amckinney closed 2 months ago

amckinney commented 2 months ago

This adds a variety of new AST nodes and sets up file generation (w/ imports) so that we can start generating the root client. A few things to note:

  1. The Argument node was brought into generator-commons since it doesn't depend on any IR types.
  2. The external/GuzzleClient and core/RawClient types are added to make it easier to interact with these types.
    • Additional external/core dependencies can be placed in the external and core directories, respectively.
  3. The PHP namespace must be generated before imports, so all namespace writing is handled in the Writer.

For now, we just instantiate the $defaultHeader, and construct the RawClient from client options and/or the default Guzzle client. Note that all seed tests currently fail due to phpstan complaining about unused parameters (which will be resolved).