Following the example here: https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-programmatically-add-a-handler-to-a-new-webform
I've created my handler manager sucessfully, however, when I go to create the handler, I get the error
Error: Unsupported operand types in Drupal\webform\Plugin\WebformHandlerBase->setConfiguration() (line 363 of /var/www/sitename/web/modules/contrib/webform/src/Plugin/WebformHandlerBase.php
Here's a sample of the code I'm using to get this error
$webform_machine_name = 'form_id';
$webform = \Drupal\webform\Entity\Webform::load($webform_machine_name);
$handler_manager = \Drupal::service('plugin.manager.webform.handler');
// Create webform handler.
$handler_configuration = [
'id' => 'my_form_handler',
'label' => 'My form handler',
'handler_id' => 'my_form_handler',
'status' => 1,
'weight' => 0,
'settings' => [],
];
$handler = $handler_manager->createInstance('my_form_handler', $handler_configuration );