src/Controllers/HistoryViewerController.php
protected function validateInput(array $context, array $requiredFields = [])
    {
        foreach ($requiredFields as $requiredField) {
            if (empty($context[$requiredField])) {
                throw new InvalidArgumentException('Missing required field ' . $requiredField);
            }
        }
        return true;
    }
protected function validateInput(array $context, array $requiredFields = [])
    {
        foreach ($requiredFields as $requiredField) {
            if (empty($context[$requiredField])) {
                throw new InvalidArgumentException('Missing required field ' . $requiredField);
            }
        }
        return true;
    }
protected function validateInput ( array $ context , array $ requiredFields = [ ] ) { foreach ( $ requiredFields as $ requiredField ) { if ( empty ( $ context [ $ requiredField ] ) ) { throw new InvalidArgumentException ( 'Missing required field ' . $ requiredField ) ; } } return true ; }
Perform some centralised validation checks on the input request and data within it

@param array $context
@param string[] $requiredFields
@return bool
@throws InvalidArgumentException
Perform some centralised validation checks on the input request and data within it