Skip to content

Commit d73f5a5

Browse files
author
Hugo Firth
committed
Merge pull request hugofirth#2 from rtablada/master
Remove dependancy on Config Facade and updated to follow Laravel Style g...
2 parents a50be6d + 125d316 commit d73f5a5

File tree

4 files changed

+43
-44
lines changed

4 files changed

+43
-44
lines changed

src/Hugofirth/Mailchimp/Facades/MailchimpWrapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
class MailchimpWrapper extends Facade
88
{
9-
protected static function getFacadeAccessor()
10-
{
11-
return 'mailchimp_wrapper';
12-
}
9+
protected static function getFacadeAccessor()
10+
{
11+
return 'mailchimp_wrapper';
12+
}
1313
}

src/Hugofirth/Mailchimp/MailchimpServiceProvider.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ class MailchimpServiceProvider extends ServiceProvider {
1313
*/
1414
protected $defer = false;
1515

16-
/**
17-
* Bootstrap the application events.
18-
*
19-
* @return void
20-
*/
21-
public function boot()
22-
{
23-
$this->package('hugofirth/mailchimp');
24-
}
16+
/**
17+
* Bootstrap the application events.
18+
*
19+
* @return void
20+
*/
21+
public function boot()
22+
{
23+
$this->package('hugofirth/mailchimp');
24+
}
2525

2626
/**
2727
* Register the service provider.
@@ -30,10 +30,11 @@ public function boot()
3030
*/
3131
public function register()
3232
{
33-
$this->app->singleton('mailchimp_wrapper', function() {
34-
$mc = new Mailchimp(Config::get('mailchimp::apikey'));
35-
return new MailchimpWrapper($mc);
36-
});
33+
$this->app->singleton('mailchimp_wrapper', function() {
34+
$mc = new Mailchimp($this->app['config']->get('mailchimp::apikey'));
35+
36+
return new MailchimpWrapper($mc);
37+
});
3738
}
3839

3940
/**
@@ -46,4 +47,4 @@ public function provides()
4647
return array('mailchimp_wrapper');
4748
}
4849

49-
}
50+
}

src/Hugofirth/Mailchimp/MailchimpWrapper.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(Mailchimp $mc)
2626

2727
/**
2828
* Get Mailchimp_Folders object
29-
*
29+
*
3030
* @return Mailchimp_Folders
3131
*/
3232
public function folders()
@@ -36,7 +36,7 @@ public function folders()
3636

3737
/**
3838
* Get Mailchimp_Templates object
39-
*
39+
*
4040
* @return Mailchimp_Templates
4141
*/
4242
public function templates()
@@ -46,7 +46,7 @@ public function templates()
4646

4747
/**
4848
* Get Mailchimp_Users object
49-
*
49+
*
5050
* @return Mailchimp_Users
5151
*/
5252
public function users()
@@ -56,7 +56,7 @@ public function users()
5656

5757
/**
5858
* Get Mailchimp_Helper object
59-
*
59+
*
6060
* @return Mailchimp_Helper
6161
*/
6262
public function helper()
@@ -66,7 +66,7 @@ public function helper()
6666

6767
/**
6868
* Get Mailchimp_Mobile object
69-
*
69+
*
7070
* @return Mailchimp_Mobile
7171
*/
7272
public function mobile()
@@ -76,7 +76,7 @@ public function mobile()
7676

7777
/**
7878
* Get Mailchimp_Ecomm object
79-
*
79+
*
8080
* @return Mailchimp_Ecomm
8181
*/
8282
public function ecomm()
@@ -86,7 +86,7 @@ public function ecomm()
8686

8787
/**
8888
* Get Mailchimp_Neapolitan object
89-
*
89+
*
9090
* @return Mailchimp_Neapolitan
9191
*/
9292
public function neapolitan()
@@ -96,7 +96,7 @@ public function neapolitan()
9696

9797
/**
9898
* Get Mailchimp_Lists object
99-
*
99+
*
100100
* @return Mailchimp_Lists
101101
*/
102102
public function lists()
@@ -106,7 +106,7 @@ public function lists()
106106

107107
/**
108108
* Get Mailchimp_Campaigns object
109-
*
109+
*
110110
* @return Mailchimp_Campaigns
111111
*/
112112
public function campaigns()
@@ -116,7 +116,7 @@ public function campaigns()
116116

117117
/**
118118
* Get Mailchimp_Vip object
119-
*
119+
*
120120
* @return Mailchimp_Vip
121121
*/
122122
public function vip()
@@ -126,7 +126,7 @@ public function vip()
126126

127127
/**
128128
* Get Mailchimp_Reports object
129-
*
129+
*
130130
* @return Mailchimp_Reports
131131
*/
132132
public function reports()
@@ -136,14 +136,12 @@ public function reports()
136136

137137
/**
138138
* Get Mailchimp_Gallery object
139-
*
139+
*
140140
* @return Mailchimp_Gallery
141141
*/
142142
public function gallery()
143143
{
144144
return $this->mc->gallery;
145145
}
146146

147-
148147
}
149-

src/config/config.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33

44
return array(
55

6-
/*
7-
|--------------------------------------------------------------------------
8-
| API Secret Key
9-
|--------------------------------------------------------------------------
10-
|
11-
| The api secret key provided by Mailchimp. If you don't know your API key
12-
| you can find out how to get it here:
13-
| "http://kb.mailchimp.com/article/where-can-i-find-my-api-key/"
14-
|
15-
*/
6+
/*
7+
|--------------------------------------------------------------------------
8+
| API Secret Key
9+
|--------------------------------------------------------------------------
10+
|
11+
| The api secret key provided by Mailchimp. If you don't know your API key
12+
| you can find out how to get it here:
13+
| "http://kb.mailchimp.com/article/where-can-i-find-my-api-key/"
14+
|
15+
*/
1616

17-
'apikey' => 'your-key-here',
17+
'apikey' => 'your-key-here',
1818

1919

20-
);
20+
);

0 commit comments

Comments
 (0)