@@ -694,9 +694,6 @@ defmodule Application do
694694 :application . set_env ( app , key , value , opts )
695695 end
696696
697- # TODO: Remove this once we support Erlang/OTP 22+ exclusively.
698- @ compile { :no_warn_undefined , { :application , :set_env , 2 } }
699-
700697 @ doc """
701698 Puts the environment for multiple apps at the same time.
702699
@@ -705,28 +702,14 @@ defmodule Application do
705702 * have the same application listed more than once
706703 * have the same key inside the same application listed more than once
707704
708- If those conditions are not met, the behaviour is undefined
709- (on Erlang/OTP 21 and earlier) or will raise (on Erlang/OTP 22
710- and later).
705+ If those conditions are not met, it will raise.
711706
712707 It receives the same options as `put_env/4`. Returns `:ok`.
713708 """
714709 @ doc since: "1.9.0"
715710 @ spec put_all_env ( [ { app , [ { key , value } ] } ] , timeout: timeout , persistent: boolean ) :: :ok
716711 def put_all_env ( config , opts \\ [ ] ) when is_list ( config ) and is_list ( opts ) do
717- # TODO: Remove function exported? check when we require Erlang/OTP 22+
718- if function_exported? ( :application , :set_env , 2 ) do
719- :application . set_env ( config , opts )
720- else
721- for app_keyword <- config ,
722- { app , keyword } = app_keyword ,
723- key_value <- keyword ,
724- { key , value } = key_value do
725- :application . set_env ( app , key , value , opts )
726- end
727-
728- :ok
729- end
712+ :application . set_env ( config , opts )
730713 end
731714
732715 @ doc """
0 commit comments