fingerprintjs / fingerprint-pro-server-api-php-sdk

PHP SDK for Fingerprint Pro Server API
MIT License
22 stars 6 forks source link

refactor: introduce async method and wip inline types #100

Closed Orkuncakilkaya closed 2 months ago

Orkuncakilkaya commented 2 months ago

I made the changes based on your comments. Please resolve all previous unresolved comments if you think they are resolved @TheUnderScorer.

ilfa commented 2 months ago

There is one more thing that you need to fix.

Sealed is not working actually. Maybe it was broken before, maybe stronger types highlighted the problem and finally broke it.

What you need to do:

  1. run sealed_results_example.php. 1.1. getEnv will not work, you'll need to add
    $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
    $dotenv->safeLoad();

    1.2 you will get error PHP Fatal error: Uncaught TypeError: Fingerprint\ServerAPI\Model\EventResponse::getProducts(): Return value must be of type Fingerprint\ServerAPI\Model\ProductsResponse, array returned

  2. You will need to change the wrong deserialization (new EventResponse($data)) to the correct one (check how it done for API request) (I made it for python here)
  3. Add tests for it (be sure that the will fail with current code)
github-actions[bot] commented 2 months ago

This PR will create a major release :rocket:

5.0.0 (2024-08-21)

⚠ BREAKING CHANGES

Features

Bug Fixes