Devise\Media\Encoding\ZencoderJob::assertValidSettings PHP Method

assertValidSettings() protected method

Validate that our settings are in correct format
protected assertValidSettings ( array $settings ) : void
$settings array
return void
    protected function assertValidSettings($settings)
    {
        if (count($settings) == 0) {
            throw new InvalidEncodingSettingsException("Must have at least one setting defined in order to start a new encoding job");
        }
        foreach ($settings as $setting) {
            if (!isset($setting['label'])) {
                throw new InvalidEncodingSettingsException("Every setting must have a label");
            }
            if (!isset($setting['format'])) {
                throw new InvalidEncodingSettingsException("Every setting must have a format");
            }
        }
    }