Completed
Push — master ( 7d378c...9da044 )
by Sergey
03:36 queued 01:11
created

BusinessAccount   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A convertToBusiness() 0 10 1
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Traits;
4
5
use seregazhuk\PinterestBot\Helpers\UrlBuilder;
6
7
trait BusinessAccount
8
{
9
    use HandlesRequest;
10
11
    /**
12
     * Convert your account to a business one.
13
     *
14
     * @param string $businessName
15
     * @param string $websiteUrl
16
     * @return bool
17
     */
18
    public function convertToBusiness($businessName, $websiteUrl = '')
19
    {
20
        $data = [
21
            'business_name' => $businessName,
22
            'website_url'   => $websiteUrl,
23
            'account_type'  => 'other',
24
        ];
25
26
        return $this->execPostRequest($data, UrlBuilder::RESOURCE_CONVERT_TO_BUSINESS);
27
    }
28
}