(b) If it appears to the court or judge that testimony is necessary for the proper disposition of the matter, the court or judge may take evidence to supplement the evidence and facts disclosed by the petition and return to the writ of certiorari, but no such review shall be by trial de novo.
(c) In passing upon the legality of the decision or order of the planning commission, board of subdivision and land development appeals, or board of zoning appeals, the court or judge may reverse, affirm or modify, in whole or in part, the decision or order.