protected function validateCommand(array &$data)
    {
        if (empty($data['command'])) {
            throw new InvalidArgumentException("'command' property is required");
        }

        if (empty($data['command_arguments'])) {
            $data['command_arguments'] = [];
        }

        if (empty($data['command_environment_variables'])) {
            $data['command_environment_variables'] = [];
        }

        if (empty($data['in_background'])) {
            $data['in_background'] = false;
        }

        if ($data['in_background'] && DIRECTORY_SEPARATOR == '\\') {
            throw new LogicException('Background jobs are not supported on Windows');
        }

        if (empty($data['log_output_to_file'])) {
            $data['log_output_to_file'] = '';
        }
    }
protected function validateCommand(array &$data)
    {
        if (empty($data['command'])) {
            throw new InvalidArgumentException("'command' property is required");
        }

        if (empty($data['command_arguments'])) {
            $data['command_arguments'] = [];
        }

        if (empty($data['command_environment_variables'])) {
            $data['command_environment_variables'] = [];
        }

        if (empty($data['in_background'])) {
            $data['in_background'] = false;
        }

        if ($data['in_background'] && DIRECTORY_SEPARATOR == '\\') {
            throw new LogicException('Background jobs are not supported on Windows');
        }

        if (empty($data['log_output_to_file'])) {
            $data['log_output_to_file'] = '';
        }
    }
protected function validateCommand ( array & $ data ) { if ( empty ( $ data [ 'command' ] ) ) { throw new InvalidArgumentException ( "'command' property is required" ) ; } if ( empty ( $ data [ 'command_arguments' ] ) ) { $ data [ 'command_arguments' ] = [ ] ; } if ( empty ( $ data [ 'command_environment_variables' ] ) ) { $ data [ 'command_environment_variables' ] = [ ] ; } if ( empty ( $ data [ 'in_background' ] ) ) { $ data [ 'in_background' ] = false ; } if ( $ data [ 'in_background' ] && DIRECTORY_SEPARATOR == '\\' ) { throw new LogicException ( 'Background jobs are not supported on Windows' ) ; } if ( empty ( $ data [ 'log_output_to_file' ] ) ) { $ data [ 'log_output_to_file' ] = '' ; } }
Validate and prepare job data.

This method needs to be called from job's constructor. Expectations:

- command is required
- in_background set to true works only on Unix like platform (it is not supported on Windows)

@param array $data
Validate and prepare job data .