/**
* Constructor.
*
* Mandatory arguments:
* attributes array The main data for the object.
* context string The content type of the api resource.
*
* @param string $name The event name.
* @param array $arguments The event arguments.
*
* @since 4.0.0
* @throws \BadMethodCallException
*/
public function __construct($name, array $arguments = array())
{
if (!\array_key_exists('attributes', $arguments) || \array_key_exists('attributes', $arguments) && !is_array($arguments['attributes'])) {
throw new \BadMethodCallException("Argument 'attributes' as an array is required for event {$name}");
}
if (!\array_key_exists('context', $arguments)) {
throw new \BadMethodCallException("Argument 'context' is required for event {$name}");
}
parent::__construct($name, $arguments);
}