High-resolution thermal-expansion and specific-heat data of isovalently substituted single-crystalline BaFe${}_{2}$(As${}_{1\ensuremath{-}x}$P${}_{x}$)${}_{2}$ ($0\ensuremath{\le}x\ensuremath{\le}0.33$, $x=1$) are presented. We show that crystals can be detwinned in situ in the capacitance dilatometer, allowing a study of all three independent crystallographic directions. From the thermal-expansion data, we determine the phase diagram via a thermodynamic probe, study the coupling of the spin-density wave (SDW) and superconducting order parameters, and determine various pressure dependencies of the normal and superconducting states. Our results show that in the underdoped region, superconductivity and SDW order coexist and compete with each other. The resulting phase diagram, however, exhibits a smaller coexistence region of SDW and superconductivity with a steeper rise of ${T}_{c}$ on the underdoped side than in, e.g., Ba(Fe${}_{1\ensuremath{-}x}$Co${}_{x}$)${}_{2}$As${}_{2}$. On the overdoped side, where there is no sign of SDW order, the lattice parameters respond to superconductivity in much the same way as to the SDW on the underdoped side, which demonstrates the intimate connection between both kinds of order. Using thermodynamic relations, the uniaxial pressure derivatives of the superconducting critical temperature and the electronic Sommerfeld coefficient are determined from our thermal-expansion data together with the specific-heat data. We find that uniaxial pressure is proportional to P substitution and that the electronic density of states has a maximum at optimal doping. Overall, the coupling of the SDW and superconducting order to the lattice parameters of BaFe${}_{2}$(As${}_{1\ensuremath{-}x}$P${}_{x}$)${}_{2}$ is found to be qualitatively very similar to that of the well-studied, supposedly electron-doped Ba(Fe${}_{1\ensuremath{-}x}$Co${}_{x}$)${}_{2}$As${}_{2}$ system.