The CP-violating weak phase $phi_mathrm{s}$ and the decay width difference $DeltaGamma_{mathrm{s}}$ of $mathrm{B}^{0}_{mathrm{s}}$ mesons are measured by the CMS experiment at the LHC using a data sample of $mathrm{B}^{0}_{mathrm{s}} ! to mathrm{J} / psi,phi$ decays. The analysed dataset corresponds to an integrated luminosity of about $20~mathrm{fb}^{-1}$ collected in $pp$ collisions at a centre-of-mass energy $sqrt{s} = 8~mathrm{TeV}$. A total of $49,000$ reconstructed $mathrm{B}^{0}_{mathrm{s}}$ decays are used to extract the values $phi_mathrm{s}$ and $DeltaGamma_mathrm{s}$ by performing a time-dependent and flavour-tagged angular analysis of the $mu^+mu^-mathrm{K}^+mathrm{K}^-$ final state.The weak phase is measured to be $phi_mathrm{s} = -0.03 pm 0.11~mathrm{(stat.)} pm 0.03~mathrm{(syst.)}~mathrm{rad}$, and the decay width difference between the $mathrm{B}^{0}_{mathrm{s}}$ mass eigenstates is $DeltaGamma_mathrm{s} = 0.096 pm 0.014~mathrm{(stat.)} pm 0.007~mathrm{(syst.)}~mathrm{ps}^{-1}$.