@@ -130,14 +130,12 @@ public function first($key = null, $format = null)
130130 */
131131 public function get ($ key , $ format = null )
132132 {
133- $ format = $ this ->checkFormat ($ format );
134-
135133 // If the message exists in the container, we will transform it and return
136134 // the message. Otherwise, we'll return an empty array since the entire
137135 // methods is to return back an array of messages in the first place.
138136 if (array_key_exists ($ key , $ this ->messages ))
139137 {
140- return $ this ->transform ($ this ->messages [$ key ], $ format , $ key );
138+ return $ this ->transform ($ this ->messages [$ key ], $ this -> checkFormat ( $ format) , $ key );
141139 }
142140
143141 return array ();
@@ -178,10 +176,10 @@ protected function transform($messages, $format, $messageKey)
178176 // We will simply spin through the given messages and transform each one
179177 // replacing the :message place holder with the real message allowing
180178 // the messages to be easily formatted to each developer's desires.
179+ $ replace = array (':message ' , ':key ' );
180+
181181 foreach ($ messages as &$ message )
182182 {
183- $ replace = array (':message ' , ':key ' );
184-
185183 $ message = str_replace ($ replace , array ($ message , $ messageKey ), $ format );
186184 }
187185
0 commit comments