A novel method of analysis of double-lined eclipsing binaries containing a radially pulsating star is presented. The combined pulsating–eclipsing light curve is built up from a purely eclipsing light-curve grid created using an existing modelling tool. For every pulsation phase, the instantaneous radius and surface brightness are taken into account, being calculated from the disentangled radial velocity curve of the pulsating star and from its out-of-eclipse pulsational light curve and the light ratio of the components, respectively. The best model is found using the Markov chain Monte Carlo method. The method is applied to the eclipsing binary Cepheid OGLE-LMC-CEP-0227 (Ppuls = 3.80 d, Porb = 309 d). We analyse a set of new spectroscopic and photometric observations for this binary, simultaneously fitting OGLE V-band, I-band and Spitzer 3.6 μm photometry. We derive a set of fundamental parameters of the system significantly improving the precision comparing to the previous results obtained by our group. The Cepheid mass and radius are M1 = 4.165 ± 0.032 M⊙ and R1 = 34.92 ± 0.34 R⊙, respectively. For the first time a direct, geometrical and distance-independent determination of the Cepheid projection factor is presented. The value p = 1.21 ± 0.03(stat.) ± 0.04(syst.) is consistent with theoretical expectations for a short-period Cepheid and interferometric measurements for δ Cep. We also find a very high value of the optical limb darkening coefficients for the Cepheid component, in strong disagreement with theoretical predictions for static atmospheres at a given surface temperature and gravity.