That's weird. Jesus said exactly that, Matthew 6:5-8. It's a pretty famous section because it's right before The Lord's Prayer. It was Paul, who didn't show up until AFTER the crucifixion, who loved public spectacles of devotion.
Right Wing WatchRep. Lauren Boebert insists that public Christian worship events are necessary for America to experience revival: "I don't think that Jesus ever called for any Christian to pray only silently or to keep their faith hidden only in the prayer closet."