protected function ensureRequiredProperties(Entity $entity, array $properties): void
    {
        // Iterate through the required properties
        foreach ($entity::getRequiredProperties() as $requiredProperty) {
            // If the required property is not set
            if (! isset($properties[$requiredProperty])) {
                // Throw an exception
                throw new InvalidArgumentException('Missing required property: ' . $requiredProperty);
            }
        }
    }
protected function ensureRequiredProperties(Entity $entity, array $properties): void
    {
        // Iterate through the required properties
        foreach ($entity::getRequiredProperties() as $requiredProperty) {
            // If the required property is not set
            if (! isset($properties[$requiredProperty])) {
                // Throw an exception
                throw new InvalidArgumentException('Missing required property: ' . $requiredProperty);
            }
        }
    }
protected function ensureRequiredProperties ( Entity $ entity , array $ properties ) : void { // Iterate through the required properties foreach ( $ entity :: getRequiredProperties ( ) as $ requiredProperty ) { // If the required property is not set if ( ! isset ( $ properties [ $ requiredProperty ] ) ) { // Throw an exception throw new InvalidArgumentException ( 'Missing required property: ' . $ requiredProperty ) ; } } }
Ensure all required properties have been passed.

@param Entity $entity
@param array  $properties

@throws InvalidArgumentException

@return void
Ensure all required properties have been passed .