MinnPost/object-sync-for-salesforce

PHP 5.6 syntax errors

jonathanstegall opened this issue · 2 comments

Describe the bug
See this forum post.

The offending line of code is, at least:

// load mappings that match this criteria
// in this case, it's all mappings that correspond to the posted WordPress object.
$sf_mappings = $this->mappings->get_fieldmaps(
    null, // id field must be null for multiples.
    array_merge(
        $this->mappings->active_fieldmap_conditions,
        array(
            'wordpress_object' => $object_type,
        )
    ),
);

To Reproduce
Steps to reproduce the behavior:

  1. Install PHP 5.6.
  2. Try to run the plugin

Additional context

That comma is incorrect, as it's essentially a list of parameters in a function call with a comma after the last one. I'm not positive that removing the comma would fix PHP 5.6 issue, but it's possible, and either way I really do think it was a mistake to put the comma in there.

Presumably there are more commas to hunt down. It would be nice if it were possible to run 5.6 through Laravel Valet, but this is no longer supported. I'm not entirely sure what to do to further test all of this without a viable localhost. Maybe a VirtualBox kind of setup.

In a future release, should instead just remove support for PHP versions below 7.4, as this is what wordpress.org now says.