It's necessary for distribution methods to return a scalar when given a scalar, and to return an array when given an array.
It is also necessary to test both cases.
There's also a problem: in some distributions, the pdf method is calculated using a formula rather than by exponentiating the lpdf result, which can degrade numerical stability. A decision needs to be made.