ManagesContactAutomations   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 22
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addContactToAutomation() 0 9 1
1
<?php
2
3
namespace TestMonitor\ActiveCampaign\Actions;
4
5
use TestMonitor\ActiveCampaign\Resources\Contact;
6
use TestMonitor\ActiveCampaign\Resources\Automation;
7
8
trait ManagesContactAutomations
9
{
10
    use ImplementsActions;
11
12
    /**
13
     * Get all organizations.
14
     *
15
     * @param \TestMonitor\ActiveCampaign\Resources\Contact $contact
16
     * @param \TestMonitor\ActiveCampaign\Resources\Automation $automation
17
     *
18
     * @return array
19
     */
20
    public function addContactToAutomation(Contact $contact, Automation $automation)
21
    {
22
        $data = [
23
            'contact' => $contact->id,
24
            'automation' => $automation->id,
25
        ];
26
27
        return $this->post('contactAutomations', ['json' => ['contactAutomation' => $data]]);
28
    }
29
}
30