addContactToAutomation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 2
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