Git Product home page Git Product logo

php-rest-client's People

Contributors

brotkrueml avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ytok3a

php-rest-client's Issues

Allow to customise curl options

Is your feature request related to a problem? Please describe.

It may be useful to adjust the default options from curl like proxy settings or the verification of the SSL certificate. Currently, this is not possible.

Describe the solution you'd like

The ClientConfiguration object can receive an additional configuration for the curl settings as array. As the underlying browser component (kriswallsmith/Buzz) validates those settings this is not needed in the JobRoutert Client.

  • In the ClientConfiguration class an additional method withClientOptions is available to set client options overriding default values.
  • The method receives a ClientOptions value object.
  • The given client options are used at instantiation of the client.
  • The documentation is adjusted.
  • A feature entry in the changelog is available.

Road to version 2.0

For now, this is just a collection to be done once PHP 8.1 is the minimum requirement.

  • Drop support for PHP < 8.1
  • Drop support for JobRouter < 2022.1
  • Remove FileInterface
  • Remove attribute from FileStorage->current() and add return types
  • Introduce enum for priority stages (currently defined in Incident class)
  • Introduce value objects for subtable row (Incident class)
  • Remove possible null type from step, priority, pool and simulation properties in Incident class
  • Declare class properties as readonly where appropriate

Integer as value in IncidentsClientDecorator throws TypeError

Exception trace:

PHP Fatal error:  Uncaught TypeError: Argument 2 passed to Buzz\Browser::prepareMultipart() must be of the type string, int given, called in /xxx/vendor/kriswallsmith/buzz/lib/Browser.php on line 127 and defined in /xxx/vendor/kriswallsmith/buzz/lib/Browser.php:219
Stack trace:
#0 /xxx/vendor/kriswallsmith/buzz/lib/Browser.php(127): Buzz\Browser->prepareMultipart()
#1 /xxx/vendor/brotkrueml/jobrouter-client/src/Client/RestClient.php(200): Buzz\Browser->submitForm()
#2 /xxx/vendor/brotkrueml/jobrouter-client/src/Client/RestClient.php(156): Brotkrueml\JobRouterClient\Client\RestClient->sendForm()
#3 /xxx/start_instance.php(48): Brotkrueml\JobRouterClient\Client\RestClient->request()
#4 {main}
  thrown in /xxx/vendor/kriswallsmith/buzz/lib/Browser.php on line 219

Example:

$multipart = [
    'step' => '1',
    'summary' => 'Instance started via JobRouter Client',
    'processtable[fields][0][name]' => 'NAME',
    'processtable[fields][0][value]' => 'Max Mustermann',
    'subtables[0][name]' => 'KNOWLEDGE',
    'subtables[0][rows][0][fields][0][name]' => 'SUBJECT',
    'subtables[0][rows][0][fields][0][value]'=> 'Excel',
    'subtables[0][rows][0][fields][1][name]' => 'SELF_ASSESSMENT',
    'subtables[0][rows][0][fields][1][value]'=> 2,
];

$response = $client->request(
    'POST',
    'application/incidents/application',
    $multipart
);

Solution would be to cast an integer to a string for subtables.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.