The electron acceleration, in a laser wakefield accelerator, controlled through plasma density inhomogeneity is studied on a basis of 2.5-dimensional particle-in-cell simulation. The acceleration requires a concordance of the density scale length and shift of the accelerated electron bunch relative to wake bubble during electron acceleration. This paper considers the excitation of a wakefield in plasma with a density equal to the density of free electrons in metals, solid-state plasma (the original idea of Prof. T. Tajima), in the context of studying the wakefield process. As is known in the wake process, as the wake bubble moves through the plasma, the self-injected electron bunch shifts along the wake bubble. Then, the self-injected bunch falls into the phase of deceleration of the wake wave. In this paper, support of the acceleration process by maintaining the position of the self-injected electron bunch using an inhomogeneous plasma is proposed. It is confirmed that the method of maintaining phase synchronization proposed in the article by using a nonuniform plasma leads to an increase in the accelerating gradient and energy of the accelerated electron bunch in comparison with the case of self-injection and acceleration in a homogeneous plasma.