Skip to content

Different issues related to Enums on PHP7 #169

Description

@maurogesuitti

Summary

The requirement for the latest version of this package is "PHP 7.3 and later" but PHP 7.X doesn't support Enums so I am getting errors on serialization.

Expected Behavior

The package should work normally on PHP 7 or the requirement should be different.

Current Behavior

syntax error, unexpected 'PostcardSize' (T_STRING)

PostcardSize is an Enum

Steps to Reproduce

(new LettersApi($config, $guzzleClient))->create(new LetterEditable($data));

--> Exception: syntax error, unexpected 'PostcardSize' (T_STRING)
--> /var/www/vendor/lob/lob-php/lib/ObjectSerializer.php:93
--> FYI: $data['size'] === "4x6";

Context (Environment)

  • I got the same exception with any API method that uses Enums.
  • I am using PHP 7.4.6 and Laravel 6.
  • If there is another way to use the library that works on PHP 7 that would be awesome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions