It may be in your local byelaws. Many places have allowed the old byelaws about swine to lapse, but some have kept them going.
Back in the late 1970s, I had to rehome a pet pig (acquired as a piglet from a pig farm where I had worked - that's a whole other long story) when I lived in Cambridgeshire. I was moving from an old farm cottage on the outskirts of a small village to a town property with large garden. Cambridge still had the antiquated byelaws about the distance from human habitation pigs had to be, and as the property backed onto a cemetery I decided that I had better be prudent. (Even I wasn't willing to risk the pig escaping and rootling in graves...

) He went to live in a village pub, where he had a goat and a horse for pals. The pig could open all the pen doors, so just used to wander around at will and became something of a local celebrity, and a favourite with the locals. They kept him at the pub until visiting customers complained about him begging for scraps of their ham sandwiches.... (This all long before the current FMD rules.) I couldn't find another home so then he went for sausages.