src/Models/Ticket.php
private function storeInput($values)
    {
        $requiredKeys = [
            'subject',
            'account_id',
            'inbound_email_account_id',
            'email_address',
        ];

        foreach ($requiredKeys as $key)
        {
            if (!array_key_exists($key, $values))
            {
                throw new InvalidArgumentException("$key is a required key in the input array.");
            }
        }

        foreach ($values as $key => $value)
        {
            if ($value === null)
            {
                continue;
            }
            $function = ucwords(StringFormatter::camelCase($key));
            try {
                call_user_func([$this, "set$function"], $value);
            }
            catch (Exception $e)
            {
                continue;
            }
        }
    }
private function storeInput($values)
    {
        $requiredKeys = [
            'subject',
            'account_id',
            'inbound_email_account_id',
            'email_address',
        ];

        foreach ($requiredKeys as $key)
        {
            if (!array_key_exists($key, $values))
            {
                throw new InvalidArgumentException("$key is a required key in the input array.");
            }
        }

        foreach ($values as $key => $value)
        {
            if ($value === null)
            {
                continue;
            }
            $function = ucwords(StringFormatter::camelCase($key));
            try {
                call_user_func([$this, "set$function"], $value);
            }
            catch (Exception $e)
            {
                continue;
            }
        }
    }
private function storeInput ( $ values ) { $ requiredKeys = [ 'subject' , 'account_id' , 'inbound_email_account_id' , 'email_address' , ] ; foreach ( $ requiredKeys as $ key ) { if ( ! array_key_exists ( $ key , $ values ) ) { throw new InvalidArgumentException ( "$key is a required key in the input array." ) ; } } foreach ( $ values as $ key => $ value ) { if ( $ value === null ) { continue ; } $ function = ucwords ( StringFormatter :: camelCase ( $ key ) ) ; try { call_user_func ( [ $ this , "set$function" ] , $ value ) ; } catch ( Exception $ e ) { continue ; } } }
Store the input from the constructor
@param $values
Store the input from the constructor