I had a lack of digital input pins for a pushbutton rotary encoder switch so I used an analog input.
I wrote up my results here: https://analog10.com/posts/rotary_encoder_analog_input.html
It works pretty well except for an occasional reverse tick but that's probably a flaw in my code.