@@ -25,9 +25,7 @@ class MailServiceProvider extends ServiceProvider
2525 public function register ()
2626 {
2727 $ this ->registerSwiftMailer ();
28-
2928 $ this ->registerIlluminateMailer ();
30-
3129 $ this ->registerMarkdownRenderer ();
3230 }
3331
@@ -38,18 +36,20 @@ public function register()
3836 */
3937 protected function registerIlluminateMailer ()
4038 {
41- $ this ->app ->singleton ('mailer ' , function ($ app ) {
42- $ config = $ app ->make ('config ' )->get ('mail ' );
39+ $ this ->app ->singleton ('mailer ' , function () {
40+ $ config = $ this -> app ->make ('config ' )->get ('mail ' );
4341
4442 // Once we have create the mailer instance, we will set a container instance
4543 // on the mailer. This allows us to resolve mailer classes via containers
4644 // for maximum testability on said classes instead of passing Closures.
4745 $ mailer = new Mailer (
48- $ app ['view ' ], $ app ['swift.mailer ' ], $ app ['events ' ]
46+ $ this ->app ['view ' ],
47+ $ this ->app ['swift.mailer ' ],
48+ $ this ->app ['events ' ]
4949 );
5050
51- if ($ app ->bound ('queue ' )) {
52- $ mailer ->setQueue ($ app ['queue ' ]);
51+ if ($ this -> app ->bound ('queue ' )) {
52+ $ mailer ->setQueue ($ this -> app ['queue ' ]);
5353 }
5454
5555 // Next we will set all of the global addresses on this mailer, which allows
@@ -92,14 +92,14 @@ public function registerSwiftMailer()
9292 // Once we have the transporter registered, we will register the actual Swift
9393 // mailer instance, passing in the transport instances, which allows us to
9494 // override this transporter instances during app start-up if necessary.
95- $ this ->app ->singleton ('swift.mailer ' , function ($ app ) {
96- if ($ domain = $ app ->make ('config ' )->get ('mail.domain ' )) {
95+ $ this ->app ->singleton ('swift.mailer ' , function () {
96+ if ($ domain = $ this -> app ->make ('config ' )->get ('mail.domain ' )) {
9797 Swift_DependencyContainer::getInstance ()
9898 ->register ('mime.idgenerator.idright ' )
9999 ->asValue ($ domain );
100100 }
101101
102- return new Swift_Mailer ($ app ['swift.transport ' ]->driver ());
102+ return new Swift_Mailer ($ this -> app ['swift.transport ' ]->driver ());
103103 });
104104 }
105105
@@ -110,8 +110,8 @@ public function registerSwiftMailer()
110110 */
111111 protected function registerSwiftTransport ()
112112 {
113- $ this ->app ->singleton ('swift.transport ' , function ($ app ) {
114- return new TransportManager ($ app );
113+ $ this ->app ->singleton ('swift.transport ' , function () {
114+ return new TransportManager ($ this -> app );
115115 });
116116 }
117117
@@ -128,10 +128,10 @@ protected function registerMarkdownRenderer()
128128 ], 'laravel-mail ' );
129129 }
130130
131- $ this ->app ->singleton (Markdown::class, function ($ app ) {
132- $ config = $ app ->make ('config ' );
131+ $ this ->app ->singleton (Markdown::class, function () {
132+ $ config = $ this -> app ->make ('config ' );
133133
134- return new Markdown ($ app ->make ('view ' ), [
134+ return new Markdown ($ this -> app ->make ('view ' ), [
135135 'theme ' => $ config ->get ('mail.markdown.theme ' , 'default ' ),
136136 'paths ' => $ config ->get ('mail.markdown.paths ' , []),
137137 ]);
0 commit comments