MinnPost / object-sync-for-salesforce

WordPress plugin that maps and syncs data between Salesforce objects and WordPress objects.
https://wordpress.org/plugins/object-sync-for-salesforce/
GNU General Public License v2.0
94 stars 51 forks source link

Consider replacing the bit values with something else #375

Closed jonathanstegall closed 3 years ago

jonathanstegall commented 3 years ago

Is your feature request related to a problem? Please describe. In the Drupal 7.x module that this one was derived from, all of the triggers (create, update, delete for both directions) are defined with bit flags.

We kept this convention in these lines:

$this->sync_off              = 0x0000;
$this->sync_wordpress_create = 0x0001;
$this->sync_wordpress_update = 0x0002;
$this->sync_wordpress_delete = 0x0004;
$this->sync_sf_create        = 0x0008;
$this->sync_sf_update        = 0x0010;
$this->sync_sf_delete        = 0x0020;

Describe the solution you'd like I think in the interest of cleaner code, as well as being able to use the strict checker on arrays to make the WordPress code formatting standards happy, we should consider replacing this with something else.

jonathanstegall commented 3 years ago

See #373 for why this is worth thinking seriously about. But I do think it's wise to save it for v2.0.0, in case there's backward compatibility that it might break.