Atomtronics has the potential for engineering new types of functional devices, such as Josephson junctions (JJs). Previous studies have mainly focused on JJs whose ground states have 0 or $pi $ superconducting phase difference across the junctions, while arbitrarily tunable phase JJs may have important applications in superconducting electronics and quantum computation. Here we show that a phase tunable JJ can be implemented in a spin-orbit coupled cold atomic gas with the magnetic tunneling barrier generated by a spin-dependent focused laser beam. We consider the JJ confined in either a linear harmonic trap or a circular ring trap. In the ring trap, the magnetic barrier induces a spontaneous mass current for the ground state of the JJ, demonstrating the magnetoelectric effects of cold atoms.