I agree, most likely to be berberis, the inner wood does tend to be yellow. There are several different varieties, so a pic would be helpful. We had a huge monstrosity of a thing at one place we lived, OH hated it, but it was worth it for the stunning display of orange flowers every year - the whole house and garden was perfumed like honey! Plus it was a good nesting place for birds - we had long tailed tits take up residence one year, lovely little things - 'flying teaspoons' my OH calls them, most apt. I don't think it's poisonous, but don't quote me on that, I'd be surprised if a sheep would eat it anyway.