Consider using another method that iterates over the array instead. You can typehint an array or so.