Skip to content

empty and isset do not work with API objects #25

Description

@louismrose

Expected Behaviour

$job = $this->client()->jobs->get(1234)->waitForCompletion();
count($job->target_files); // returns 1

empty($job->target_files); // should return true
isset($job-> target_files); // should return false

Current Behaviour

$job = $this->client()->jobs->get(1234)->waitForCompletion();
count($job->target_files); // returns

empty($job->target_files); // returns false
isset($job-> target_files); // returns true

Possible Solution

This looks to be an instance of php/php-src#19036

ZamzarObject should probably implement __isset as well as __get.

Steps to Reproduce

  1. Create an API job that returns >1 target file.
  2. Run the code in the "expected behaviour section"
  3. Observe that empty($job->target_files) and isset($job-> target_files) return the wrong values

Environment

  • zamzar-php 2.1.1
  • PHP 7.2.34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions