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

BusinessAccount::convertToBusiness()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 1
f 0
cc 1
eloc 6
nc 1
nop 2
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
}