@@ -4,7 +4,6 @@ |
||
| 4 | 4 | use DiegoCaprioli\Larachimp\Models\LarachimpListMember; |
| 5 | 5 | use DiegoCaprioli\Larachimp\Services\Larachimp; |
| 6 | 6 | use Illuminate\Contracts\Logging\Log; |
| 7 | -use Illuminate\Support\Facades\App; |
|
| 8 | 7 | |
| 9 | 8 | class MailchimpManager |
| 10 | 9 | { |
@@ -121,8 +121,8 @@ |
||
| 121 | 121 | { |
| 122 | 122 | return LarachimpFacade::request('PATCH', 'lists/'.$this->listId.'/members/'.$subscriberHash, [ |
| 123 | 123 | 'body' => json_encode([ |
| 124 | - 'status' => $member->isSubscribedToMailchimpList() ? 'subscribed' : 'unsubscribed', |
|
| 125 | - ]), |
|
| 124 | + 'status' => $member->isSubscribedToMailchimpList() ? 'subscribed' : 'unsubscribed', |
|
| 125 | + ]), |
|
| 126 | 126 | ]); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | throw new \Exception('The Mailchimp API key is not properly set. Please verify the apikey configuration.'); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $response = LarachimpFacade::request('GET', 'lists/'.$this->listId, [ |
|
| 53 | + $response = LarachimpFacade::request('GET', 'lists/' . $this->listId, [ |
|
| 54 | 54 | 'query' => ['fields' => 'id,web_id,name'], |
| 55 | 55 | ]); |
| 56 | 56 | if (empty($response)) { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function addListMember(LarachimpListMember $member) |
| 102 | 102 | { |
| 103 | - return LarachimpFacade::request('POST', 'lists/'.$this->listId.'/members', [ |
|
| 103 | + return LarachimpFacade::request('POST', 'lists/' . $this->listId . '/members', [ |
|
| 104 | 104 | 'body' => json_encode([ |
| 105 | 105 | 'email_address' => $member->getEmail(), |
| 106 | 106 | 'status' => $member->isSubscribedToMailchimpList() ? 'subscribed' : 'unsubscribed', |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function updateListMember(LarachimpListMember $member, $subscriberHash) |
| 121 | 121 | { |
| 122 | - return LarachimpFacade::request('PATCH', 'lists/'.$this->listId.'/members/'.$subscriberHash, [ |
|
| 122 | + return LarachimpFacade::request('PATCH', 'lists/' . $this->listId . '/members/' . $subscriberHash, [ |
|
| 123 | 123 | 'body' => json_encode([ |
| 124 | 124 | 'status' => $member->isSubscribedToMailchimpList() ? 'subscribed' : 'unsubscribed', |
| 125 | 125 | ]), |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $mailchimpListMember = $this->searchMember($member); |
| 144 | 144 | |
| 145 | 145 | if ($this->log) { |
| 146 | - $this->log->info('Member Found = '.var_export($mailchimpListMember, true)); |
|
| 146 | + $this->log->info('Member Found = ' . var_export($mailchimpListMember, true)); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (empty($mailchimpListMember)) { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | /** |
| 25 | 25 | * Returns a new MailchimpManager instance ready to use. |
| 26 | 26 | * |
| 27 | - * @param Illuminate\Contracts\Logging\Log $log |
|
| 27 | + * @param Log $log |
|
| 28 | 28 | */ |
| 29 | 29 | public function __construct(Log $log = null) |
| 30 | 30 | { |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | |
| 130 | 130 | $resource = $this->baseuri . $resource; |
| 131 | 131 | |
| 132 | - $this->logRequest($method, $resource , $options); |
|
| 132 | + $this->logRequest($method, $resource, $options); |
|
| 133 | 133 | |
| 134 | 134 | try { |
| 135 | 135 | $response = $this->client->request($method, $resource, $options); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | class LarachimpServiceProvider extends ServiceProvider { |
| 7 | 7 | |
| 8 | - /** |
|
| 8 | + /** |
|
| 9 | 9 | * Register paths to be published by the publish command. |
| 10 | 10 | * |
| 11 | 11 | * @return void |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function register() |
| 27 | 27 | { |
| 28 | - $this->app->singleton('diegocaprioli_larachimp', function ($app) { |
|
| 28 | + $this->app->singleton('diegocaprioli_larachimp', function($app) { |
|
| 29 | 29 | $config = config('diegocaprioli.larachimp.larachimp'); |
| 30 | 30 | $larachimp = new Larachimp($app->make('log')); |
| 31 | 31 | $larachimp->initialize($config['apikey'], $config['baseuri']); |
@@ -41,6 +41,6 @@ |
||
| 41 | 41 | | from users |
| 42 | 42 | | |
| 43 | 43 | */ |
| 44 | - 'list_id' => env('MAILCHIMP_LIST_ID', '123'), |
|
| 44 | + 'list_id' => env('MAILCHIMP_LIST_ID', '123'), |
|
| 45 | 45 | |
| 46 | 46 | ]; |
| 47 | 47 | \ No newline at end of file |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * Create a new job instance. |
| 24 | 24 | * |
| 25 | - * @param DiegoCaprioli\Larachimp\Models\LarachimpListMember $member |
|
| 25 | + * @param LarachimpListMember $member |
|
| 26 | 26 | */ |
| 27 | 27 | public function __construct(LarachimpListMember $member) |
| 28 | 28 | { |