foss42 / apidash

API Dash is a beautiful open-source cross-platform API Client built using Flutter which can help you easily create & customize your API requests, visually inspect responses and generate API integration code. It is supported for macOS, Windows, Linux, Android & iOS. A lightweight alternative to postman/insomnia.
https://apidash.dev
Apache License 2.0
1.56k stars 291 forks source link

Validated CodeGen for PHP (cURL) #377

Closed AcousticDeveloper closed 6 months ago

AcousticDeveloper commented 6 months ago

PR Description

This PR validates code generation for PHP cURL, adds tests and fixes bugs. Bugs fixed in this PR are -

Related Issues

Checklist

Added/updated tests?

Local Setup for Testing

  1. Install PHP following the instructions in the Documentation.
  2. Locate php.ini file from locations mentioned in the configuration file location.
  3. Locate extension=curl and uncomment to enable curl for php.
  4. Create a file app.php and paste the generated code inside that file.
  5. Execute the file using php ./app.php from the terminal.
animator commented 6 months ago

Why is there no closing tags for the php code ?>

AcousticDeveloper commented 6 months ago

Why is there no closing tags for the php code ?>

@animator PHP closing tag ?> in a file containing only PHP is optional. Refer to -

  1. Instruction separation
  2. PHP Tags

image

animator commented 6 months ago

Thanks for the PR.