Eight hours labor constitutes a legal day’s work in all cases where the same is performed under the authority of any law of this State, or under the direction, or control, or by the authority of any officer of this State acting in his official capacity, or under the direction, or control or by the authority of any municipal corporation, or of any officer thereof. A stipulation to that effect shall be made a part of all contracts to which the State or any municipal corporation therein is a party.